Skip to content

Commit

Permalink
feat(users): add shouldResetPassword flag to user create and update
Browse files Browse the repository at this point in the history
  • Loading branch information
reubenmiller committed Jan 22, 2025
1 parent af1c9b7 commit 41dd6ae
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 0 deletions.
12 changes: 12 additions & 0 deletions api/spec/json/users.json
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,12 @@
"required": false,
"description": "User password. Min: 6, max: 32 characters. Only Latin1 chars allowed"
},
{
"name": "shouldResetPassword",
"type": "boolean",
"required": false,
"description": "User must reset password on next login"
},
{
"name": "sendPasswordResetEmail",
"type": "boolean",
Expand Down Expand Up @@ -472,6 +478,12 @@
"required": false,
"description": "User password. Min: 6, max: 32 characters. Only Latin1 chars allowed"
},
{
"name": "shouldResetPassword",
"type": "boolean",
"required": false,
"description": "User must reset password on next login"
},
{
"name": "sendPasswordResetEmail",
"type": "boolean",
Expand Down
10 changes: 10 additions & 0 deletions api/spec/yaml/users.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,11 @@ commands:
required: false
description: 'User password. Min: 6, max: 32 characters. Only Latin1 chars allowed'

- name: shouldResetPassword
type: boolean
required: false
description: User must reset password on next login

# TODO: Only set value if it has changed!
- name: sendPasswordResetEmail
type: boolean
Expand Down Expand Up @@ -353,6 +358,11 @@ commands:
required: false
description: 'User password. Min: 6, max: 32 characters. Only Latin1 chars allowed'

- name: shouldResetPassword
type: boolean
required: false
description: User must reset password on next login

# TODO: Only set value if it has changed!
- name: sendPasswordResetEmail
type: boolean
Expand Down
2 changes: 2 additions & 0 deletions pkg/cmd/users/create/create.auto.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions pkg/cmd/users/update/update.auto.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions tools/PSc8y/Public/New-User.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ Create a user
[string]
$Password,

# User must reset password on next login
[Parameter()]
[switch]
$ShouldResetPassword,

# Send password reset email to the user instead of setting a password
[Parameter()]
[ValidateSet('true','false')]
Expand Down
5 changes: 5 additions & 0 deletions tools/PSc8y/Public/Update-User.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ Update a user
[string]
$Password,

# User must reset password on next login
[Parameter()]
[switch]
$ShouldResetPassword,

# Send password reset email to the user instead of setting a password
[Parameter()]
[ValidateSet('true','false')]
Expand Down

0 comments on commit 41dd6ae

Please sign in to comment.