fix(auth-backend): default catalog presence check to on, rename config

Address review feedback: flip the catalog user existence check to
enabled by default and rename the config option to
`dangerouslyDisableCatalogPresenceCheck` as an escape hatch. Also use
`error.name` instead of `instanceof` for cross-realm error safety.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: MT Lewis <mtlewis@users.noreply.github.com>
This commit is contained in:
MT Lewis
2026-05-07 16:51:35 +01:00
parent 27f24a9a0f
commit ed4ffaa3b3
4 changed files with 52 additions and 57 deletions
+7 -4
View File
@@ -134,13 +134,16 @@ export interface Config {
*/
maxTokensPerUser?: number;
/**
* Whether to validate that the user's catalog entity exists when
* refreshing a token. When enabled, tokens for users removed from
* the catalog will be rejected and revoked.
* Disables the check that verifies the user's catalog entity still
* exists when refreshing a token. This is an escape hatch for
* Backstage instances that allow sign-in without a corresponding
* catalog user entity. Without the check, refresh tokens for
* removed or offboarded users remain valid until they naturally
* expire.
* @default false
* @visibility backend
*/
validateCatalogUserExistence?: boolean;
dangerouslyDisableCatalogPresenceCheck?: boolean;
};
/**