MT-23076: support expires_at on the api token tools - #136
Draft
oshchyhol wants to merge 4 commits into
Draft
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
This was referenced Aug 7, 2026
Draft
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
MT-23076
The API token endpoints now accept an optional
expires_at(createApiTokenrequest body and a new optionalresetApiTokenbody). This exposes it on thecreate-api-tokenandreset-api-tokentools.Changes
expires_at(type: ["string", "null"]) to thecreate-api-tokeninput schema andCreateApiTokenRequest; the description spells out the tri-state for the LLM (omit = server default, null = never expires, 5-year cap)resetApiTokeninput schema – reset previously sharedapiTokenSchemawith get/delete, which hasadditionalProperties: falseand would reject the new parameter; get/delete keep the shared schemareset-api-tokenhandler forwards{ expires_at }toapiTokens.reset(id, body)only when the key is present, so calls without it keep sending no request bodyHow to test
create-api-tokenwith only a name – token created, expiration behavior unchanged (server default applies once rolled out)create-api-tokenwithexpires_at: "2027-06-01T00:00:00Z"– created token reports that expirationcreate-api-tokenwithexpires_at: null– created token never expirescreate-api-tokenwith a pastexpires_at– tool returns the server's 422 validation errorreset-api-tokenwith onlyapi_token_id– works exactly as before (no request body sent)reset-api-tokenwithexpires_at: null– new token never expiresCompanion PRs
Depends on the mailtrap npm release that ships MT-23076 (mailtrap-nodejs companion PR):
createalready passesexpires_atthrough at runtime on mailtrap@4.8, butresetignores the extra body argument until the dependency is bumped. Before merge, bumpmailtrapin package.json to that release and drop the local signature cast insrc/tools/apiTokens/resetApiToken.ts.Caveat: release/merge only after falcon deploys MT-23076 and zap_api_token_expiration is enabled in production.