Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.
TypeScript acmeagentsai-agentscertificate-managementdevsecopsenvironment-variableskubernetesopen-sourcepampkipostgresprivate-caprivileged-access-managementsecret-managementsecret-managersecretssecrets-managementsecuritysecurity-toolsvault
Enhance access token revocation documentation and update test implementation
Victor Hugo dos Santos86ec2edeb419
diff --git a/backend/src/services/identity-access-token/identity-access-token-service.test.ts b/backend/src/services/identity-access-token/identity-access-token-service.test.tsindex 361612921b..b50223319d 100644--- a/backend/src/services/identity-access-token/identity-access-token-service.test.ts+++ b/backend/src/services/identity-access-token/identity-access-token-service.test.ts@@ -61,7 +61,9 @@ const createService = ({};// getItemPrimary shares the getItem mock so tests that stub getItem by key also// cover the primary-pinned version reads.- keyStore.getItemPrimary.mockImplementation((key: string, prefix?: string) => keyStore.getItem(key, prefix));+ keyStore.getItemPrimary.mockImplementation(+ (key: string, prefix?: string) => keyStore.getItem(key, prefix) as Promise<string | null>+ );const identityAccessTokenRevocationDAL = {findActiveRevocationsForToken: vi.fn().mockResolvedValue(activeRevocations),insertRevocation: vi.fn()diff --git a/docs/documentation/platform/identities/machine-identities.mdx b/docs/documentation/platform/identities/machine-identities.mdxindex fdd88fbe63..eed2eb676d 100644--- a/docs/documentation/platform/identities/machine-identities.mdx+++ b/docs/documentation/platform/identities/machine-identities.mdx@@ -67,6 +67,24 @@ Lockout is a feature that prevents brute-force attacks on identity login endpoinSupported auth methods have lockout enabled by default. If triggered, lockout temporarily disables the login endpoint for 5 minutes after 3 consecutive failed login attempts within a 30-second window. Lockout can be configured and disabled in the identity auth method settings.+## Access Token Revocation++Machine identity access tokens can be invalidated before their natural expiry. An access token is revoked when you:++- Call the token revoke endpoint for that token (for example, `POST /api/v1/auth/token/revoke` for Universal Auth).+- Delete the identity, which revokes all of its active access tokens.+- Remove the credential the token was issued from, such as deleting a Universal Auth client secret or removing an authentication method from the identity.++Once revoked, the token is rejected on subsequent authenticated requests and can no longer be renewed. The revocation is persisted in Infisical's database, which is the source of truth consulted on every authentication check.++<Note>+ To keep authentication fast under high request volume, Infisical caches the result of each revocation check in Redis for a short period. Under normal operation a revocation takes effect immediately, because revoking a token also invalidates any cached decision for that identity.++ In the rare event that this cache invalidation cannot be written (for example, a transient Redis disruption during the revoke), the database record still reflects the revocation, but a previously cached "allow" result for that exact token may continue to be honored until it expires on its own. This window is bounded to roughly 12 minutes, after which the decision is re-evaluated against the database and the revoked token is rejected.++ If you need a revocation to take effect with no propagation delay even under those conditions, rotate the underlying credential (delete the Universal Auth client secret) or delete the identity, both of which invalidate the affected tokens regardless of cache state.+</Note>+## FAQ<AccordionGroup>