Skip to content

feat: add realm role get/delete and client-scoped roles - #30

Merged
NathaelB merged 1 commit into
mainfrom
feature/realm-role-get-delete-client-scope
Sep 2, 2026
Merged

feat: add realm role get/delete and client-scoped roles#30
NathaelB merged 1 commit into
mainfrom
feature/realm-role-get-delete-client-scope

Conversation

@NathaelB

@NathaelB NathaelB commented Sep 2, 2026

Copy link
Copy Markdown
Member

Summary

  • realm role get <name> [--client <client_id>] — look up a realm or client role by name.
  • realm role delete <name> [--client <client_id>] — delete a realm or client role (confirmation prompt, --force to skip).
  • --client <client_id> on role create and role list — reach client roles, not just realm roles.
  • New client methods: delete_role, list_client_roles, following the realms/{realm}/[clients/{uuid}/]roles[/{id}] convention used elsewhere. create_client_role was already there but decoded its response as an enveloped {"data": ...} payload like create_role — turns out that endpoint returns the role as a bare object; fixed. There's no client-scoped delete endpoint — role ids are unique across realm and client scopes, so plain delete_role deletes both; dropped the delete_client_role method I'd initially guessed at.

Issue

Closes #22.

Verification

Verified live against a local FerrisKey server (create/get/list/delete, both realm-scoped and client-scoped roles) — not just unit tests. Caught and fixed one real bug in the process (the create_client_role envelope mismatch above) and dropped one endpoint that doesn't exist server-side.

Test plan

  • cargo build --workspace
  • cargo test --workspace (60 passed)
  • cargo clippy --workspace --all-targets --all-features -- -D warnings
  • Manual smoke test against a running FerrisKey server: role create/get/list/delete, realm-scoped and --client-scoped, then cleaned up the test fixtures

@NathaelB NathaelB self-assigned this Sep 2, 2026
@coderabbitai

coderabbitai Bot commented Sep 2, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 29 minutes.

Check out review usage here.

View limit details

Limit 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.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Team

Run ID: 15976918-d5c1-4011-a6f9-58e97d6d1930

📥 Commits

Reviewing files that changed from the base of the PR and between fabf9e6 and 640fe73.

📒 Files selected for processing (4)
  • libs/ferriskey-cli-client/src/lib.rs
  • libs/ferriskey-cli-commands/src/lib.rs
  • libs/ferriskey-cli-commands/src/realm.rs
  • libs/ferriskey-cli-core/src/realm.rs

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@NathaelB
NathaelB merged commit 01c681d into main Sep 2, 2026
4 checks passed
@NathaelB
NathaelB deleted the feature/realm-role-get-delete-client-scope branch September 2, 2026 21:10
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

Successfully merging this pull request may close these issues.

No role command: roles cannot be managed from the CLI

1 participant