Uh oh!
There was an error while loading. Please reload this page.
Add set-password command with admin functionality and CLI documentation - #307
Add set-password command with admin functionality and CLI documentation#307duanemay wants to merge 2 commits into
set-password command with admin functionality and CLI documentation#307Conversation
There was a problem hiding this comment.
Pull request overview
Adds an administrative set-password command to the uaa CLI and documents it in the command reference and UAAC migration guide.
Changes:
- Introduces
uaa set-password USERNAMEwith optional interactive password prompt, plus--origin/--zonesupport. - Adds Ginkgo/Gomega coverage for success paths and common error/validation scenarios.
- Updates CLI docs to include
set-passwordand references it from the UAAC migration table.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| docs/migrating-from-uaac.md | Updates UAAC→UAA command mapping table to reference set-password (and currently also references unlock-user). |
| docs/commands/set-password.md | New documentation page for uaa set-password (usage, flags, examples, auth requirements). |
| docs/commands.md | Adds set-password to the command reference index. |
| cmd/set_password.go | Implements set-password command, lookup-by-username then PUT to /Users/{id}/password. |
| cmd/set_password_test.go | Adds integration-style command tests using ghttp server assertions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| // Get password from flag or prompt if not provided | ||
| if userPassword == "" { | ||
| secret := cli.InteractiveSecret{Prompt: "New password"} | ||
| var err error | ||
| userPassword, err = secret.Get() | ||
| if err != nil { | ||
| cli.NotifyErrorsWithRetry(err, log, GetSavedConfig()) | ||
| return | ||
| } | ||
| } |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| path := fmt.Sprintf("/Users/%s/password", userID) | ||
| data := fmt.Sprintf(`{"password": "%s"}`, password) | ||
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Remove the unused Meta.Version check that misleadingly implied optimistic locking; set-password only needs the user ID. JSON-encode the password with encoding/json instead of raw fmt.Sprintf to avoid producing invalid JSON when the password contains quotes, backslashes, or newlines. Surface the UAA response body in errors (both the password PUT and the SCIM lookup) instead of a status-only message, and give an actionable error when the interactive password prompt fails on non-TTY stdin. Also fix a dead link to the not-yet-merged unlock-user docs in the UAAC migration guide. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
adrianhoelzl-sap
left a comment
There was a problem hiding this comment.
The JSON escaping issue reported by Copilot looks valid to me, can you please check?
No description provided.