Skip to content

MT-23076: document api token expiration - #51

Draft
oshchyhol wants to merge 2 commits into
mainfrom
MT-23076-api-token-expiration
Draft

MT-23076: document api token expiration#51
oshchyhol wants to merge 2 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

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 279db6c9-8711-4079-97bd-ad36d7d17977

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

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