feat: add user set-password, remove-role and roles commands - #31
Merged
Conversation
|
Warning Review limit reachedNext included review available in 3 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (4)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…ver)
set_user_password guessed PUT realms/{realm}/users/{id}/password
(404). The real endpoint is PUT realms/{realm}/users/{id}/reset-password
- found via the 405 Allow header while probing against a running
FerrisKey server.
NathaelB
force-pushed
the
feature/user-password-role-management
branch
from
September 2, 2026 22:20
2cc8b33 to
0290c06
Compare
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
user set-password <username> [--temporary] (--password <value> | --stdin)— set a user's password.--stdinis the way to avoid leaking the password into shell history / the process list;--passwordis kept for scripts that accept that trade-off. Exactly one of the two is required.user remove-role <username> <role>— remove a realm role from a user (mirrors the already-shippedassign-role).user roles <username>— list a user's realm roles.set_user_password(PUT realms/{realm}/users/{id}/reset-password),remove_user_role(DELETE realms/{realm}/users/{id}/roles/{role_id}, mirroring the existingassign_user_rolePOST),list_user_roles(GET realms/{realm}/users/{id}/roles).Issue
Refs #23 — not closing it:
--client <client_id>onassign-role/remove-role(assigning a client role to a user) is still missing. I didn't want to guess that endpoint's shape (likely a doubly-nested path under both the user and the client) without a way to verify it against a running server. Left for a follow-up.Verification
Verified live against a local FerrisKey server: created a throwaway user, ran
roles(empty),assign-role+roles(shows it),remove-role+roles(empty again),set-passwordwith--password,--temporary, and--stdin, then deleted the test fixtures. Caught and fixed one wrong assumption this way:set_user_passwordoriginally guessedPUT .../users/{id}/password(404) — the real endpoint isPUT .../users/{id}/reset-password, found via theAllowheader on a 405.remove_user_role/list_user_rolesworked first try, mirroring the already-correctassign_user_role/list_realm_rolesshapes.Test plan
cargo build --workspacecargo test --workspace(66 passed, +6 new: password-source resolution)cargo clippy --workspace --all-targets --all-features -- -D warnings(matches CI, no issues)