@lindorm/aegis 0.8.0 → 0.9.0
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/README.md +84 -5
- package/dist/classes/Aegis.d.ts +20 -5
- package/dist/classes/Aegis.d.ts.map +1 -1
- package/dist/classes/Aegis.js +259 -45
- package/dist/classes/Aegis.js.map +1 -1
- package/dist/classes/CoseKit.d.ts +31 -0
- package/dist/classes/CoseKit.d.ts.map +1 -0
- package/dist/classes/CoseKit.js +64 -0
- package/dist/classes/CoseKit.js.map +1 -0
- package/dist/classes/CweKit.d.ts +24 -0
- package/dist/classes/CweKit.d.ts.map +1 -0
- package/dist/classes/CweKit.js +73 -0
- package/dist/classes/CweKit.js.map +1 -0
- package/dist/classes/CwmKit.d.ts +22 -0
- package/dist/classes/CwmKit.d.ts.map +1 -0
- package/dist/classes/CwmKit.js +54 -0
- package/dist/classes/CwmKit.js.map +1 -0
- package/dist/classes/CwsKit.d.ts +24 -0
- package/dist/classes/CwsKit.d.ts.map +1 -0
- package/dist/classes/CwsKit.js +60 -0
- package/dist/classes/CwsKit.js.map +1 -0
- package/dist/classes/CwtKit.d.ts +31 -0
- package/dist/classes/CwtKit.d.ts.map +1 -0
- package/dist/classes/CwtKit.js +65 -0
- package/dist/classes/CwtKit.js.map +1 -0
- package/dist/classes/JoseKit.d.ts +32 -0
- package/dist/classes/JoseKit.d.ts.map +1 -0
- package/dist/classes/JoseKit.js +66 -0
- package/dist/classes/JoseKit.js.map +1 -0
- package/dist/classes/JweKit.d.ts.map +1 -1
- package/dist/classes/JweKit.js +31 -3
- package/dist/classes/JweKit.js.map +1 -1
- package/dist/classes/JwsKit.d.ts.map +1 -1
- package/dist/classes/JwsKit.js +19 -3
- package/dist/classes/JwsKit.js.map +1 -1
- package/dist/classes/JwtKit.d.ts +4 -1
- package/dist/classes/JwtKit.d.ts.map +1 -1
- package/dist/classes/JwtKit.js +100 -20
- package/dist/classes/JwtKit.js.map +1 -1
- package/dist/classes/SignatureKit.d.ts.map +1 -1
- package/dist/classes/SignatureKit.js +5 -1
- package/dist/classes/SignatureKit.js.map +1 -1
- package/dist/constants/token-type.d.ts +1 -1
- package/dist/constants/token-type.d.ts.map +1 -1
- package/dist/constants/token-type.js +2 -0
- package/dist/constants/token-type.js.map +1 -1
- package/dist/errors/AegisError.d.ts +1 -0
- package/dist/errors/AegisError.d.ts.map +1 -1
- package/dist/errors/AegisError.js +1 -0
- package/dist/errors/AegisError.js.map +1 -1
- package/dist/errors/JweError.d.ts +1 -0
- package/dist/errors/JweError.d.ts.map +1 -1
- package/dist/errors/JweError.js +1 -0
- package/dist/errors/JweError.js.map +1 -1
- package/dist/errors/JwsError.d.ts +1 -0
- package/dist/errors/JwsError.d.ts.map +1 -1
- package/dist/errors/JwsError.js +1 -0
- package/dist/errors/JwsError.js.map +1 -1
- package/dist/errors/JwtError.d.ts +1 -0
- package/dist/errors/JwtError.d.ts.map +1 -1
- package/dist/errors/JwtError.js +1 -0
- package/dist/errors/JwtError.js.map +1 -1
- package/dist/interfaces/Aegis.d.ts +6 -1
- package/dist/interfaces/Aegis.d.ts.map +1 -1
- package/dist/internal/claims/events.d.ts +5 -0
- package/dist/internal/claims/events.d.ts.map +1 -0
- package/dist/internal/claims/events.js +3 -0
- package/dist/internal/claims/events.js.map +1 -0
- package/dist/internal/claims/registry.d.ts +14 -0
- package/dist/internal/claims/registry.d.ts.map +1 -0
- package/dist/internal/claims/registry.js +61 -0
- package/dist/internal/claims/registry.js.map +1 -0
- package/dist/internal/claims/sub-id.d.ts +7 -0
- package/dist/internal/claims/sub-id.d.ts.map +1 -0
- package/dist/internal/claims/sub-id.js +11 -0
- package/dist/internal/claims/sub-id.js.map +1 -0
- package/dist/internal/cose/act-claim.d.ts +4 -0
- package/dist/internal/cose/act-claim.d.ts.map +1 -0
- package/dist/internal/cose/act-claim.js +8 -0
- package/dist/internal/cose/act-claim.js.map +1 -0
- package/dist/internal/cose/alg-labels.d.ts +4 -0
- package/dist/internal/cose/alg-labels.d.ts.map +1 -0
- package/dist/internal/cose/alg-labels.js +42 -0
- package/dist/internal/cose/alg-labels.js.map +1 -0
- package/dist/internal/cose/cbor.d.ts +11 -0
- package/dist/internal/cose/cbor.d.ts.map +1 -0
- package/dist/internal/cose/cbor.js +37 -0
- package/dist/internal/cose/cbor.js.map +1 -0
- package/dist/internal/cose/compact-map.d.ts +11 -0
- package/dist/internal/cose/compact-map.d.ts.map +1 -0
- package/dist/internal/cose/compact-map.js +43 -0
- package/dist/internal/cose/compact-map.js.map +1 -0
- package/dist/internal/cose/cose-key-thumbprint.d.ts +5 -0
- package/dist/internal/cose/cose-key-thumbprint.d.ts.map +1 -0
- package/dist/internal/cose/cose-key-thumbprint.js +60 -0
- package/dist/internal/cose/cose-key-thumbprint.js.map +1 -0
- package/dist/internal/cose/cose-key.d.ts +8 -0
- package/dist/internal/cose/cose-key.d.ts.map +1 -0
- package/dist/internal/cose/cose-key.js +98 -0
- package/dist/internal/cose/cose-key.js.map +1 -0
- package/dist/internal/cose/cose-typ.d.ts +2 -0
- package/dist/internal/cose/cose-typ.d.ts.map +1 -0
- package/dist/internal/cose/cose-typ.js +8 -0
- package/dist/internal/cose/cose-typ.js.map +1 -0
- package/dist/internal/cose/cwt-claims.d.ts +7 -0
- package/dist/internal/cose/cwt-claims.d.ts.map +1 -0
- package/dist/internal/cose/cwt-claims.js +94 -0
- package/dist/internal/cose/cwt-claims.js.map +1 -0
- package/dist/internal/cose/enc-labels.d.ts +5 -0
- package/dist/internal/cose/enc-labels.d.ts.map +1 -0
- package/dist/internal/cose/enc-labels.js +47 -0
- package/dist/internal/cose/enc-labels.js.map +1 -0
- package/dist/internal/cose/structures.d.ts +20 -0
- package/dist/internal/cose/structures.d.ts.map +1 -0
- package/dist/internal/cose/structures.js +22 -0
- package/dist/internal/cose/structures.js.map +1 -0
- package/dist/internal/cose/sub-id-claim.d.ts +4 -0
- package/dist/internal/cose/sub-id-claim.d.ts.map +1 -0
- package/dist/internal/cose/sub-id-claim.js +18 -0
- package/dist/internal/cose/sub-id-claim.js.map +1 -0
- package/dist/internal/profiles/definitions/access-token.d.ts +3 -0
- package/dist/internal/profiles/definitions/access-token.d.ts.map +1 -0
- package/dist/internal/profiles/definitions/access-token.js +31 -0
- package/dist/internal/profiles/definitions/access-token.js.map +1 -0
- package/dist/internal/profiles/definitions/client-assertion.d.ts +3 -0
- package/dist/internal/profiles/definitions/client-assertion.d.ts.map +1 -0
- package/dist/internal/profiles/definitions/client-assertion.js +18 -0
- package/dist/internal/profiles/definitions/client-assertion.js.map +1 -0
- package/dist/internal/profiles/definitions/default.d.ts +3 -0
- package/dist/internal/profiles/definitions/default.d.ts.map +1 -0
- package/dist/internal/profiles/definitions/default.js +14 -0
- package/dist/internal/profiles/definitions/default.js.map +1 -0
- package/dist/internal/profiles/definitions/delegation.d.ts +3 -0
- package/dist/internal/profiles/definitions/delegation.d.ts.map +1 -0
- package/dist/internal/profiles/definitions/delegation.js +19 -0
- package/dist/internal/profiles/definitions/delegation.js.map +1 -0
- package/dist/internal/profiles/definitions/erasure-token.d.ts +3 -0
- package/dist/internal/profiles/definitions/erasure-token.d.ts.map +1 -0
- package/dist/internal/profiles/definitions/erasure-token.js +28 -0
- package/dist/internal/profiles/definitions/erasure-token.js.map +1 -0
- package/dist/internal/profiles/definitions/id-token.d.ts +3 -0
- package/dist/internal/profiles/definitions/id-token.d.ts.map +1 -0
- package/dist/internal/profiles/definitions/id-token.js +26 -0
- package/dist/internal/profiles/definitions/id-token.js.map +1 -0
- package/dist/internal/profiles/definitions/introspection.d.ts +3 -0
- package/dist/internal/profiles/definitions/introspection.d.ts.map +1 -0
- package/dist/internal/profiles/definitions/introspection.js +18 -0
- package/dist/internal/profiles/definitions/introspection.js.map +1 -0
- package/dist/internal/profiles/definitions/jarm.d.ts +3 -0
- package/dist/internal/profiles/definitions/jarm.d.ts.map +1 -0
- package/dist/internal/profiles/definitions/jarm.js +19 -0
- package/dist/internal/profiles/definitions/jarm.js.map +1 -0
- package/dist/internal/profiles/definitions/logout-token.d.ts +3 -0
- package/dist/internal/profiles/definitions/logout-token.d.ts.map +1 -0
- package/dist/internal/profiles/definitions/logout-token.js +20 -0
- package/dist/internal/profiles/definitions/logout-token.js.map +1 -0
- package/dist/internal/profiles/definitions/security-event.d.ts +3 -0
- package/dist/internal/profiles/definitions/security-event.d.ts.map +1 -0
- package/dist/internal/profiles/definitions/security-event.js +20 -0
- package/dist/internal/profiles/definitions/security-event.js.map +1 -0
- package/dist/internal/profiles/definitions/userinfo.d.ts +3 -0
- package/dist/internal/profiles/definitions/userinfo.d.ts.map +1 -0
- package/dist/internal/profiles/definitions/userinfo.js +18 -0
- package/dist/internal/profiles/definitions/userinfo.js.map +1 -0
- package/dist/internal/profiles/registry.d.ts +4 -0
- package/dist/internal/profiles/registry.d.ts.map +1 -0
- package/dist/internal/profiles/registry.js +41 -0
- package/dist/internal/profiles/registry.js.map +1 -0
- package/dist/internal/utils/assemble-common-claims.d.ts +12 -0
- package/dist/internal/utils/assemble-common-claims.d.ts.map +1 -0
- package/dist/internal/utils/assemble-common-claims.js +66 -0
- package/dist/internal/utils/assemble-common-claims.js.map +1 -0
- package/dist/internal/utils/build-profile-claims.d.ts +14 -0
- package/dist/internal/utils/build-profile-claims.d.ts.map +1 -0
- package/dist/internal/utils/build-profile-claims.js +75 -0
- package/dist/internal/utils/build-profile-claims.js.map +1 -0
- package/dist/internal/utils/compute-jwk-thumbprint.js +8 -1
- package/dist/internal/utils/compute-jwk-thumbprint.js.map +1 -1
- package/dist/internal/utils/compute-typ-header.d.ts.map +1 -1
- package/dist/internal/utils/compute-typ-header.js +20 -5
- package/dist/internal/utils/compute-typ-header.js.map +1 -1
- package/dist/internal/utils/create-hash.d.ts.map +1 -1
- package/dist/internal/utils/create-hash.js +7 -7
- package/dist/internal/utils/create-hash.js.map +1 -1
- package/dist/internal/utils/enforce-verify-floor.d.ts +12 -0
- package/dist/internal/utils/enforce-verify-floor.d.ts.map +1 -0
- package/dist/internal/utils/enforce-verify-floor.js +43 -0
- package/dist/internal/utils/enforce-verify-floor.js.map +1 -0
- package/dist/internal/utils/extract-claims.d.ts +2 -1
- package/dist/internal/utils/extract-claims.d.ts.map +1 -1
- package/dist/internal/utils/extract-claims.js +10 -4
- package/dist/internal/utils/extract-claims.js.map +1 -1
- package/dist/internal/utils/jose-header.d.ts.map +1 -1
- package/dist/internal/utils/jose-header.js +38 -7
- package/dist/internal/utils/jose-header.js.map +1 -1
- package/dist/internal/utils/jwt-payload.d.ts +8 -6
- package/dist/internal/utils/jwt-payload.d.ts.map +1 -1
- package/dist/internal/utils/jwt-payload.js +32 -96
- package/dist/internal/utils/jwt-payload.js.map +1 -1
- package/dist/internal/utils/jwt-validate.d.ts.map +1 -1
- package/dist/internal/utils/jwt-validate.js +7 -1
- package/dist/internal/utils/jwt-validate.js.map +1 -1
- package/dist/internal/utils/jwt-verify.d.ts.map +1 -1
- package/dist/internal/utils/jwt-verify.js +17 -4
- package/dist/internal/utils/jwt-verify.js.map +1 -1
- package/dist/internal/utils/map-content-to-claims.d.ts +8 -0
- package/dist/internal/utils/map-content-to-claims.d.ts.map +1 -0
- package/dist/internal/utils/map-content-to-claims.js +89 -0
- package/dist/internal/utils/map-content-to-claims.js.map +1 -0
- package/dist/internal/utils/parse-introspection.d.ts.map +1 -1
- package/dist/internal/utils/parse-introspection.js +5 -1
- package/dist/internal/utils/parse-introspection.js.map +1 -1
- package/dist/internal/utils/parse-userinfo.d.ts.map +1 -1
- package/dist/internal/utils/parse-userinfo.js +5 -1
- package/dist/internal/utils/parse-userinfo.js.map +1 -1
- package/dist/internal/utils/resolve-cert-binding.d.ts.map +1 -1
- package/dist/internal/utils/resolve-cert-binding.js +3 -0
- package/dist/internal/utils/resolve-cert-binding.js.map +1 -1
- package/dist/internal/utils/rules/act-chain-shape.d.ts +4 -0
- package/dist/internal/utils/rules/act-chain-shape.d.ts.map +1 -0
- package/dist/internal/utils/rules/act-chain-shape.js +52 -0
- package/dist/internal/utils/rules/act-chain-shape.js.map +1 -0
- package/dist/internal/utils/rules/alg-permitted.d.ts +6 -0
- package/dist/internal/utils/rules/alg-permitted.d.ts.map +1 -0
- package/dist/internal/utils/rules/alg-permitted.js +35 -0
- package/dist/internal/utils/rules/alg-permitted.js.map +1 -0
- package/dist/internal/utils/rules/at-least-one-of.d.ts +4 -0
- package/dist/internal/utils/rules/at-least-one-of.d.ts.map +1 -0
- package/dist/internal/utils/rules/at-least-one-of.js +13 -0
- package/dist/internal/utils/rules/at-least-one-of.js.map +1 -0
- package/dist/internal/utils/rules/aud-single-resource.d.ts +4 -0
- package/dist/internal/utils/rules/aud-single-resource.d.ts.map +1 -0
- package/dist/internal/utils/rules/aud-single-resource.js +18 -0
- package/dist/internal/utils/rules/aud-single-resource.js.map +1 -0
- package/dist/internal/utils/rules/cnf-shape.d.ts +4 -0
- package/dist/internal/utils/rules/cnf-shape.d.ts.map +1 -0
- package/dist/internal/utils/rules/cnf-shape.js +55 -0
- package/dist/internal/utils/rules/cnf-shape.js.map +1 -0
- package/dist/internal/utils/rules/cross-field.d.ts +4 -0
- package/dist/internal/utils/rules/cross-field.d.ts.map +1 -0
- package/dist/internal/utils/rules/cross-field.js +21 -0
- package/dist/internal/utils/rules/cross-field.js.map +1 -0
- package/dist/internal/utils/rules/events-shape.d.ts +4 -0
- package/dist/internal/utils/rules/events-shape.d.ts.map +1 -0
- package/dist/internal/utils/rules/events-shape.js +33 -0
- package/dist/internal/utils/rules/events-shape.js.map +1 -0
- package/dist/internal/utils/rules/every-element-has-key.d.ts +4 -0
- package/dist/internal/utils/rules/every-element-has-key.d.ts.map +1 -0
- package/dist/internal/utils/rules/every-element-has-key.js +20 -0
- package/dist/internal/utils/rules/every-element-has-key.js.map +1 -0
- package/dist/internal/utils/rules/forbid-present.d.ts +4 -0
- package/dist/internal/utils/rules/forbid-present.d.ts.map +1 -0
- package/dist/internal/utils/rules/forbid-present.js +10 -0
- package/dist/internal/utils/rules/forbid-present.js.map +1 -0
- package/dist/internal/utils/rules/index.d.ts +14 -0
- package/dist/internal/utils/rules/index.d.ts.map +1 -0
- package/dist/internal/utils/rules/index.js +14 -0
- package/dist/internal/utils/rules/index.js.map +1 -0
- package/dist/internal/utils/rules/iss-uri.d.ts +4 -0
- package/dist/internal/utils/rules/iss-uri.d.ts.map +1 -0
- package/dist/internal/utils/rules/iss-uri.js +11 -0
- package/dist/internal/utils/rules/iss-uri.js.map +1 -0
- package/dist/internal/utils/rules/require-present.d.ts +4 -0
- package/dist/internal/utils/rules/require-present.d.ts.map +1 -0
- package/dist/internal/utils/rules/require-present.js +10 -0
- package/dist/internal/utils/rules/require-present.js.map +1 -0
- package/dist/internal/utils/rules/required-when.d.ts +8 -0
- package/dist/internal/utils/rules/required-when.d.ts.map +1 -0
- package/dist/internal/utils/rules/required-when.js +13 -0
- package/dist/internal/utils/rules/required-when.js.map +1 -0
- package/dist/internal/utils/rules/sub-id-shape.d.ts +4 -0
- package/dist/internal/utils/rules/sub-id-shape.d.ts.map +1 -0
- package/dist/internal/utils/rules/sub-id-shape.js +26 -0
- package/dist/internal/utils/rules/sub-id-shape.js.map +1 -0
- package/dist/internal/utils/select-encoder.d.ts +6 -0
- package/dist/internal/utils/select-encoder.d.ts.map +1 -0
- package/dist/internal/utils/select-encoder.js +4 -0
- package/dist/internal/utils/select-encoder.js.map +1 -0
- package/dist/internal/utils/validate-actor.d.ts +8 -1
- package/dist/internal/utils/validate-actor.d.ts.map +1 -1
- package/dist/internal/utils/validate-actor.js +32 -7
- package/dist/internal/utils/validate-actor.js.map +1 -1
- package/dist/internal/utils/validate-profile-claims.d.ts +8 -0
- package/dist/internal/utils/validate-profile-claims.d.ts.map +1 -0
- package/dist/internal/utils/validate-profile-claims.js +45 -0
- package/dist/internal/utils/validate-profile-claims.js.map +1 -0
- package/dist/internal/utils/validate.d.ts.map +1 -1
- package/dist/internal/utils/validate.js +8 -1
- package/dist/internal/utils/validate.js.map +1 -1
- package/dist/internal/utils/verify-cert-binding.d.ts.map +1 -1
- package/dist/internal/utils/verify-cert-binding.js +9 -1
- package/dist/internal/utils/verify-cert-binding.js.map +1 -1
- package/dist/internal/utils/verify-dpop-proof.d.ts.map +1 -1
- package/dist/internal/utils/verify-dpop-proof.js +41 -7
- package/dist/internal/utils/verify-dpop-proof.js.map +1 -1
- package/dist/types/claims/aegis-introspection.d.ts +2 -1
- package/dist/types/claims/aegis-introspection.d.ts.map +1 -1
- package/dist/types/claims/index.d.ts +2 -0
- package/dist/types/claims/index.d.ts.map +1 -1
- package/dist/types/claims/index.js +2 -0
- package/dist/types/claims/index.js.map +1 -1
- package/dist/types/claims/jwt/index.d.ts +2 -0
- package/dist/types/claims/jwt/index.d.ts.map +1 -1
- package/dist/types/claims/jwt/index.js +2 -0
- package/dist/types/claims/jwt/index.js.map +1 -1
- package/dist/types/claims/jwt/jwt-claims.d.ts +3 -1
- package/dist/types/claims/jwt/jwt-claims.d.ts.map +1 -1
- package/dist/types/claims/jwt/lindorm-claims-wire.d.ts +1 -2
- package/dist/types/claims/jwt/lindorm-claims-wire.d.ts.map +1 -1
- package/dist/types/claims/jwt/oidc-claims-wire.d.ts +2 -0
- package/dist/types/claims/jwt/oidc-claims-wire.d.ts.map +1 -1
- package/dist/types/claims/jwt/rar-claims-wire.d.ts +5 -0
- package/dist/types/claims/jwt/rar-claims-wire.d.ts.map +1 -0
- package/dist/types/claims/jwt/rar-claims-wire.js +2 -0
- package/dist/types/claims/jwt/rar-claims-wire.js.map +1 -0
- package/dist/types/claims/jwt/set-claims-wire.d.ts +9 -0
- package/dist/types/claims/jwt/set-claims-wire.d.ts.map +1 -0
- package/dist/types/claims/jwt/set-claims-wire.js +2 -0
- package/dist/types/claims/jwt/set-claims-wire.js.map +1 -0
- package/dist/types/claims/lindorm-claims.d.ts +1 -2
- package/dist/types/claims/lindorm-claims.d.ts.map +1 -1
- package/dist/types/claims/oidc-claims.d.ts +2 -0
- package/dist/types/claims/oidc-claims.d.ts.map +1 -1
- package/dist/types/claims/rar-claims.d.ts +5 -0
- package/dist/types/claims/rar-claims.d.ts.map +1 -0
- package/dist/types/claims/rar-claims.js +2 -0
- package/dist/types/claims/rar-claims.js.map +1 -0
- package/dist/types/claims/set-claims.d.ts +8 -0
- package/dist/types/claims/set-claims.d.ts.map +1 -0
- package/dist/types/claims/set-claims.js +2 -0
- package/dist/types/claims/set-claims.js.map +1 -0
- package/dist/types/jwt/index.d.ts +1 -0
- package/dist/types/jwt/index.d.ts.map +1 -1
- package/dist/types/jwt/index.js +1 -0
- package/dist/types/jwt/index.js.map +1 -1
- package/dist/types/jwt/jwt-claim-matchers.d.ts +2 -1
- package/dist/types/jwt/jwt-claim-matchers.d.ts.map +1 -1
- package/dist/types/jwt/jwt-parse.d.ts +2 -2
- package/dist/types/jwt/jwt-parse.d.ts.map +1 -1
- package/dist/types/jwt/jwt-sign.d.ts +8 -6
- package/dist/types/jwt/jwt-sign.d.ts.map +1 -1
- package/dist/types/jwt/jwt-verify.d.ts +5 -1
- package/dist/types/jwt/jwt-verify.d.ts.map +1 -1
- package/dist/types/jwt/profile.d.ts +99 -0
- package/dist/types/jwt/profile.d.ts.map +1 -0
- package/dist/types/jwt/profile.js +2 -0
- package/dist/types/jwt/profile.js.map +1 -0
- package/dist/types/level-of-assurance.d.ts +0 -1
- package/dist/types/level-of-assurance.d.ts.map +1 -1
- package/package.json +19 -18
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export const idTokenProfile = {
|
|
2
|
+
name: "id_token",
|
|
3
|
+
typ: "JWT",
|
|
4
|
+
required: ["issuer", "subject", "audience", "expiresAt", "issuedAt"],
|
|
5
|
+
forbidden: [],
|
|
6
|
+
requiredWhen: [
|
|
7
|
+
{
|
|
8
|
+
claim: "accessTokenHash",
|
|
9
|
+
when: (claims, ctx) => ctx.accessTokenIssued === true || claims.accessTokenHash !== undefined,
|
|
10
|
+
},
|
|
11
|
+
],
|
|
12
|
+
atLeastOneOf: [],
|
|
13
|
+
autoInject: { iat: true, jti: false, nbf: false, iss: true },
|
|
14
|
+
issuer: "platform",
|
|
15
|
+
lifetime: "1h",
|
|
16
|
+
encryptable: true,
|
|
17
|
+
algClass: "confidential",
|
|
18
|
+
rules: {
|
|
19
|
+
issUri: true,
|
|
20
|
+
crossField: true,
|
|
21
|
+
cnfShape: true,
|
|
22
|
+
actChainShape: true,
|
|
23
|
+
},
|
|
24
|
+
validate: () => [],
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=id-token.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"id-token.js","sourceRoot":"","sources":["../../../../src/internal/profiles/definitions/id-token.ts"],"names":[],"mappings":"AAUA,MAAM,CAAC,MAAM,cAAc,GAAiB;IAC1C,IAAI,EAAE,UAAU;IAChB,GAAG,EAAE,KAAK;IACV,QAAQ,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,CAAC;IACpE,SAAS,EAAE,EAAE;IACb,YAAY,EAAE;QACZ;YACE,KAAK,EAAE,iBAAiB;YACxB,IAAI,EAAE,CAAC,MAAY,EAAE,GAAgB,EAAE,EAAE,CACvC,GAAG,CAAC,iBAAiB,KAAK,IAAI,IAAI,MAAM,CAAC,eAAe,KAAK,SAAS;SACzE;KACF;IACD,YAAY,EAAE,EAAE;IAChB,UAAU,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE;IAC5D,MAAM,EAAE,UAAU;IAClB,QAAQ,EAAE,IAAI;IACd,WAAW,EAAE,IAAI;IACjB,QAAQ,EAAE,cAAc;IACxB,KAAK,EAAE;QACL,MAAM,EAAE,IAAI;QACZ,UAAU,EAAE,IAAI;QAChB,QAAQ,EAAE,IAAI;QACd,aAAa,EAAE,IAAI;KACpB;IACD,QAAQ,EAAE,GAAG,EAAE,CAAC,EAAE;CACnB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"introspection.d.ts","sourceRoot":"","sources":["../../../../src/internal/profiles/definitions/introspection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAO5D,eAAO,MAAM,oBAAoB,EAAE,YAgBlC,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export const introspectionProfile = {
|
|
2
|
+
name: "introspection",
|
|
3
|
+
typ: "application/token-introspection+jwt",
|
|
4
|
+
required: ["issuer", "audience", "issuedAt", "token_introspection"],
|
|
5
|
+
forbidden: [],
|
|
6
|
+
requiredWhen: [],
|
|
7
|
+
atLeastOneOf: [],
|
|
8
|
+
autoInject: { iat: true, jti: false, nbf: false, iss: true },
|
|
9
|
+
issuer: "platform",
|
|
10
|
+
lifetime: null,
|
|
11
|
+
encryptable: true,
|
|
12
|
+
algClass: "confidential",
|
|
13
|
+
rules: {
|
|
14
|
+
issUri: true,
|
|
15
|
+
},
|
|
16
|
+
validate: () => [],
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=introspection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"introspection.js","sourceRoot":"","sources":["../../../../src/internal/profiles/definitions/introspection.ts"],"names":[],"mappings":"AAOA,MAAM,CAAC,MAAM,oBAAoB,GAAiB;IAChD,IAAI,EAAE,eAAe;IACrB,GAAG,EAAE,qCAAqC;IAC1C,QAAQ,EAAE,CAAC,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,qBAAqB,CAAC;IACnE,SAAS,EAAE,EAAE;IACb,YAAY,EAAE,EAAE;IAChB,YAAY,EAAE,EAAE;IAChB,UAAU,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE;IAC5D,MAAM,EAAE,UAAU;IAClB,QAAQ,EAAE,IAAI;IACd,WAAW,EAAE,IAAI;IACjB,QAAQ,EAAE,cAAc;IACxB,KAAK,EAAE;QACL,MAAM,EAAE,IAAI;KACb;IACD,QAAQ,EAAE,GAAG,EAAE,CAAC,EAAE;CACnB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jarm.d.ts","sourceRoot":"","sources":["../../../../src/internal/profiles/definitions/jarm.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAQ5D,eAAO,MAAM,WAAW,EAAE,YAiBzB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export const jarmProfile = {
|
|
2
|
+
name: "jarm",
|
|
3
|
+
typ: null,
|
|
4
|
+
required: ["issuer", "audience", "expiresAt"],
|
|
5
|
+
forbidden: [],
|
|
6
|
+
requiredWhen: [],
|
|
7
|
+
atLeastOneOf: [],
|
|
8
|
+
autoInject: { iat: true, jti: false, nbf: false, iss: true },
|
|
9
|
+
issuer: "platform",
|
|
10
|
+
lifetime: "10m",
|
|
11
|
+
encryptable: true,
|
|
12
|
+
algClass: "confidential",
|
|
13
|
+
rules: {
|
|
14
|
+
issUri: true,
|
|
15
|
+
crossField: true,
|
|
16
|
+
},
|
|
17
|
+
validate: () => [],
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=jarm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jarm.js","sourceRoot":"","sources":["../../../../src/internal/profiles/definitions/jarm.ts"],"names":[],"mappings":"AAQA,MAAM,CAAC,MAAM,WAAW,GAAiB;IACvC,IAAI,EAAE,MAAM;IACZ,GAAG,EAAE,IAAI;IACT,QAAQ,EAAE,CAAC,QAAQ,EAAE,UAAU,EAAE,WAAW,CAAC;IAC7C,SAAS,EAAE,EAAE;IACb,YAAY,EAAE,EAAE;IAChB,YAAY,EAAE,EAAE;IAChB,UAAU,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE;IAC5D,MAAM,EAAE,UAAU;IAClB,QAAQ,EAAE,KAAK;IACf,WAAW,EAAE,IAAI;IACjB,QAAQ,EAAE,cAAc;IACxB,KAAK,EAAE;QACL,MAAM,EAAE,IAAI;QACZ,UAAU,EAAE,IAAI;KACjB;IACD,QAAQ,EAAE,GAAG,EAAE,CAAC,EAAE;CACnB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logout-token.d.ts","sourceRoot":"","sources":["../../../../src/internal/profiles/definitions/logout-token.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAU5D,eAAO,MAAM,kBAAkB,EAAE,YAkBhC,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export const logoutTokenProfile = {
|
|
2
|
+
name: "logout_token",
|
|
3
|
+
typ: "application/logout+jwt",
|
|
4
|
+
required: ["issuer", "audience", "issuedAt", "expiresAt", "tokenId", "events"],
|
|
5
|
+
forbidden: ["nonce"],
|
|
6
|
+
requiredWhen: [],
|
|
7
|
+
atLeastOneOf: [["subject", "sessionId"]],
|
|
8
|
+
autoInject: { iat: true, jti: true, nbf: false, iss: true },
|
|
9
|
+
issuer: "platform",
|
|
10
|
+
lifetime: "2m",
|
|
11
|
+
encryptable: false,
|
|
12
|
+
algClass: "confidential",
|
|
13
|
+
rules: {
|
|
14
|
+
issUri: true,
|
|
15
|
+
crossField: true,
|
|
16
|
+
eventsShape: true,
|
|
17
|
+
},
|
|
18
|
+
validate: () => [],
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=logout-token.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logout-token.js","sourceRoot":"","sources":["../../../../src/internal/profiles/definitions/logout-token.ts"],"names":[],"mappings":"AAUA,MAAM,CAAC,MAAM,kBAAkB,GAAiB;IAC9C,IAAI,EAAE,cAAc;IACpB,GAAG,EAAE,wBAAwB;IAC7B,QAAQ,EAAE,CAAC,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,CAAC;IAC9E,SAAS,EAAE,CAAC,OAAO,CAAC;IACpB,YAAY,EAAE,EAAE;IAChB,YAAY,EAAE,CAAC,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;IACxC,UAAU,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE;IAC3D,MAAM,EAAE,UAAU;IAClB,QAAQ,EAAE,IAAI;IACd,WAAW,EAAE,KAAK;IAClB,QAAQ,EAAE,cAAc;IACxB,KAAK,EAAE;QACL,MAAM,EAAE,IAAI;QACZ,UAAU,EAAE,IAAI;QAChB,WAAW,EAAE,IAAI;KAClB;IACD,QAAQ,EAAE,GAAG,EAAE,CAAC,EAAE;CACnB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"security-event.d.ts","sourceRoot":"","sources":["../../../../src/internal/profiles/definitions/security-event.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAW5D,eAAO,MAAM,oBAAoB,EAAE,YAkBlC,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export const securityEventProfile = {
|
|
2
|
+
name: "security_event",
|
|
3
|
+
typ: "application/secevent+jwt",
|
|
4
|
+
required: ["issuer", "audience", "issuedAt", "tokenId", "subjectId", "events"],
|
|
5
|
+
forbidden: ["subject", "expiresAt", "nonce"],
|
|
6
|
+
requiredWhen: [],
|
|
7
|
+
atLeastOneOf: [],
|
|
8
|
+
autoInject: { iat: true, jti: true, nbf: false, iss: true },
|
|
9
|
+
issuer: "platform",
|
|
10
|
+
lifetime: null,
|
|
11
|
+
encryptable: false,
|
|
12
|
+
algClass: "confidential",
|
|
13
|
+
rules: {
|
|
14
|
+
issUri: true,
|
|
15
|
+
subIdShape: true,
|
|
16
|
+
eventsShape: true,
|
|
17
|
+
},
|
|
18
|
+
validate: () => [],
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=security-event.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"security-event.js","sourceRoot":"","sources":["../../../../src/internal/profiles/definitions/security-event.ts"],"names":[],"mappings":"AAWA,MAAM,CAAC,MAAM,oBAAoB,GAAiB;IAChD,IAAI,EAAE,gBAAgB;IACtB,GAAG,EAAE,0BAA0B;IAC/B,QAAQ,EAAE,CAAC,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,QAAQ,CAAC;IAC9E,SAAS,EAAE,CAAC,SAAS,EAAE,WAAW,EAAE,OAAO,CAAC;IAC5C,YAAY,EAAE,EAAE;IAChB,YAAY,EAAE,EAAE;IAChB,UAAU,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE;IAC3D,MAAM,EAAE,UAAU;IAClB,QAAQ,EAAE,IAAI;IACd,WAAW,EAAE,KAAK;IAClB,QAAQ,EAAE,cAAc;IACxB,KAAK,EAAE;QACL,MAAM,EAAE,IAAI;QACZ,UAAU,EAAE,IAAI;QAChB,WAAW,EAAE,IAAI;KAClB;IACD,QAAQ,EAAE,GAAG,EAAE,CAAC,EAAE;CACnB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"userinfo.d.ts","sourceRoot":"","sources":["../../../../src/internal/profiles/definitions/userinfo.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAO5D,eAAO,MAAM,eAAe,EAAE,YAgB7B,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export const userinfoProfile = {
|
|
2
|
+
name: "userinfo",
|
|
3
|
+
typ: null,
|
|
4
|
+
required: ["issuer", "subject", "audience"],
|
|
5
|
+
forbidden: [],
|
|
6
|
+
requiredWhen: [],
|
|
7
|
+
atLeastOneOf: [],
|
|
8
|
+
autoInject: { iat: false, jti: false, nbf: false, iss: true },
|
|
9
|
+
issuer: "platform",
|
|
10
|
+
lifetime: null,
|
|
11
|
+
encryptable: true,
|
|
12
|
+
algClass: "confidential",
|
|
13
|
+
rules: {
|
|
14
|
+
issUri: true,
|
|
15
|
+
},
|
|
16
|
+
validate: () => [],
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=userinfo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"userinfo.js","sourceRoot":"","sources":["../../../../src/internal/profiles/definitions/userinfo.ts"],"names":[],"mappings":"AAOA,MAAM,CAAC,MAAM,eAAe,GAAiB;IAC3C,IAAI,EAAE,UAAU;IAChB,GAAG,EAAE,IAAI;IACT,QAAQ,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,UAAU,CAAC;IAC3C,SAAS,EAAE,EAAE;IACb,YAAY,EAAE,EAAE;IAChB,YAAY,EAAE,EAAE;IAChB,UAAU,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE;IAC7D,MAAM,EAAE,UAAU;IAClB,QAAQ,EAAE,IAAI;IACd,WAAW,EAAE,IAAI;IACjB,QAAQ,EAAE,cAAc;IACxB,KAAK,EAAE;QACL,MAAM,EAAE,IAAI;KACb;IACD,QAAQ,EAAE,GAAG,EAAE,CAAC,EAAE;CACnB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../src/internal/profiles/registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAqBzD,eAAO,MAAM,eAAe,GAAI,SAAS,YAAY,KAAG,IAEvD,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,MAAM,MAAM,KAAG,YAe7C,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { JwtError } from "../../errors/index.js";
|
|
2
|
+
import { accessTokenProfile } from "./definitions/access-token.js";
|
|
3
|
+
import { clientAssertionProfile } from "./definitions/client-assertion.js";
|
|
4
|
+
import { defaultProfile } from "./definitions/default.js";
|
|
5
|
+
import { delegationProfile } from "./definitions/delegation.js";
|
|
6
|
+
import { erasureTokenProfile } from "./definitions/erasure-token.js";
|
|
7
|
+
import { idTokenProfile } from "./definitions/id-token.js";
|
|
8
|
+
import { introspectionProfile } from "./definitions/introspection.js";
|
|
9
|
+
import { jarmProfile } from "./definitions/jarm.js";
|
|
10
|
+
import { logoutTokenProfile } from "./definitions/logout-token.js";
|
|
11
|
+
import { securityEventProfile } from "./definitions/security-event.js";
|
|
12
|
+
import { userinfoProfile } from "./definitions/userinfo.js";
|
|
13
|
+
const registry = new Map();
|
|
14
|
+
export const registerProfile = (profile) => {
|
|
15
|
+
registry.set(profile.name, profile);
|
|
16
|
+
};
|
|
17
|
+
export const resolveProfile = (name) => {
|
|
18
|
+
const profile = registry.get(name);
|
|
19
|
+
if (!profile) {
|
|
20
|
+
throw new JwtError(`Unknown token profile: ${name}`, {
|
|
21
|
+
code: "jwt_unknown_profile",
|
|
22
|
+
data: { name },
|
|
23
|
+
debug: { available: [...registry.keys()] },
|
|
24
|
+
title: "JWT Unknown Profile",
|
|
25
|
+
details: "No token profile is registered under that name. Register a custom profile with registerProfile() or use a built-in.",
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
return profile;
|
|
29
|
+
};
|
|
30
|
+
registerProfile(accessTokenProfile);
|
|
31
|
+
registerProfile(clientAssertionProfile);
|
|
32
|
+
registerProfile(defaultProfile);
|
|
33
|
+
registerProfile(delegationProfile);
|
|
34
|
+
registerProfile(erasureTokenProfile);
|
|
35
|
+
registerProfile(idTokenProfile);
|
|
36
|
+
registerProfile(introspectionProfile);
|
|
37
|
+
registerProfile(jarmProfile);
|
|
38
|
+
registerProfile(logoutTokenProfile);
|
|
39
|
+
registerProfile(securityEventProfile);
|
|
40
|
+
registerProfile(userinfoProfile);
|
|
41
|
+
//# sourceMappingURL=registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../src/internal/profiles/registry.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAC3E,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAO5D,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAwB,CAAC;AAEjD,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,OAAqB,EAAQ,EAAE;IAC7D,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AACtC,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,IAAY,EAAgB,EAAE;IAC3D,MAAM,OAAO,GAAG,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAEnC,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,QAAQ,CAAC,0BAA0B,IAAI,EAAE,EAAE;YACnD,IAAI,EAAE,qBAAqB;YAC3B,IAAI,EAAE,EAAE,IAAI,EAAE;YACd,KAAK,EAAE,EAAE,SAAS,EAAE,CAAC,GAAG,QAAQ,CAAC,IAAI,EAAE,CAAC,EAAE;YAC1C,KAAK,EAAE,qBAAqB;YAC5B,OAAO,EACL,qHAAqH;SACxH,CAAC,CAAC;IACL,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAEF,eAAe,CAAC,kBAAkB,CAAC,CAAC;AACpC,eAAe,CAAC,sBAAsB,CAAC,CAAC;AACxC,eAAe,CAAC,cAAc,CAAC,CAAC;AAChC,eAAe,CAAC,iBAAiB,CAAC,CAAC;AACnC,eAAe,CAAC,mBAAmB,CAAC,CAAC;AACrC,eAAe,CAAC,cAAc,CAAC,CAAC;AAChC,eAAe,CAAC,oBAAoB,CAAC,CAAC;AACtC,eAAe,CAAC,WAAW,CAAC,CAAC;AAC7B,eAAe,CAAC,kBAAkB,CAAC,CAAC;AACpC,eAAe,CAAC,oBAAoB,CAAC,CAAC;AACtC,eAAe,CAAC,eAAe,CAAC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { KryptosAlgorithm } from "@lindorm/kryptos";
|
|
2
|
+
import type { Dict } from "@lindorm/types";
|
|
3
|
+
import type { ProfileSignOptions, SignContent, TokenProfile } from "../../types/index.js";
|
|
4
|
+
export type AssembleCommonContext = {
|
|
5
|
+
algorithm: KryptosAlgorithm;
|
|
6
|
+
issuer: string | null;
|
|
7
|
+
now?: Date;
|
|
8
|
+
};
|
|
9
|
+
export declare const assembleCommonClaims: (ctx: AssembleCommonContext, profile: TokenProfile, content: SignContent & {
|
|
10
|
+
claims?: Dict;
|
|
11
|
+
}, options?: ProfileSignOptions) => Dict;
|
|
12
|
+
//# sourceMappingURL=assemble-common-claims.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assemble-common-claims.d.ts","sourceRoot":"","sources":["../../../src/internal/utils/assemble-common-claims.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAG3C,OAAO,KAAK,EAAE,kBAAkB,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAW1F,MAAM,MAAM,qBAAqB,GAAG;IAClC,SAAS,EAAE,gBAAgB,CAAC;IAC5B,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,GAAG,CAAC,EAAE,IAAI,CAAC;CACZ,CAAC;AAeF,eAAO,MAAM,oBAAoB,GAC/B,KAAK,qBAAqB,EAC1B,SAAS,YAAY,EACrB,SAAS,WAAW,GAAG;IAAE,MAAM,CAAC,EAAE,IAAI,CAAA;CAAE,EACxC,UAAS,kBAAuB,KAC/B,IAyEF,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { expires } from "@lindorm/date";
|
|
2
|
+
import { isDate, isString } from "@lindorm/is";
|
|
3
|
+
import { removeUndefined } from "@lindorm/utils";
|
|
4
|
+
import { CLAIM_REGISTRY } from "../claims/registry.js";
|
|
5
|
+
import { enforceProfilePolicy } from "./build-profile-claims.js";
|
|
6
|
+
import { createAccessTokenHash, createCodeHash, createStateHash } from "./create-hash.js";
|
|
7
|
+
import { generateTokenId } from "./generate-token-id.js";
|
|
8
|
+
export const assembleCommonClaims = (ctx, profile, content, options = {}) => {
|
|
9
|
+
const now = ctx.now ?? new Date();
|
|
10
|
+
const optIssuedAt = isDate(options.issuedAt) ? options.issuedAt : undefined;
|
|
11
|
+
const issuedAt = profile.autoInject.iat ? (optIssuedAt ?? now) : optIssuedAt;
|
|
12
|
+
const contentNotBefore = isDate(content.notBefore) ? content.notBefore : undefined;
|
|
13
|
+
const notBefore = profile.autoInject.nbf ? (contentNotBefore ?? now) : contentNotBefore;
|
|
14
|
+
const optTokenId = isString(options.tokenId) ? options.tokenId : undefined;
|
|
15
|
+
const tokenId = profile.autoInject.jti ? (optTokenId ?? generateTokenId()) : optTokenId;
|
|
16
|
+
const expiresAt = content.expires
|
|
17
|
+
? expires(content.expires).expiresAt
|
|
18
|
+
: profile.lifetime != null
|
|
19
|
+
? expires(profile.lifetime, now).expiresAt
|
|
20
|
+
: undefined;
|
|
21
|
+
const issuer = resolveIssuer(ctx, profile, content);
|
|
22
|
+
const accessTokenHash = isString(options.accessTokenHash)
|
|
23
|
+
? options.accessTokenHash
|
|
24
|
+
: isString(content.accessToken)
|
|
25
|
+
? createAccessTokenHash(ctx.algorithm, content.accessToken)
|
|
26
|
+
: undefined;
|
|
27
|
+
const codeHash = isString(options.codeHash)
|
|
28
|
+
? options.codeHash
|
|
29
|
+
: isString(content.authCode)
|
|
30
|
+
? createCodeHash(ctx.algorithm, content.authCode)
|
|
31
|
+
: undefined;
|
|
32
|
+
const stateHash = isString(options.stateHash)
|
|
33
|
+
? options.stateHash
|
|
34
|
+
: isString(content.authState)
|
|
35
|
+
? createStateHash(ctx.algorithm, content.authState)
|
|
36
|
+
: undefined;
|
|
37
|
+
const picked = {};
|
|
38
|
+
for (const spec of CLAIM_REGISTRY) {
|
|
39
|
+
const value = content[spec.domain];
|
|
40
|
+
if (value !== undefined)
|
|
41
|
+
picked[spec.domain] = value;
|
|
42
|
+
}
|
|
43
|
+
const common = removeUndefined({
|
|
44
|
+
...picked,
|
|
45
|
+
issuedAt,
|
|
46
|
+
notBefore,
|
|
47
|
+
tokenId,
|
|
48
|
+
expiresAt,
|
|
49
|
+
issuer,
|
|
50
|
+
accessTokenHash,
|
|
51
|
+
codeHash,
|
|
52
|
+
stateHash,
|
|
53
|
+
...(content.claims ?? {}),
|
|
54
|
+
});
|
|
55
|
+
enforceProfilePolicy(profile, common, options.context ?? {});
|
|
56
|
+
return common;
|
|
57
|
+
};
|
|
58
|
+
const resolveIssuer = (ctx, profile, content) => {
|
|
59
|
+
const contentIssuer = isString(content.issuer) ? content.issuer : undefined;
|
|
60
|
+
if (profile.issuer === "per-token")
|
|
61
|
+
return contentIssuer;
|
|
62
|
+
if (!profile.autoInject.iss)
|
|
63
|
+
return contentIssuer;
|
|
64
|
+
return ctx.issuer ?? contentIssuer;
|
|
65
|
+
};
|
|
66
|
+
//# sourceMappingURL=assemble-common-claims.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assemble-common-claims.js","sourceRoot":"","sources":["../../../src/internal/utils/assemble-common-claims.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAG/C,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,qBAAqB,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAC1F,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AA2BzD,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAClC,GAA0B,EAC1B,OAAqB,EACrB,OAAwC,EACxC,UAA8B,EAAE,EAC1B,EAAE;IACR,MAAM,GAAG,GAAG,GAAG,CAAC,GAAG,IAAI,IAAI,IAAI,EAAE,CAAC;IAKlC,MAAM,WAAW,GAAG,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,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AC1B,OAAqB,EACrB,OAAoB,EACA,EAAE;IACtB,MAAM,aAAa,GAAG,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;IAE5E,IAAI,OAAO,CAAC,MAAM,KAAK,WAAW;QAAE,OAAO,aAAa,CAAC;IACzD,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG;QAAE,OAAO,aAAa,CAAC;IAElD,OAAO,GAAG,CAAC,MAAM,IAAI,aAAa,CAAC;AACrC,CAAC,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { KryptosAlgorithm } from "@lindorm/kryptos";
|
|
2
|
+
import type { Dict } from "@lindorm/types";
|
|
3
|
+
import type { ProfileSignOptions, SignContent, SignContext, TokenProfile } from "../../types/index.js";
|
|
4
|
+
export type BuildProfileContext = {
|
|
5
|
+
algorithm: KryptosAlgorithm;
|
|
6
|
+
issuer: string | null;
|
|
7
|
+
now?: Date;
|
|
8
|
+
};
|
|
9
|
+
declare const enforcePolicy: (profile: TokenProfile, claims: Dict, ctx: SignContext) => void;
|
|
10
|
+
export declare const buildProfileClaims: <C extends Dict = Dict>(ctx: BuildProfileContext, profile: TokenProfile, content: SignContent & {
|
|
11
|
+
claims?: C;
|
|
12
|
+
}, options?: ProfileSignOptions) => Dict;
|
|
13
|
+
export { enforcePolicy as enforceProfilePolicy };
|
|
14
|
+
//# sourceMappingURL=build-profile-claims.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-profile-claims.d.ts","sourceRoot":"","sources":["../../../src/internal/utils/build-profile-claims.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAG3C,OAAO,KAAK,EAEV,kBAAkB,EAClB,WAAW,EACX,WAAW,EACX,YAAY,EACb,MAAM,sBAAsB,CAAC;AAU9B,MAAM,MAAM,mBAAmB,GAAG;IAChC,SAAS,EAAE,gBAAgB,CAAC;IAC5B,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,GAAG,CAAC,EAAE,IAAI,CAAC;CACZ,CAAC;AAEF,QAAA,MAAM,aAAa,GAAI,SAAS,YAAY,EAAE,QAAQ,IAAI,EAAE,KAAK,WAAW,KAAG,IA2C9E,CAAC;AAcF,eAAO,MAAM,kBAAkB,GAAI,CAAC,SAAS,IAAI,GAAG,IAAI,EACtD,KAAK,mBAAmB,EACxB,SAAS,YAAY,EACrB,SAAS,WAAW,GAAG;IAAE,MAAM,CAAC,EAAE,CAAC,CAAA;CAAE,EACrC,UAAS,kBAAuB,KAC/B,IAuCF,CAAC;AAqBF,OAAO,EAAE,aAAa,IAAI,oBAAoB,EAAE,CAAC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { expires, getUnixTime } from "@lindorm/date";
|
|
2
|
+
import { removeUndefined } from "@lindorm/utils";
|
|
3
|
+
import { JwtError } from "../../errors/index.js";
|
|
4
|
+
import { generateTokenId } from "./generate-token-id.js";
|
|
5
|
+
import { mapContentToClaims } from "./map-content-to-claims.js";
|
|
6
|
+
const enforcePolicy = (profile, claims, ctx) => {
|
|
7
|
+
const invalid = [];
|
|
8
|
+
for (const key of profile.required) {
|
|
9
|
+
if (claims[key] === undefined) {
|
|
10
|
+
invalid.push({ key, message: `Required claim "${key}" is missing` });
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
for (const key of profile.forbidden) {
|
|
14
|
+
if (claims[key] !== undefined) {
|
|
15
|
+
invalid.push({ key, message: `Forbidden claim "${key}" is present` });
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
for (const group of profile.atLeastOneOf) {
|
|
19
|
+
if (!group.some((key) => claims[key] !== undefined)) {
|
|
20
|
+
invalid.push({
|
|
21
|
+
key: group.join("|"),
|
|
22
|
+
message: `At least one of [${group.join(", ")}] is required`,
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
for (const { claim, when } of profile.requiredWhen) {
|
|
27
|
+
if (claims[claim] === undefined && when(claims, ctx)) {
|
|
28
|
+
invalid.push({
|
|
29
|
+
key: claim,
|
|
30
|
+
message: `Conditionally required claim "${claim}" is missing`,
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
if (invalid.length > 0) {
|
|
35
|
+
throw new JwtError("Invalid token", {
|
|
36
|
+
code: "jwt_claims_invalid",
|
|
37
|
+
data: { invalid },
|
|
38
|
+
debug: { invalid, profile: profile.name },
|
|
39
|
+
title: "JWT Claims Invalid",
|
|
40
|
+
details: "The assembled claims do not satisfy the profile's required/forbidden/conditional rules.",
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
export const buildProfileClaims = (ctx, profile, content, options = {}) => {
|
|
45
|
+
const now = ctx.now ?? new Date();
|
|
46
|
+
const nowUnix = getUnixTime(now);
|
|
47
|
+
const mapped = mapContentToClaims({ algorithm: ctx.algorithm }, content, options);
|
|
48
|
+
const iat = profile.autoInject.iat ? (mapped.iat ?? nowUnix) : mapped.iat;
|
|
49
|
+
const nbf = profile.autoInject.nbf ? (mapped.nbf ?? nowUnix) : mapped.nbf;
|
|
50
|
+
const jti = profile.autoInject.jti ? (mapped.jti ?? generateTokenId()) : mapped.jti;
|
|
51
|
+
const exp = mapped.exp ??
|
|
52
|
+
(profile.lifetime != null ? expires(profile.lifetime, now).expiresOn : undefined);
|
|
53
|
+
const iss = resolveIssuer(ctx, profile, mapped);
|
|
54
|
+
const claims = removeUndefined({
|
|
55
|
+
...mapped,
|
|
56
|
+
...(content.claims ?? {}),
|
|
57
|
+
iat,
|
|
58
|
+
nbf,
|
|
59
|
+
jti,
|
|
60
|
+
exp,
|
|
61
|
+
iss,
|
|
62
|
+
});
|
|
63
|
+
return claims;
|
|
64
|
+
};
|
|
65
|
+
const resolveIssuer = (ctx, profile, mapped) => {
|
|
66
|
+
if (profile.issuer === "per-token") {
|
|
67
|
+
return mapped.iss;
|
|
68
|
+
}
|
|
69
|
+
if (!profile.autoInject.iss) {
|
|
70
|
+
return mapped.iss;
|
|
71
|
+
}
|
|
72
|
+
return ctx.issuer ?? mapped.iss;
|
|
73
|
+
};
|
|
74
|
+
export { enforcePolicy as enforceProfilePolicy };
|
|
75
|
+
//# sourceMappingURL=build-profile-claims.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-profile-claims.js","sourceRoot":"","sources":["../../../src/internal/utils/build-profile-claims.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAGrD,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAQjD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAchE,MAAM,aAAa,GAAG,CAAC,OAAqB,EAAE,MAAY,EAAE,GAAgB,EAAQ,EAAE;IACpF,MAAM,OAAO,GAAwB,EAAE,CAAC;IAExC,KAAK,MAAM,GAAG,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;QACnC,IAAI,MAAM,CAAC,GAAG,CAAC,KAAK,SAAS,EAAE,CAAC;YAC9B,OAAO,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,mBAAmB,GAAG,cAAc,EAAE,CAAC,CAAC;QACvE,CAAC;IACH,CAAC;IAED,KAAK,MAAM,GAAG,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC;QACpC,IAAI,MAAM,CAAC,GAAG,CAAC,KAAK,SAAS,EAAE,CAAC;YAC9B,OAAO,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,oB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ACxB,OAAqB,EACrB,MAAY,EACQ,EAAE;IAItB,IAAI,OAAO,CAAC,MAAM,KAAK,WAAW,EAAE,CAAC;QACnC,OAAO,MAAM,CAAC,GAAyB,CAAC;IAC1C,CAAC;IAED,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,EAAE,CAAC;QAC5B,OAAO,MAAM,CAAC,GAAyB,CAAC;IAC1C,CAAC;IAED,OAAO,GAAG,CAAC,MAAM,IAAK,MAAM,CAAC,GAA0B,CAAC;AAC1D,CAAC,CAAC;AAEF,OAAO,EAAE,aAAa,IAAI,oBAAoB,EAAE,CAAC"}
|
|
@@ -6,6 +6,8 @@ export const computeJwkThumbprint = (jwk) => {
|
|
|
6
6
|
};
|
|
7
7
|
const computeCanonicalJwk = (jwk) => {
|
|
8
8
|
switch (jwk.kty) {
|
|
9
|
+
case "AKP":
|
|
10
|
+
return { alg: jwk.alg, kty: jwk.kty, pub: jwk.pub };
|
|
9
11
|
case "EC":
|
|
10
12
|
return { crv: jwk.crv, kty: jwk.kty, x: jwk.x, y: jwk.y };
|
|
11
13
|
case "RSA":
|
|
@@ -15,7 +17,12 @@ const computeCanonicalJwk = (jwk) => {
|
|
|
15
17
|
case "oct":
|
|
16
18
|
return { k: jwk.k, kty: jwk.kty };
|
|
17
19
|
default:
|
|
18
|
-
throw new JwtError(`Cannot compute JWK thumbprint: unsupported kty "${String(jwk.kty)}"
|
|
20
|
+
throw new JwtError(`Cannot compute JWK thumbprint: unsupported kty "${String(jwk.kty)}"`, {
|
|
21
|
+
code: "jwt_jwk_unsupported_kty",
|
|
22
|
+
data: { kty: jwk.kty },
|
|
23
|
+
title: "JWT JWK Unsupported Kty",
|
|
24
|
+
details: "A JWK thumbprint can only be computed for kty EC, RSA, OKP, or oct keys; this kty is not one of them.",
|
|
25
|
+
});
|
|
19
26
|
}
|
|
20
27
|
};
|
|
21
28
|
//# sourceMappingURL=compute-jwk-thumbprint.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
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AAE,CAAC;QAEpC;YACE,MAAM,IAAI,QAAQ,CAChB,mDAAmD,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,EACrE;gBACE,IAAI,EAAE,yBAAyB;gBAC/B,IAAI,EAAE,EAAE,GAAG,EAAE,GAAG,CAAC,GAAG,EAAE;gBACtB,KAAK,EAAE,yBAAyB;gBAChC,OAAO,EACL,uGAAuG;aAC1G,CACF,CAAC;IACN,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compute-typ-header.d.ts","sourceRoot":"","sources":["../../../src/internal/utils/compute-typ-header.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,KAAK,SAAS,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"compute-typ-header.d.ts","sourceRoot":"","sources":["../../../src/internal/utils/compute-typ-header.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,KAAK,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAEzF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE7D,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC;AAc9C,eAAO,MAAM,gBAAgB,GAC3B,WAAW,SAAS,GAAG,SAAS,EAChC,WAAW,SAAS,KACnB,MA4CF,CAAC;AAOF,eAAO,MAAM,sBAAsB,GACjC,KAAK,MAAM,GAAG,SAAS,EACvB,WAAW,SAAS,KACnB,MAAM,GAAG,SAiBX,CAAC;AAQF,eAAO,MAAM,aAAa,GAAI,KAAK,MAAM,GAAG,SAAS,KAAG,eAAe,GAAG,SAczE,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { TOKEN_TYPE_TO_SHORT_NAME } from "../../constants/token-type.js";
|
|
2
|
+
import { AegisError } from "../../errors/index.js";
|
|
2
3
|
const FORMAT_FALLBACK = {
|
|
3
4
|
jwt: "JWT",
|
|
4
5
|
jws: "JWS",
|
|
@@ -13,18 +14,32 @@ export const computeTypHeader = (tokenType, kitFormat) => {
|
|
|
13
14
|
if (tokenType === undefined)
|
|
14
15
|
return FORMAT_FALLBACK[kitFormat];
|
|
15
16
|
if (tokenType === "") {
|
|
16
|
-
throw new
|
|
17
|
+
throw new AegisError("tokenType cannot be an empty string", {
|
|
18
|
+
code: "invalid_token_type_value",
|
|
19
|
+
title: "Invalid Token Type Value",
|
|
20
|
+
details: "tokenType was an empty string; pass a non-empty bare type such as access_token, or omit it to use the default typ.",
|
|
21
|
+
});
|
|
17
22
|
}
|
|
18
23
|
if (tokenType.trim() !== tokenType || /\s/.test(tokenType)) {
|
|
19
|
-
throw new
|
|
24
|
+
throw new AegisError("tokenType cannot contain whitespace", {
|
|
25
|
+
code: "invalid_token_type_value",
|
|
26
|
+
data: { tokenType },
|
|
27
|
+
title: "Invalid Token Type Value",
|
|
28
|
+
details: "tokenType contains whitespace; pass a single bare type token with no leading, trailing, or interior spaces.",
|
|
29
|
+
});
|
|
20
30
|
}
|
|
21
31
|
if (tokenType.includes("+")) {
|
|
22
|
-
throw new
|
|
32
|
+
throw new AegisError('tokenType cannot contain \'+\' — pass the bare type (e.g. "access_token"), not the full typ header (e.g. "at+jwt")', {
|
|
33
|
+
code: "invalid_token_type_value",
|
|
34
|
+
data: { tokenType },
|
|
35
|
+
title: "Invalid Token Type Value",
|
|
36
|
+
details: "tokenType contains a '+'; pass the bare type such as access_token, not a full typ header like at+jwt.",
|
|
37
|
+
});
|
|
23
38
|
}
|
|
24
39
|
const shortName = TOKEN_TYPE_TO_SHORT_NAME[tokenType] ?? tokenType;
|
|
25
40
|
if (shortName === "JWT")
|
|
26
41
|
return "JWT";
|
|
27
|
-
return
|
|
42
|
+
return `application/${shortName}${FORMAT_SUFFIX[kitFormat]}`;
|
|
28
43
|
};
|
|
29
44
|
export const decodeTokenTypeFromTyp = (typ, kitFormat) => {
|
|
30
45
|
if (!typ)
|
|
@@ -33,7 +48,7 @@ export const decodeTokenTypeFromTyp = (typ, kitFormat) => {
|
|
|
33
48
|
return undefined;
|
|
34
49
|
const suffix = FORMAT_SUFFIX[kitFormat];
|
|
35
50
|
if (typ.endsWith(suffix)) {
|
|
36
|
-
const shortName = typ.slice(0, -suffix.length);
|
|
51
|
+
const shortName = typ.slice(0, -suffix.length).replace(/^application\//, "");
|
|
37
52
|
for (const [tokenType, known] of Object.entries(TOKEN_TYPE_TO_SHORT_NAME)) {
|
|
38
53
|
if (known === shortName)
|
|
39
54
|
return tokenType;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compute-typ-header.js","sourceRoot":"","sources":["../../../src/internal/utils/compute-typ-header.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAkB,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"compute-typ-header.js","sourceRoot":"","sources":["../../../src/internal/utils/compute-typ-header.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAkB,MAAM,+BAA+B,CAAC;AACzF,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAKnD,MAAM,eAAe,GAA8B;IACjD,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,KAAK;CACX,CAAC;AAEF,MAAM,aAAa,GAA8B;IAC/C,GAAG,EAAE,MAAM;IACX,GAAG,EAAE,MAAM;IACX,GAAG,EAAE,MAAM;CACZ,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAC9B,SAAgC,EAChC,SAAoB,EACZ,EAAE;IACV,IAAI,SAAS,KAAK,SAAS;QAAE,OAAO,eAAe,CAAC,SAAS,CAAC,CAAC;IAE/D,IAAI,SAAS,KAAK,EAAE,EAAE,CAAC;QACrB,MAAM,IAAI,UAAU,CAAC,qCAAqC,EAAE;YAC1D,IAAI,EAAE,0BAA0B;YAChC,KAAK,EAAE,0BAA0B;YACjC,OAAO,EACL,oHAAoH;SACvH,CAAC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AK,MAAM,CAAC,SAAS,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,wBAAwB,CAAC,EAAE,CAAC;YAC1E,IAAI,KAAK,KAAK,SAAS;gBAAE,OAAO,SAAS,CAAC;QAC5C,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC;AAQF,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,GAAuB,EAA+B,EAAE;IACpF,IAAI,CAAC,GAAG;QAAE,OAAO,SAAS,CAAC;IAG3B,IAAI,GAAG,KAAK,KAAK;QAAE,OAAO,KAAK,CAAC;IAChC,IAAI,GAAG,KAAK,KAAK,IAAI,GAAG,KAAK,MAAM;QAAE,OAAO,KAAK,CAAC;IAClD,IAAI,GAAG,KAAK,KAAK;QAAE,OAAO,KAAK,CAAC;IAGhC,IAAI,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC;QAAE,OAAO,KAAK,CAAC;IACvC,IAAI,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC;QAAE,OAAO,KAAK,CAAC;IACvC,IAAI,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC;QAAE,OAAO,KAAK,CAAC;IAEvC,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-hash.d.ts","sourceRoot":"","sources":["../../../src/internal/utils/create-hash.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAIzD,KAAK,YAAY,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAEnD,eAAO,MAAM,YAAY,GAAI,WAAW,gBAAgB,KAAG,YAM1D,CAAC;
|
|
1
|
+
{"version":3,"file":"create-hash.d.ts","sourceRoot":"","sources":["../../../src/internal/utils/create-hash.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAIzD,KAAK,YAAY,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAEnD,eAAO,MAAM,YAAY,GAAI,WAAW,gBAAgB,KAAG,YAM1D,CAAC;AAeF,eAAO,MAAM,qBAAqB,GAChC,WAAW,gBAAgB,EAC3B,MAAM,MAAM,KACX,MAAqC,CAAC;AAEzC,eAAO,MAAM,cAAc,GAAI,WAAW,gBAAgB,EAAE,MAAM,MAAM,KAAG,MAC9C,CAAC;AAE9B,eAAO,MAAM,eAAe,GAAI,WAAW,gBAAgB,EAAE,MAAM,MAAM,KAAG,MAC/C,CAAC"}
|
|
@@ -8,17 +8,17 @@ export const shaAlgorithm = (algorithm) => {
|
|
|
8
8
|
return "SHA384";
|
|
9
9
|
if (algorithm.endsWith("512"))
|
|
10
10
|
return "SHA512";
|
|
11
|
-
return "
|
|
11
|
+
return "SHA512";
|
|
12
12
|
};
|
|
13
13
|
const createHashBuffer = (algorithm, data) => cryptoHash(algorithm).update(data, "utf8").digest();
|
|
14
|
-
const
|
|
15
|
-
const createHash = (algorithm, data
|
|
14
|
+
const getLeftHalf = (buffer) => buffer.subarray(0, buffer.length / 2);
|
|
15
|
+
const createHash = (algorithm, data) => {
|
|
16
16
|
const sha = shaAlgorithm(algorithm);
|
|
17
17
|
const buffer = createHashBuffer(sha, data);
|
|
18
|
-
const left =
|
|
18
|
+
const left = getLeftHalf(buffer);
|
|
19
19
|
return B64.encode(left, B64U);
|
|
20
20
|
};
|
|
21
|
-
export const createAccessTokenHash = (algorithm, data) => createHash(algorithm, data
|
|
22
|
-
export const createCodeHash = (algorithm, data) => createHash(algorithm, data
|
|
23
|
-
export const createStateHash = (algorithm, data) => createHash(algorithm, data
|
|
21
|
+
export const createAccessTokenHash = (algorithm, data) => createHash(algorithm, data);
|
|
22
|
+
export const createCodeHash = (algorithm, data) => createHash(algorithm, data);
|
|
23
|
+
export const createStateHash = (algorithm, data) => createHash(algorithm, data);
|
|
24
24
|
//# sourceMappingURL=create-hash.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-hash.js","sourceRoot":"","sources":["../../../src/internal/utils/create-hash.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAEnC,OAAO,EAAE,UAAU,IAAI,UAAU,EAAE,MAAM,QAAQ,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAI9C,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,SAA2B,EAAgB,EAAE;IACxE,IAAI,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC;QAAE,OAAO,QAAQ,CAAC;IAC/C,IAAI,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC;QAAE,OAAO,QAAQ,CAAC;IAC/C,IAAI,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC;QAAE,OAAO,QAAQ,CAAC;IAE/C,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC;AAEF,MAAM,gBAAgB,GAAG,CAAC,SAAuB,EAAE,IAAY,EAAU,EAAE,CACzE,UAAU,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,MAAM,EAAE,CAAC;AAEtD,MAAM,WAAW,GAAG,CAAC,MAAc,
|
|
1
|
+
{"version":3,"file":"create-hash.js","sourceRoot":"","sources":["../../../src/internal/utils/create-hash.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAEnC,OAAO,EAAE,UAAU,IAAI,UAAU,EAAE,MAAM,QAAQ,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAI9C,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,SAA2B,EAAgB,EAAE;IACxE,IAAI,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC;QAAE,OAAO,QAAQ,CAAC;IAC/C,IAAI,SAAS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|
|
2
|
+
import type { TokenProfile } from "../../types/index.js";
|
|
3
|
+
export type VerifyFloorInput = {
|
|
4
|
+
audience: string;
|
|
5
|
+
decodedTyp: string | undefined;
|
|
6
|
+
expectedTyp?: string | undefined;
|
|
7
|
+
expectedIssuer: string | undefined;
|
|
8
|
+
payload: Dict;
|
|
9
|
+
profile: TokenProfile;
|
|
10
|
+
};
|
|
11
|
+
export declare const enforceVerifyFloor: (input: VerifyFloorInput) => void;
|
|
12
|
+
//# sourceMappingURL=enforce-verify-floor.d.ts.map
|