CDX-12: console: support expirations on app passwords - #38444
Draft
jubrad wants to merge 2 commits into
Draft
Conversation
Frontegg's user and tenant API token endpoints accept `expiresInMinutes` on create and return `expires` on list, but the console never used either, so every app password was immortal and the list gave no signal about staleness. Add an Expiration select to the new app password modal (30/60/90 days or no expiration, defaulting to 90 days) and an Expires column to the list that renders "Never" for passwords without an expiration and flags expired and soon to expire ones with a status pill. CDX-12
Drop the redundant aria-label on the expiration select so the label/id wiring is what tests exercise, let StatusPill derive its own text, and cover the service password path in the test. CDX-12
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.
CDX-12
Problem
Console app passwords (Frontegg user/tenant API tokens) were immortal: the create flow only took a description, and the list gave no signal about which credentials were stale. That blocks customers with credential-rotation requirements and makes cleanup guesswork.
Solution
Frontegg already supports this end to end, so no backend work was needed. Confirmed against
frontegg/openapi-public/identity.json:POST .../{users,tenants}/api-tokens/v1acceptexpiresInMinutes(omitted = never expires).GETlist responses returnexpires(date-time). Note the field isexpires, notexpiresAt.lastUsed/lastSeenfield anywhere in the identity spec, so "show last use" is not buildable from Frontegg. Follow-up write-up is on the Linear issue.Changes:
expiresInMinutesthroughcreateUserApiToken/createTenantApiTokenanduseCreateApiToken, and typeexpireson the token interfaces.Testing
New
src/access/AppPasswordsPage.test.tsxcovers a legacy token with noexpiresrendering "Never", the expired and expiring-soon pills, the default create postingexpiresInMinutes: 129600, and "No expiration" posting noexpiresInMinutes.yarn lint,yarn typecheck, and the console suite pass locally;console-e2e-test/console-e2e-test-prodexercise the real-region path.Reviewer notes
connectComponents,ConnectMcpPanel,MzCliAppPasswordPage) are deliberately unchanged. The param is optional, so those keep creating non-expiring passwords. Adding an expiration control there is a follow-up.src/frontegg-auth'sactive_sessionscache serves repeat authentications without calling Frontegg and refreshes at ~0.8x JWT lifetime, so an already-authenticated app password can keep working for up to one refresh period past its expiry. This is the same bounded window that already exists when a password is deleted, not a new regression.src/frontegg-mockmodels no expiry (it accepts onlydescription). Console e2e hits real staging Frontegg so the mock is not on this path; teaching itexpiresInMinutes/expiresis a cheap follow-up if a Rust integration test ever needs it.🤖 Generated with Claude Code