Skip to content

ocp4_workload_tenant_rhacs: Add API token creation and APIToken creator role#42

Merged
wkulhanek merged 1 commit into
mainfrom
feat/rhacs-api-token-creation
Apr 24, 2026
Merged

ocp4_workload_tenant_rhacs: Add API token creation and APIToken creator role#42
wkulhanek merged 1 commit into
mainfrom
feat/rhacs-api-token-creation

Conversation

@wkulhanek
Copy link
Copy Markdown
Collaborator

Summary

  • Add APIToken creator to default RHACS roles so users can create their own tokens via the UI
  • Automatically generate a long-lived (14-day) API token during provisioning via POST /v1/apitokens/generate and save it as rhacs_api_token in agnosticd_user_info
  • Revoke user's API tokens during teardown via the RHACS apitokens API

New Variables

  • ocp4_workload_tenant_rhacs_create_api_token (default: true) — toggle API token creation
  • ocp4_workload_tenant_rhacs_api_token_expiration_days (default: 14) — token TTL in days

Test plan

  • Deploy against a cluster with RHACS and verify user gets both Analyst and APIToken creator roles
  • Verify API token is created and returned in agnosticd_user_info
  • Test token works for RHACS API calls (e.g., GET /v1/alerts with bearer token)
  • Run remove_workload and verify token is revoked
  • Test with ocp4_workload_tenant_rhacs_create_api_token: false to confirm token tasks are skipped

🤖 Generated with Claude Code

…or role

Grant the APIToken creator role to users so they can create tokens via
the RHACS UI. Automatically generate a 14-day API token during
provisioning and save it to agnosticd_user_info. Revoke tokens on
teardown via the apitokens API.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@wkulhanek wkulhanek merged commit d79bea7 into main Apr 24, 2026
1 check passed
@wkulhanek wkulhanek deleted the feat/rhacs-api-token-creation branch April 24, 2026 09:26
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.

1 participant