Skip to content

feat(admin): support service account updates#264

Merged
cxymds merged 1 commit into
mainfrom
cxymds/issue-261-service-account-update
Jul 20, 2026
Merged

feat(admin): support service account updates#264
cxymds merged 1 commit into
mainfrom
cxymds/issue-261-service-account-update

Conversation

@cxymds

@cxymds cxymds commented Jul 20, 2026

Copy link
Copy Markdown
Member

Related issue

Closes #261

Background

The CLI supports creating, inspecting, listing, and removing service accounts, but it cannot update an existing account even though the RustFS Admin API exposes the operation. Infrastructure automation therefore has to recreate accounts just to change a policy or another mutable field.

Root cause

The core admin abstraction and S3 admin client did not expose the update-service-account endpoint, and the CLI had no command for constructing partial update requests.

Solution

  • Add a partial service account update request to the core admin API.
  • Call POST /rustfs/admin/v3/update-service-account?accessKey=... from the S3 admin client.
  • Add rc admin service-account update with edit and set aliases.
  • Support policy, secret key, status, name, description, and expiration updates while preserving unspecified fields.
  • Reject empty updates and unreadable policy files with usage errors.
  • Keep replacement secret keys out of command output.
  • Add unit, HTTP, CLI integration, and help-contract coverage plus a README example.

User impact

Service account permissions and metadata can now be managed declaratively without deleting and recreating credentials.

Validation

  • cargo fmt --all --check
  • cargo clippy --workspace -- -D warnings
  • cargo test --workspace

@cxymds
cxymds marked this pull request as ready for review July 20, 2026 11:57
@cxymds
cxymds merged commit 2004108 into main Jul 20, 2026
16 checks passed
@cxymds
cxymds deleted the cxymds/issue-261-service-account-update branch July 20, 2026 23:58
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.

Allow to update the service account policy via CLI since RustFS Console allows

1 participant