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.
- package/dist/authhero.cjs +3 -3
- package/dist/authhero.d.ts +269 -247
- package/dist/authhero.mjs +6 -5
- package/dist/tsconfig.types.tsbuildinfo +1 -1
- package/dist/types/helpers/reserved-claims.d.ts +19 -3
- package/dist/types/index.d.ts +247 -247
- package/dist/types/routes/auth-api/index.d.ts +9 -9
- package/dist/types/routes/auth-api/passwordless.d.ts +8 -8
- package/dist/types/routes/auth-api/well-known.d.ts +1 -1
- package/dist/types/routes/management-api/authentication-methods.d.ts +1 -1
- package/dist/types/routes/management-api/failed-events.d.ts +1 -1
- package/dist/types/routes/management-api/guardian.d.ts +5 -5
- package/dist/types/routes/management-api/index.d.ts +218 -218
- package/dist/types/routes/management-api/keys.d.ts +12 -12
- package/dist/types/routes/management-api/logs.d.ts +4 -4
- package/dist/types/routes/management-api/migration-sources.d.ts +6 -6
- package/dist/types/routes/management-api/tenant-operations.d.ts +1 -1
- package/dist/types/routes/management-api/users.d.ts +12 -12
- package/dist/types/routes/universal-login/flow-api.d.ts +4 -4
- package/dist/types/routes/universal-login/u2-index.d.ts +5 -5
- package/dist/types/routes/universal-login/u2-routes.d.ts +5 -5
- package/dist/types/types/AuthHeroConfig.d.ts +21 -0
- package/dist/types/types/Bindings.d.ts +1 -0
- package/dist/types/utils/jwks.d.ts +2 -2
- package/package.json +1 -1
|
@@ -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" | "
|
|
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" | "
|
|
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
|
-
|
|
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;
|