authhero 9.11.0 → 9.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -15,9 +15,9 @@ export declare const USERINFO_RESERVED_CLAIMS: readonly ["iss", "sub", "aud", "e
15
15
  * vendor/tenant for downstream APIs while `sub` stays `auth-service`.
16
16
  * Client-bound mints keep `azp` locked (see below).
17
17
  */
18
- export declare const SERVICE_TOKEN_RESERVED_CLAIMS: ("client_id" | "scope" | "sid" | "tenant_id" | "sub" | "org_name" | "permissions" | "iat" | "org_id" | "exp" | "iss" | "aud" | "auth_time" | "acr" | "amr" | "nbf" | "jti" | "act" | "requested_userinfo_claims" | "gty")[];
18
+ export declare const SERVICE_TOKEN_RESERVED_CLAIMS: ("client_id" | "scope" | "sid" | "tenant_id" | "iss" | "sub" | "aud" | "exp" | "nbf" | "iat" | "jti" | "auth_time" | "acr" | "amr" | "act" | "permissions" | "org_id" | "org_name" | "requested_userinfo_claims" | "gty")[];
19
19
  /** Client-bound mints: `azp` must stay the registered client id. */
20
- export declare const CLIENT_SERVICE_TOKEN_RESERVED_CLAIMS: ("client_id" | "scope" | "sid" | "tenant_id" | "sub" | "org_name" | "permissions" | "iat" | "org_id" | "exp" | "iss" | "aud" | "auth_time" | "acr" | "amr" | "azp" | "nbf" | "jti" | "act" | "requested_userinfo_claims" | "gty")[];
20
+ export declare const CLIENT_SERVICE_TOKEN_RESERVED_CLAIMS: ("client_id" | "scope" | "sid" | "tenant_id" | "iss" | "sub" | "aud" | "exp" | "nbf" | "iat" | "jti" | "azp" | "auth_time" | "acr" | "amr" | "act" | "permissions" | "org_id" | "org_name" | "requested_userinfo_claims" | "gty")[];
21
21
  export type AccessTokenReservedClaim = (typeof ACCESS_TOKEN_RESERVED_CLAIMS)[number];
22
22
  export type IdTokenReservedClaim = (typeof ID_TOKEN_RESERVED_CLAIMS)[number];
23
23
  /**
@@ -31,7 +31,23 @@ export type ServerOwnedAccessTokenClaims = Partial<Record<AccessTokenReservedCla
31
31
  export type ServerOwnedIdTokenClaims = Partial<Record<IdTokenReservedClaim, unknown>>;
32
32
  /** Which payload a custom claim is being written to. */
33
33
  export type ClaimPayloadKind = "access_token" | "id_token" | "userinfo" | "service_token" | "client_service_token";
34
- export declare function isReservedClaim(claim: string, kind: ClaimPayloadKind): boolean;
34
+ /**
35
+ * Transitional escape hatch for `init({ unsafeAllowAzpCustomClaim: true })`.
36
+ *
37
+ * A deployment that shipped `azp` as a tenant-owned claim before this module
38
+ * existed cannot un-reserve it atomically: every downstream service reading
39
+ * `azp` has to be moved off it first, and until then reserving the name simply
40
+ * deletes the claim from the token (the mint never emits `azp` itself). The
41
+ * flag keeps those tokens intact while that migration runs.
42
+ *
43
+ * It is unsafe because `middlewares/authentication.ts` reads `azp` as the
44
+ * calling client's id, so a hook-supplied value lands in the request context
45
+ * where a registered client id is expected. Enable it only to buy time, and
46
+ * only where the hooks writing `azp` are first-party code.
47
+ */
48
+ export declare function isReservedClaim(claim: string, kind: ClaimPayloadKind, options?: {
49
+ allowAzpOverride?: boolean;
50
+ }): boolean;
35
51
  export interface ApplyCustomClaimOptions {
36
52
  /** Which payload is being written to — selects the reserved set. */
37
53
  kind: ClaimPayloadKind;