Skip to content

cli: Add rotate-api-key admin command - #529

Open
KatyaRomashko wants to merge 3 commits into
redhat-ai-americas:mainfrom
KatyaRomashko:fix/459-rotate-api-key
Open

cli: Add rotate-api-key admin command#529
KatyaRomashko wants to merge 3 commits into
redhat-ai-americas:mainfrom
KatyaRomashko:fix/459-rotate-api-key

Conversation

@KatyaRomashko

Copy link
Copy Markdown
Collaborator

Summary

Adds memoryhub admin rotate-api-key <client_id> to rotate just the api_key for an agent without touching client_secret — mirrors the existing rotate-secret command, following the same pattern.

Linked issues

Closes #459

Design reference

  • docs/identity-model/cli-requirements.md

Type of change

  • type:feature — new user-visible capability

Subsystem

Closest existing label: subsystem:client

Test plan

  • Unit tests only — no infrastructure boundaries touched (pure logic, no DB/Valkey/embedding service interaction)
  • pytest passes locally (or the affected subset)
  • New tests added for new behavior

pytest memoryhub-cli/tests/test_admin.py — all tests pass, including new TestRotateApiKey (happy path, JSON output, 404 not-found).

Reviewer checklist

  • Design doc referenced or created
  • No committed credentials or cluster-specific URLs
  • CLAUDE.md / docs updated if behavior or conventions changed
  • Commit message follows subsystem: Imperative summary format

Release readiness (if this PR touches sdk/ or memoryhub-cli/)

  • pyproject.toml version matches __init__.py __version__
  • CHANGELOG.md has an entry for the new version
  • If breaking: CHANGELOG entry is flagged with BREAKING and links the tracking issue

  - Show api_key alongside client_secret in create-agent table output
  - Fix --write-config to write api_key instead of client_secret
  - Show api_key in rotate-secret table output (server regenerates both)
  - Update docstrings and help text to reflect both values

  Fixes redhat-ai-americas#458
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.

CLI: add rotate-api-key subcommand

1 participant