From c8e837da5b9427cacb1db5a3b562f11466226699 Mon Sep 17 00:00:00 2001 From: David Zemon Date: Mon, 19 Sep 2022 08:00:18 -0500 Subject: [PATCH] feat: Use JsonValue for JWT claim values Signed-off-by: David Zemon --- plugins/auth-backend/api-report.md | 2 +- plugins/auth-backend/src/identity/types.ts | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/plugins/auth-backend/api-report.md b/plugins/auth-backend/api-report.md index 2420a79a79..6e9de12cdb 100644 --- a/plugins/auth-backend/api-report.md +++ b/plugins/auth-backend/api-report.md @@ -706,7 +706,7 @@ export type TokenParams = { claims: { sub: string; ent?: string[]; - } & Record; + } & Record; }; // @public (undocumented) diff --git a/plugins/auth-backend/src/identity/types.ts b/plugins/auth-backend/src/identity/types.ts index 49d78b8472..e325f74c81 100644 --- a/plugins/auth-backend/src/identity/types.ts +++ b/plugins/auth-backend/src/identity/types.ts @@ -14,6 +14,8 @@ * limitations under the License. */ +import { JsonValue } from '@backstage/types'; + /** Represents any form of serializable JWK */ export interface AnyJWK extends Record { use: 'sig'; @@ -33,14 +35,15 @@ export type TokenParams = { * the subject claim, `sub`. It is common to also list entity ownership relations in the * `ent` list. Additional claims may also be added at the developer's discretion except * for the following list, which will be overwritten by the TokenIssuer: `iss`, `aud`, - * `iat`, and `exp`. + * `iat`, and `exp`. The Backstage team also maintains the right add new claims in the future + * without listing the change as a "breaking change". */ claims: { /** The token subject, i.e. User ID */ sub: string; /** A list of entity references that the user claims ownership through */ ent?: string[]; - } & Record; + } & Record; }; /**