Skip to content

MT-23076: document api token expiration - #51

Open
oshchyhol wants to merge 3 commits into
mainfrom
MT-23076-api-token-expiration
Open

MT-23076: document api token expiration#51
oshchyhol wants to merge 3 commits into
mainfrom
MT-23076-api-token-expiration

Conversation

@oshchyhol

@oshchyhol oshchyhol commented Aug 7, 2026

Copy link
Copy Markdown

Motivation

MT-23076

API tokens now expire. createApiToken accepts an optional expires_at, resetApiToken gains an optional request body with the same param, and permission updates on an expired token are rejected. The spec needs to describe all of it.

Changes

  • createApiToken: new optional nullable expires_at (ISO 8601 date-time) on CreateApiTokenRequest, plus the request example and the operation description – omitted means the token expires 1 year after creation, null means it never expires, and values must be no more than 5 years ahead
  • resetApiToken: new optional request body carrying the same expires_at param, plus a cURL sample that sends it; the description now says already-expired tokens cannot be reset (422) instead of the old "only tokens with no expiration set can be reset"
  • updatePermissions: documented the 422 response and the reason for it (permissions of an expired API token cannot be updated)
  • fixed the account-access ApiToken specifier in getAllUsersInAccount: the field is masked_token (the token value with all but the last characters masked), not token – the API has never returned a full token value there

How to test

  • the spec lints clean in CI
  • in the rendered reference, "Create API token" shows expires_at as an optional nullable date-time with the 1-year default and 5-year cap described, and the request example includes it
  • "Reset API token" shows an optional request body with expires_at and the cURL sample sending it, and states that expired tokens cannot be reset
  • "Manage permissions" lists a 422 response
  • "List users and tokens" shows masked_token on the API token specifier, matching what the endpoint actually returns
  • against the deployed API: POST /api/api_tokens with no expires_at, with a date-time, and with null all behave as documented, and a past date returns 422

Companion PRs

Caveat: merge only after falcon deploys MT-23076 and zap_api_token_expiration is enabled in production – the docs describe the 1-year default, which only applies once the flag is on.

@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 3d11cabc-9079-4ea7-b349-8c6785cdee43


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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the Account Management OpenAPI spec to document newly introduced API token expiration behavior, including request parameters, validation rules, and related 422 error cases.

Changes:

  • Documented expires_at (optional, nullable, date-time) for createApiToken, including request example and expiry semantics.
  • Added an optional request body to resetApiToken to accept expires_at, updated cURL sample, and documented 422 behavior for expired tokens.
  • Documented 422 for permission updates on expired API tokens, and corrected the account-access ApiToken specifier field to masked_token.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread specs/account-management.openapi.yml
@oshchyhol
oshchyhol requested review from IgorDobryn and izikaj August 24, 2026 07:20
@oshchyhol
oshchyhol force-pushed the MT-23076-api-token-expiration branch from 4cf1bbe to e75ba55 Compare August 24, 2026 15:11
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.

5 participants