Add commands for manage users groups and access#339
Merged
Conversation
13a6cc9 to
cabfa61
Compare
AlwxSin
reviewed
Apr 29, 2026
AlwxSin
left a comment
There was a problem hiding this comment.
There are lack of some test scenarios:
- no grant -> revoke round-trip
- no remove-member tests
- no tests for UserOperation creation
- no tests for group create/delete
Signed-off-by: Ivan Zvyagintsev <ivan.zvyagintsev@flant.com>
Signed-off-by: Ivan Zvyagintsev <ivan.zvyagintsev@flant.com>
3256302 to
e90a2cb
Compare
AlwxSin
approved these changes
May 6, 2026
ldmonster
approved these changes
May 6, 2026
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.
Description
New
d8 iamcommand tree for managing local users, groups, and access grants. Five top-level subcommands underinternal/iam/:d8 iam user—create/delete/reset-password/reset2fa/lock/unlock.d8 iam group—create/delete/add-member/remove-member.d8 iam access—grant/revoke.d8 iam get—user,group,rule.d8 iam list—users|user,groups|group,rules|rule.Read verbs are top-level (
d8 iam get user alice,d8 iam list users), not per-domain wrappers.Subjects are positional.
grant/revoketake-n/--namespace(repeatable, AR) or--scope cluster|all-namespaces|labels=K=V[,K2=V2,...](CAR withnamespaceSelector.labelSelector). Capabilities (--allow-scale,--port-forwarding) compose with any scope. d8-managed grants get a deterministic name, sogrant/revokeare idempotent.Password input is unified across
user createanduser reset-password: interactive (default),--password-stdin,--generate-password, or--password-hash. The CLI handles the format difference betweenUser.spec.password(base64-bcrypt) andUserOperation.spec.resetPassword.newPasswordHash(raw bcrypt).Shell completion covers command names, resource names, namespaces, access levels, scope values, rule refs, and output formats. Common k8s helpers (
PrintObject,NewDynamicClient,AddOutputFlag,CompleteResourceNames, ...) live ininternal/utilk8s/. The previously top-leveld8 userwas moved underd8 iam user.Why do we need it, and what problem does it solve?
Managing users, groups, and access in Deckhouse today means hand-crafting
User,Group,AuthorizationRule, andClusterAuthorizationRuleCRs and applying them viakubectl. There is no first-class CLI for inventory, "who has access to what", or safe revocation.d8 iamprovides:iam list users|groups(aggregated table) andiam get user|group <name>(direct grants, transitive group membership, inherited grants, effective summary, warnings for cycles / orphaned members / manually maintained rules), withSuperAdminwildcard capabilities surfaced as implicit;iam list rules/iam get rulewith reverse lookup of subjects to localUser/GroupCRs;grant/revokeWhy do we need it in the patch release (if we do)?
Not necessarily.
Changelog entries