Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Tests for New-PasswordStateList function #103

Open
trir262 opened this issue May 2, 2020 · 2 comments
Open

Create Tests for New-PasswordStateList function #103

trir262 opened this issue May 2, 2020 · 2 comments

Comments

@trir262
Copy link
Contributor

trir262 commented May 2, 2020

I'd like to create unit tests for the New-PasswordStateList function similar to what I've created before. Unfortunately my account in our company is not allowed to create passwordlists.
Can you provide me an example request/response json file I can use to create the tests?
Thanks!

@dnewsholme
Copy link
Owner

@trir262 you can use my test instance, it's only got dummy data anyway. https://devpws01.northeurope.cloudapp.azure.com/logins/forms/login.aspx?

I'll send you the credentials in an email.

@eizedev
Copy link
Contributor

eizedev commented May 3, 2020

@trir262

Here is a json request that you could use for the test environment.

Just change the SecurityGroupName to a valid name in the testing environment. You could also use a SecurityGroupID or a UserID (domain\Name). Perhaps @dnewsholme can provide a existing group name/id/userid.

TemplateID 1 should exist in every environment (i hope so).

Example:

new-passwordstatelist -Name "PublicTestList" -Description "Public List for testing" `
-Guide "Test Guide" -ImageFileName "authentication.png" `
-LinkToTemplate 1 -CopySettingsFromTemplateID 1 `
-Permission "A" -ApplyPermissionsForSecurityGroupName "<GROUP NAME>"

Request:

{
  "PasswordList": "PublicTestList",
  "Description": "Public List for testing",
  "CopySettingsFromPasswordListID": "",
  "CopySettingsFromTemplateID": "1",
  "CopyPermissionsFromPasswordListID": "",
  "CopyPermissionsFromTemplateID": "",
  "NestUnderFolderID": 0,
  "LinkToTemplate": "1",
  "SiteID": 0,
  "ApplyPermissionsForUserID": "",
  "ApplyPermissionsForSecurityGroupID": "",
  "ApplyPermissionsForSecurityGroupName": "<GROUP NAME>",
  "ImageFileName": "authentication.png",
  "PasswordGeneratorID": 0,
  "PasswordStrengthPolicyID": 1,
  "PreventBadPasswordUse": false,
  "AllowExport": false,
  "PasswordResetEnabled": false,
  "PrivatePasswordList": false,
  "Permission": "A",
  "Guide": "Test Guide"
}

Response:

PasswordListID                : 255
PasswordList                  : PublicTestList
Description                   : Public List for testing
ImageFileName                 : authentication.png
Guide                         : Test Guide
AllowExport                   : False
PrivatePasswordList           : False
TimeBasedAccessRequired       : False
NoApprovers                   : 1
DisableNotifications          : False
PasswordStrengthPolicyID      : 1
PasswordGeneratorID           : 1
CodePage                      : Using Passwordstate Default Code Page
PreventPasswordReuse          : 5
AuthenticationType            : None Required
AuthenticationPerSession      : False
PreventExpiryDateModification : False
SetExpiryDate                 : 0
ResetExpiryDate               : 0
PreventDragDrop               : True
PreventBadPasswordUse         : True
ProvideAccessReason           : False
TreePath                      : \
TotalPasswords                : 0
GeneratorName                 : Default Password Generator
PolicyName                    : Default Policy
PasswordResetEnabled          : False
ForcePasswordGenerator        : False
HidePasswords                 : False
ShowGuide                     : False
EnablePasswordResetSchedule   : False
PasswordResetSchedule         : 00:00
AddDaysToExpiryDate           : 90
SiteID                        : 0
SiteLocation                  : Internal
OneTimePasswords              : False

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants