@udibo/oauth2 0.14.0 → 0.15.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 +45 -24
- package/{esm → dist}/adapters/hono/_common.d.ts +5 -5
- package/{esm → dist}/adapters/hono/_common.js +1 -1
- package/{esm → dist}/adapters/hono/authorization-server.d.ts +6 -7
- package/{esm → dist}/adapters/hono/authorization-server.js +0 -1
- package/{esm → dist}/adapters/hono/bff/auth-request-store.d.ts +2 -2
- package/{esm → dist}/adapters/hono/bff/auth-request-store.js +2 -2
- package/{esm → dist}/adapters/hono/bff/bff.d.ts +22 -12
- package/{esm → dist}/adapters/hono/bff/bff.js +35 -29
- package/{esm → dist}/adapters/hono/bff/cookie-prefix.js +1 -2
- package/{esm → dist}/adapters/hono/bff/mod.d.ts +5 -6
- package/{esm → dist}/adapters/hono/bff/mod.js +1 -2
- package/{esm → dist}/adapters/hono/bff/proxy.js +2 -1
- package/{esm → dist}/adapters/hono/bff/session-store.d.ts +2 -2
- package/{esm → dist}/adapters/hono/bff/session-store.js +7 -6
- package/{esm → dist}/adapters/hono/bff/testing.d.ts +7 -8
- package/{esm → dist}/adapters/hono/bff/testing.js +19 -22
- package/{esm → dist}/adapters/hono/identity.d.ts +1 -2
- package/{esm → dist}/adapters/hono/identity.js +10 -10
- package/{esm → dist}/adapters/hono/log.d.ts +0 -1
- package/{esm → dist}/adapters/hono/log.js +0 -6
- package/{esm → dist}/adapters/hono/resource-server.d.ts +5 -6
- package/{esm → dist}/adapters/hono/resource-server.js +0 -1
- package/dist/cli/bin.d.ts +2 -0
- package/dist/cli/bin.js +3 -0
- package/dist/cli/idp/config.d.ts +110 -0
- package/dist/cli/idp/config.js +269 -0
- package/dist/cli/idp/mod.d.ts +20 -0
- package/dist/cli/idp/mod.js +175 -0
- package/dist/cli/idp/pages.d.ts +56 -0
- package/dist/cli/idp/pages.js +190 -0
- package/dist/cli/idp/server.d.ts +93 -0
- package/dist/cli/idp/server.js +559 -0
- package/dist/cli/keygen.d.ts +13 -0
- package/dist/cli/keygen.js +30 -0
- package/dist/cli/mod.d.ts +34 -0
- package/dist/cli/mod.js +94 -0
- package/{esm → dist}/client/_http.d.ts +1 -1
- package/{esm → dist}/client/base.d.ts +1 -1
- package/{esm → dist}/client/bff-client.d.ts +1 -1
- package/{esm → dist}/client/bff-client.js +7 -6
- package/{esm → dist}/client/browser-storage.d.ts +1 -1
- package/{esm → dist}/client/check.js +1 -1
- package/{esm → dist}/client/direct-client.d.ts +6 -6
- package/{esm → dist}/client/direct-client.js +11 -13
- package/{esm → dist}/client/discovery-cache.d.ts +1 -1
- package/{esm → dist}/client/discovery-cache.js +2 -2
- package/{esm → dist}/client/events.d.ts +1 -1
- package/{esm → dist}/client/mod.d.ts +11 -12
- package/{esm → dist}/client/mod.js +1 -1
- package/{esm → dist}/errors.d.ts +1 -1
- package/{esm → dist}/errors.js +1 -1
- package/{esm → dist}/identity/events.d.ts +1 -1
- package/{esm → dist}/identity/external/_shared.d.ts +1 -1
- package/{esm → dist}/identity/external/_shared.js +1 -2
- package/{esm → dist}/identity/external/apple-client-secret.d.ts +1 -1
- package/{esm → dist}/identity/external/apple-client-secret.js +6 -7
- package/{esm → dist}/identity/external/apple.d.ts +5 -5
- package/{esm → dist}/identity/external/apple.js +10 -11
- package/{esm → dist}/identity/external/discord.d.ts +3 -3
- package/{esm → dist}/identity/external/discord.js +2 -2
- package/{esm → dist}/identity/external/flow.d.ts +1 -1
- package/{esm → dist}/identity/external/flow.js +2 -2
- package/{esm → dist}/identity/external/github.d.ts +3 -3
- package/{esm → dist}/identity/external/github.js +12 -17
- package/{esm → dist}/identity/external/google.d.ts +5 -5
- package/{esm → dist}/identity/external/google.js +2 -2
- package/{esm → dist}/identity/external/mod.d.ts +12 -13
- package/{esm → dist}/identity/external/mod.js +0 -1
- package/{esm → dist}/identity/external/oauth2.d.ts +1 -1
- package/{esm → dist}/identity/external/oauth2.js +8 -8
- package/{esm → dist}/identity/external/oidc.d.ts +4 -4
- package/{esm → dist}/identity/external/oidc.js +9 -8
- package/{esm → dist}/identity/hibp.d.ts +1 -1
- package/{esm → dist}/identity/hibp.js +1 -1
- package/{esm → dist}/identity/lockout.js +1 -2
- package/{esm → dist}/identity/mfa/mod.d.ts +4 -5
- package/{esm → dist}/identity/mfa/mod.js +1 -2
- package/{esm → dist}/identity/mfa/service.d.ts +3 -3
- package/{esm → dist}/identity/mfa/service.js +4 -3
- package/{esm → dist}/identity/mfa/totp.d.ts +1 -1
- package/{esm → dist}/identity/mfa/totp.js +2 -2
- package/{esm → dist}/identity/migration.d.ts +2 -3
- package/{esm → dist}/identity/migration.js +3 -4
- package/{esm → dist}/identity/mod.d.ts +14 -15
- package/{esm → dist}/identity/mod.js +0 -1
- package/{esm → dist}/identity/otp.d.ts +1 -1
- package/{esm → dist}/identity/otp.js +4 -2
- package/{esm → dist}/identity/password.js +8 -5
- package/{esm → dist}/identity/rate-limit.d.ts +1 -1
- package/{esm → dist}/identity/service.d.ts +10 -10
- package/{esm → dist}/identity/service.js +17 -18
- package/{esm → dist}/identity/session.js +2 -2
- package/{esm → dist}/identity/token-flow.js +3 -2
- package/{esm → dist}/models/authorization-code.d.ts +3 -3
- package/{esm → dist}/models/authorization.d.ts +1 -1
- package/{esm → dist}/models/authorization.js +1 -2
- package/{esm → dist}/models/device-authorization.d.ts +2 -2
- package/{esm → dist}/models/token.d.ts +3 -3
- package/{esm → dist}/react/callback.d.ts +1 -1
- package/{esm → dist}/react/callback.js +0 -1
- package/{esm → dist}/react/components/class-names.d.ts +1 -1
- package/{esm → dist}/react/components/class-names.js +3 -2
- package/{esm → dist}/react/components/internal.d.ts +2 -2
- package/{esm → dist}/react/components/internal.js +5 -11
- package/{esm → dist}/react/components/mfa-challenge-form.d.ts +2 -2
- package/{esm → dist}/react/components/mfa-challenge-form.js +4 -6
- package/{esm → dist}/react/components/mfa-enrollment-form.d.ts +2 -2
- package/{esm → dist}/react/components/mfa-enrollment-form.js +2 -6
- package/{esm → dist}/react/components/mod.d.ts +20 -21
- package/{esm → dist}/react/components/mod.js +1 -2
- package/{esm → dist}/react/components/request-password-reset-form.d.ts +2 -2
- package/{esm → dist}/react/components/request-password-reset-form.js +1 -3
- package/{esm → dist}/react/components/reset-password-form.d.ts +2 -2
- package/{esm → dist}/react/components/reset-password-form.js +2 -2
- package/{esm → dist}/react/components/sign-in-form.d.ts +2 -2
- package/{esm → dist}/react/components/sign-in-form.js +1 -5
- package/{esm → dist}/react/components/sign-up-form.d.ts +2 -2
- package/{esm → dist}/react/components/sign-up-form.js +4 -10
- package/{esm → dist}/react/components/types.d.ts +2 -2
- package/{esm → dist}/react/components/use-auth-form.d.ts +3 -3
- package/{esm → dist}/react/components/use-auth-form.js +4 -7
- package/{esm → dist}/react/components/user-menu.d.ts +2 -2
- package/{esm → dist}/react/components/user-menu.js +9 -14
- package/{esm → dist}/react/context.d.ts +1 -1
- package/{esm → dist}/react/mod.d.ts +6 -7
- package/{esm → dist}/react/mod.js +0 -1
- package/{esm → dist}/react/provider.d.ts +2 -2
- package/{esm → dist}/react/require-auth.js +1 -3
- package/{esm → dist}/react/testing.d.ts +2 -3
- package/{esm → dist}/react/testing.js +1 -2
- package/{esm → dist}/react/use-authorization.d.ts +1 -1
- package/{esm → dist}/react/use-oauth2.d.ts +8 -1
- package/{esm → dist}/react/use-oauth2.js +0 -1
- package/{esm → dist}/server/_clock-skew.js +2 -1
- package/{esm → dist}/server/authorization-server.d.ts +40 -41
- package/{esm → dist}/server/authorization-server.js +32 -42
- package/{esm → dist}/server/client-authentication.d.ts +2 -2
- package/{esm → dist}/server/grants/authorization-code.d.ts +9 -9
- package/{esm → dist}/server/grants/authorization-code.js +5 -6
- package/{esm → dist}/server/grants/client-credentials.d.ts +4 -4
- package/{esm → dist}/server/grants/device-authorization.d.ts +6 -6
- package/{esm → dist}/server/grants/device-authorization.js +4 -4
- package/{esm → dist}/server/grants/grant.d.ts +7 -7
- package/{esm → dist}/server/grants/grant.js +7 -7
- package/{esm → dist}/server/grants/password.d.ts +5 -5
- package/{esm → dist}/server/grants/refresh-token.d.ts +4 -4
- package/{esm → dist}/server/grants/refresh-token.js +5 -6
- package/{esm → dist}/server/introspection-token-reader.d.ts +5 -5
- package/{esm → dist}/server/introspection-token-reader.js +4 -4
- package/{esm → dist}/server/jwks-token-reader.d.ts +5 -5
- package/{esm → dist}/server/jwks-token-reader.js +4 -4
- package/{esm → dist}/server/mod.d.ts +12 -13
- package/{esm → dist}/server/mod.js +0 -1
- package/{esm → dist}/server/public-suffix/mod.d.ts +2 -3
- package/{esm → dist}/server/public-suffix/mod.js +1 -2
- package/{esm → dist}/server/public-suffix/rules.d.ts +1 -1
- package/{esm → dist}/server/public-suffix/rules.js +1 -1
- package/{esm → dist}/server/redirect-uri.js +5 -4
- package/{esm → dist}/server/resource-server.d.ts +11 -12
- package/{esm → dist}/server/resource-server.js +12 -14
- package/{esm → dist}/server/services/authorization-code.d.ts +5 -5
- package/{esm → dist}/server/services/client.d.ts +1 -1
- package/{esm → dist}/server/services/device-authorization.d.ts +3 -3
- package/{esm → dist}/server/services/token.d.ts +6 -6
- package/{esm → dist}/server/services/token.js +3 -1
- package/{esm → dist}/server/services/user.d.ts +1 -1
- package/{esm → dist}/server/signing-keys.d.ts +1 -1
- package/{esm → dist}/server/signing-keys.js +8 -2
- package/{esm → dist}/server/utils/hash.js +1 -1
- package/{esm → dist}/testing/contract/auth-request-storage.d.ts +1 -1
- package/{esm → dist}/testing/contract/auth-request-storage.js +24 -29
- package/{esm → dist}/testing/contract/authorization-code.d.ts +6 -6
- package/{esm → dist}/testing/contract/authorization-code.js +16 -17
- package/{esm → dist}/testing/contract/client.d.ts +4 -4
- package/{esm → dist}/testing/contract/client.js +14 -15
- package/{esm → dist}/testing/contract/device-authorization.d.ts +6 -6
- package/{esm → dist}/testing/contract/device-authorization.js +37 -39
- package/{esm → dist}/testing/contract/identity-session.d.ts +6 -1
- package/{esm → dist}/testing/contract/identity-session.js +44 -36
- package/{esm → dist}/testing/contract/identity-user-store.d.ts +8 -2
- package/{esm → dist}/testing/contract/identity-user-store.js +48 -46
- package/{esm → dist}/testing/contract/lockout-store.d.ts +1 -1
- package/{esm → dist}/testing/contract/lockout-store.js +23 -24
- package/{esm → dist}/testing/contract/mfa-store.d.ts +1 -1
- package/{esm → dist}/testing/contract/mfa-store.js +53 -54
- package/{esm → dist}/testing/contract/mod.d.ts +15 -16
- package/{esm → dist}/testing/contract/mod.js +0 -1
- package/{esm → dist}/testing/contract/otp-store.d.ts +1 -1
- package/{esm → dist}/testing/contract/otp-store.js +33 -34
- package/{esm → dist}/testing/contract/rate-limit-store.d.ts +1 -1
- package/{esm → dist}/testing/contract/rate-limit-store.js +15 -16
- package/{esm → dist}/testing/contract/tenant.js +361 -330
- package/{esm → dist}/testing/contract/token-flow-store.d.ts +1 -1
- package/{esm → dist}/testing/contract/token-flow-store.js +27 -32
- package/{esm → dist}/testing/contract/token-reader.d.ts +3 -3
- package/{esm → dist}/testing/contract/token-reader.js +6 -7
- package/{esm → dist}/testing/contract/token.d.ts +7 -7
- package/{esm → dist}/testing/contract/token.js +48 -53
- package/{esm → dist}/testing/contract/user.d.ts +2 -2
- package/{esm → dist}/testing/contract/user.js +8 -9
- package/{esm → dist}/testing/mod.d.ts +5 -6
- package/{esm → dist}/testing/mod.js +2 -3
- package/{esm → dist}/testing/server.d.ts +7 -6
- package/{esm → dist}/testing/server.js +2 -1
- package/{esm → dist}/testing/services.d.ts +11 -11
- package/{esm → dist}/testing/services.js +8 -8
- package/{esm → dist}/testing/tenant.d.ts +11 -7
- package/{esm → dist}/testing/tenant.js +109 -94
- package/dist/utils/_constant-time.d.ts +12 -0
- package/dist/utils/_constant-time.js +19 -0
- package/{esm → dist}/utils/_default-fetch.js +4 -1
- package/dist/utils/_delay.d.ts +13 -0
- package/dist/utils/_delay.js +28 -0
- package/dist/utils/_encoding.d.ts +39 -0
- package/dist/utils/_encoding.js +126 -0
- package/{esm → dist}/utils/authentication-context.d.ts +1 -1
- package/{esm → dist}/utils/crypto.d.ts +2 -3
- package/{esm → dist}/utils/crypto.js +3 -4
- package/{esm → dist}/utils/pkce.js +1 -1
- package/{esm → dist}/utils/text.js +1 -1
- package/{esm → dist}/utils/url.d.ts +0 -1
- package/{esm → dist}/utils/url.js +0 -1
- package/package.json +156 -33
- package/esm/_dnt.polyfills.d.ts +0 -31
- package/esm/_dnt.polyfills.js +0 -26
- package/esm/deps/jsr.io/@std/assert/1.0.19/almost_equals.d.ts +0 -29
- package/esm/deps/jsr.io/@std/assert/1.0.19/almost_equals.js +0 -47
- package/esm/deps/jsr.io/@std/assert/1.0.19/array_includes.d.ts +0 -28
- package/esm/deps/jsr.io/@std/assert/1.0.19/array_includes.js +0 -65
- package/esm/deps/jsr.io/@std/assert/1.0.19/assert.d.ts +0 -16
- package/esm/deps/jsr.io/@std/assert/1.0.19/assert.js +0 -23
- package/esm/deps/jsr.io/@std/assert/1.0.19/assertion_error.d.ts +0 -25
- package/esm/deps/jsr.io/@std/assert/1.0.19/assertion_error.js +0 -30
- package/esm/deps/jsr.io/@std/assert/1.0.19/equal.d.ts +0 -24
- package/esm/deps/jsr.io/@std/assert/1.0.19/equal.js +0 -193
- package/esm/deps/jsr.io/@std/assert/1.0.19/equals.d.ts +0 -36
- package/esm/deps/jsr.io/@std/assert/1.0.19/equals.js +0 -61
- package/esm/deps/jsr.io/@std/assert/1.0.19/exists.d.ts +0 -17
- package/esm/deps/jsr.io/@std/assert/1.0.19/exists.js +0 -27
- package/esm/deps/jsr.io/@std/assert/1.0.19/fail.d.ts +0 -14
- package/esm/deps/jsr.io/@std/assert/1.0.19/fail.js +0 -20
- package/esm/deps/jsr.io/@std/assert/1.0.19/false.d.ts +0 -18
- package/esm/deps/jsr.io/@std/assert/1.0.19/false.js +0 -23
- package/esm/deps/jsr.io/@std/assert/1.0.19/greater.d.ts +0 -19
- package/esm/deps/jsr.io/@std/assert/1.0.19/greater.js +0 -29
- package/esm/deps/jsr.io/@std/assert/1.0.19/greater_or_equal.d.ts +0 -19
- package/esm/deps/jsr.io/@std/assert/1.0.19/greater_or_equal.js +0 -29
- package/esm/deps/jsr.io/@std/assert/1.0.19/instance_of.d.ts +0 -22
- package/esm/deps/jsr.io/@std/assert/1.0.19/instance_of.js +0 -52
- package/esm/deps/jsr.io/@std/assert/1.0.19/is_error.d.ts +0 -24
- package/esm/deps/jsr.io/@std/assert/1.0.19/is_error.js +0 -53
- package/esm/deps/jsr.io/@std/assert/1.0.19/less.d.ts +0 -18
- package/esm/deps/jsr.io/@std/assert/1.0.19/less.js +0 -28
- package/esm/deps/jsr.io/@std/assert/1.0.19/less_or_equal.d.ts +0 -19
- package/esm/deps/jsr.io/@std/assert/1.0.19/less_or_equal.js +0 -29
- package/esm/deps/jsr.io/@std/assert/1.0.19/match.d.ts +0 -17
- package/esm/deps/jsr.io/@std/assert/1.0.19/match.js +0 -26
- package/esm/deps/jsr.io/@std/assert/1.0.19/mod.d.ts +0 -43
- package/esm/deps/jsr.io/@std/assert/1.0.19/mod.js +0 -45
- package/esm/deps/jsr.io/@std/assert/1.0.19/not_equals.d.ts +0 -26
- package/esm/deps/jsr.io/@std/assert/1.0.19/not_equals.js +0 -39
- package/esm/deps/jsr.io/@std/assert/1.0.19/not_instance_of.d.ts +0 -19
- package/esm/deps/jsr.io/@std/assert/1.0.19/not_instance_of.js +0 -29
- package/esm/deps/jsr.io/@std/assert/1.0.19/not_match.d.ts +0 -17
- package/esm/deps/jsr.io/@std/assert/1.0.19/not_match.js +0 -26
- package/esm/deps/jsr.io/@std/assert/1.0.19/not_strict_equals.d.ts +0 -22
- package/esm/deps/jsr.io/@std/assert/1.0.19/not_strict_equals.js +0 -32
- package/esm/deps/jsr.io/@std/assert/1.0.19/object_match.d.ts +0 -28
- package/esm/deps/jsr.io/@std/assert/1.0.19/object_match.js +0 -177
- package/esm/deps/jsr.io/@std/assert/1.0.19/rejects.d.ts +0 -41
- package/esm/deps/jsr.io/@std/assert/1.0.19/rejects.js +0 -53
- package/esm/deps/jsr.io/@std/assert/1.0.19/strict_equals.d.ts +0 -23
- package/esm/deps/jsr.io/@std/assert/1.0.19/strict_equals.js +0 -58
- package/esm/deps/jsr.io/@std/assert/1.0.19/string_includes.d.ts +0 -17
- package/esm/deps/jsr.io/@std/assert/1.0.19/string_includes.js +0 -26
- package/esm/deps/jsr.io/@std/assert/1.0.19/throws.d.ts +0 -44
- package/esm/deps/jsr.io/@std/assert/1.0.19/throws.js +0 -44
- package/esm/deps/jsr.io/@std/assert/1.0.19/unimplemented.d.ts +0 -14
- package/esm/deps/jsr.io/@std/assert/1.0.19/unimplemented.js +0 -20
- package/esm/deps/jsr.io/@std/assert/1.0.19/unreachable.d.ts +0 -14
- package/esm/deps/jsr.io/@std/assert/1.0.19/unreachable.js +0 -20
- package/esm/deps/jsr.io/@std/async/1.5.0/delay.d.ts +0 -44
- package/esm/deps/jsr.io/@std/async/1.5.0/delay.js +0 -84
- package/esm/deps/jsr.io/@std/crypto/1.1.0/timing_safe_equal.d.ts +0 -39
- package/esm/deps/jsr.io/@std/crypto/1.1.0/timing_safe_equal.js +0 -61
- package/esm/deps/jsr.io/@std/encoding/1.0.11/_common16.d.ts +0 -22
- package/esm/deps/jsr.io/@std/encoding/1.0.11/_common16.js +0 -51
- package/esm/deps/jsr.io/@std/encoding/1.0.11/_common32.d.ts +0 -34
- package/esm/deps/jsr.io/@std/encoding/1.0.11/_common32.js +0 -192
- package/esm/deps/jsr.io/@std/encoding/1.0.11/_common64.d.ts +0 -34
- package/esm/deps/jsr.io/@std/encoding/1.0.11/_common64.js +0 -113
- package/esm/deps/jsr.io/@std/encoding/1.0.11/_common_detach.d.ts +0 -3
- package/esm/deps/jsr.io/@std/encoding/1.0.11/_common_detach.js +0 -13
- package/esm/deps/jsr.io/@std/encoding/1.0.11/_types.d.ts +0 -8
- package/esm/deps/jsr.io/@std/encoding/1.0.11/_types.js +0 -2
- package/esm/deps/jsr.io/@std/encoding/1.0.11/_validate_binary_like.d.ts +0 -1
- package/esm/deps/jsr.io/@std/encoding/1.0.11/_validate_binary_like.js +0 -26
- package/esm/deps/jsr.io/@std/encoding/1.0.11/ascii85.d.ts +0 -60
- package/esm/deps/jsr.io/@std/encoding/1.0.11/ascii85.js +0 -152
- package/esm/deps/jsr.io/@std/encoding/1.0.11/base32.d.ts +0 -39
- package/esm/deps/jsr.io/@std/encoding/1.0.11/base32.js +0 -87
- package/esm/deps/jsr.io/@std/encoding/1.0.11/base58.d.ts +0 -39
- package/esm/deps/jsr.io/@std/encoding/1.0.11/base58.js +0 -131
- package/esm/deps/jsr.io/@std/encoding/1.0.11/base64.d.ts +0 -39
- package/esm/deps/jsr.io/@std/encoding/1.0.11/base64.js +0 -82
- package/esm/deps/jsr.io/@std/encoding/1.0.11/base64url.d.ts +0 -39
- package/esm/deps/jsr.io/@std/encoding/1.0.11/base64url.js +0 -72
- package/esm/deps/jsr.io/@std/encoding/1.0.11/hex.d.ts +0 -38
- package/esm/deps/jsr.io/@std/encoding/1.0.11/hex.js +0 -87
- package/esm/deps/jsr.io/@std/encoding/1.0.11/mod.d.ts +0 -97
- package/esm/deps/jsr.io/@std/encoding/1.0.11/mod.js +0 -99
- package/esm/deps/jsr.io/@std/encoding/1.0.11/varint.d.ts +0 -119
- package/esm/deps/jsr.io/@std/encoding/1.0.11/varint.js +0 -209
- package/esm/deps/jsr.io/@std/http/1.1.3/status.d.ts +0 -343
- package/esm/deps/jsr.io/@std/http/1.1.3/status.js +0 -343
- package/esm/deps/jsr.io/@std/internal/1.0.14/assertion_state.d.ts +0 -159
- package/esm/deps/jsr.io/@std/internal/1.0.14/assertion_state.js +0 -223
- package/esm/deps/jsr.io/@std/internal/1.0.14/build_message.d.ts +0 -79
- package/esm/deps/jsr.io/@std/internal/1.0.14/build_message.js +0 -116
- package/esm/deps/jsr.io/@std/internal/1.0.14/diff.d.ts +0 -139
- package/esm/deps/jsr.io/@std/internal/1.0.14/diff.js +0 -277
- package/esm/deps/jsr.io/@std/internal/1.0.14/diff_str.d.ts +0 -98
- package/esm/deps/jsr.io/@std/internal/1.0.14/diff_str.js +0 -181
- package/esm/deps/jsr.io/@std/internal/1.0.14/format.d.ts +0 -29
- package/esm/deps/jsr.io/@std/internal/1.0.14/format.js +0 -68
- package/esm/deps/jsr.io/@std/internal/1.0.14/styles.d.ts +0 -158
- package/esm/deps/jsr.io/@std/internal/1.0.14/styles.js +0 -206
- package/esm/deps/jsr.io/@std/internal/1.0.14/types.d.ts +0 -24
- package/esm/deps/jsr.io/@std/internal/1.0.14/types.js +0 -3
- package/esm/deps/jsr.io/@std/testing/1.0.20/_test_suite.d.ts +0 -91
- package/esm/deps/jsr.io/@std/testing/1.0.20/_test_suite.js +0 -347
- package/esm/deps/jsr.io/@std/testing/1.0.20/bdd.d.ts +0 -382
- package/esm/deps/jsr.io/@std/testing/1.0.20/bdd.js +0 -1110
- package/esm/deps/jsr.io/@udibo/http-error/0.11.1/mod.d.ts +0 -363
- package/esm/deps/jsr.io/@udibo/http-error/0.11.1/mod.js +0 -616
- package/esm/package.json +0 -3
- /package/{esm → dist}/adapters/hono/bff/cookie-prefix.d.ts +0 -0
- /package/{esm → dist}/adapters/hono/bff/proxy.d.ts +0 -0
- /package/{esm → dist}/client/_http.js +0 -0
- /package/{esm → dist}/client/base.js +0 -0
- /package/{esm → dist}/client/browser-storage.js +0 -0
- /package/{esm → dist}/client/check.d.ts +0 -0
- /package/{esm → dist}/client/events.js +0 -0
- /package/{esm → dist}/client/storage.d.ts +0 -0
- /package/{esm → dist}/client/storage.js +0 -0
- /package/{esm → dist}/identity/captcha.d.ts +0 -0
- /package/{esm → dist}/identity/captcha.js +0 -0
- /package/{esm → dist}/identity/delivery.d.ts +0 -0
- /package/{esm → dist}/identity/delivery.js +0 -0
- /package/{esm → dist}/identity/errors.d.ts +0 -0
- /package/{esm → dist}/identity/errors.js +0 -0
- /package/{esm → dist}/identity/events.js +0 -0
- /package/{esm → dist}/identity/external/_token-exchange.d.ts +0 -0
- /package/{esm → dist}/identity/external/_token-exchange.js +0 -0
- /package/{esm → dist}/identity/external/errors.d.ts +0 -0
- /package/{esm → dist}/identity/external/errors.js +0 -0
- /package/{esm → dist}/identity/external/provider.d.ts +0 -0
- /package/{esm → dist}/identity/external/provider.js +0 -0
- /package/{esm → dist}/identity/identifier.d.ts +0 -0
- /package/{esm → dist}/identity/identifier.js +0 -0
- /package/{esm → dist}/identity/lockout.d.ts +0 -0
- /package/{esm → dist}/identity/mfa/recovery-codes.d.ts +0 -0
- /package/{esm → dist}/identity/mfa/recovery-codes.js +0 -0
- /package/{esm → dist}/identity/password-policy.d.ts +0 -0
- /package/{esm → dist}/identity/password-policy.js +0 -0
- /package/{esm → dist}/identity/password.d.ts +0 -0
- /package/{esm → dist}/identity/rate-limit.js +0 -0
- /package/{esm → dist}/identity/session.d.ts +0 -0
- /package/{esm → dist}/identity/token-flow.d.ts +0 -0
- /package/{esm → dist}/models/authentication.d.ts +0 -0
- /package/{esm → dist}/models/authentication.js +0 -0
- /package/{esm → dist}/models/authorization-code.js +0 -0
- /package/{esm → dist}/models/client.d.ts +0 -0
- /package/{esm → dist}/models/client.js +0 -0
- /package/{esm → dist}/models/device-authorization.js +0 -0
- /package/{esm → dist}/models/responses.d.ts +0 -0
- /package/{esm → dist}/models/responses.js +0 -0
- /package/{esm → dist}/models/scope.d.ts +0 -0
- /package/{esm → dist}/models/scope.js +0 -0
- /package/{esm → dist}/models/token.js +0 -0
- /package/{esm → dist}/react/components/types.js +0 -0
- /package/{esm → dist}/react/context.js +0 -0
- /package/{esm → dist}/react/provider.js +0 -0
- /package/{esm → dist}/react/require-auth.d.ts +0 -0
- /package/{esm → dist}/react/use-authorization.js +0 -0
- /package/{esm → dist}/server/_clock-skew.d.ts +0 -0
- /package/{esm → dist}/server/client-authentication.js +0 -0
- /package/{esm → dist}/server/grants/client-credentials.js +0 -0
- /package/{esm → dist}/server/grants/password.js +0 -0
- /package/{esm → dist}/server/redirect-uri.d.ts +0 -0
- /package/{esm → dist}/server/services/authorization-code.js +0 -0
- /package/{esm → dist}/server/services/client.js +0 -0
- /package/{esm → dist}/server/services/device-authorization.js +0 -0
- /package/{esm → dist}/server/services/user.js +0 -0
- /package/{esm → dist}/server/utils/hash.d.ts +0 -0
- /package/{esm → dist}/testing/contract/_race.d.ts +0 -0
- /package/{esm → dist}/testing/contract/_race.js +0 -0
- /package/{esm → dist}/testing/contract/tenant.d.ts +0 -0
- /package/{esm → dist}/utils/_body.d.ts +0 -0
- /package/{esm → dist}/utils/_body.js +0 -0
- /package/{esm → dist}/utils/_buffer.d.ts +0 -0
- /package/{esm → dist}/utils/_buffer.js +0 -0
- /package/{esm → dist}/utils/_default-fetch.d.ts +0 -0
- /package/{esm → dist}/utils/_timing-safe.d.ts +0 -0
- /package/{esm → dist}/utils/_timing-safe.js +0 -0
- /package/{esm → dist}/utils/authentication-context.js +0 -0
- /package/{esm → dist}/utils/basic-auth.d.ts +0 -0
- /package/{esm → dist}/utils/basic-auth.js +0 -0
- /package/{esm → dist}/utils/pkce.d.ts +0 -0
- /package/{esm → dist}/utils/text.d.ts +0 -0
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* It owns field values, per-field and form-level errors, and the submit
|
|
6
6
|
* lifecycle, and stays entirely presentation-free: no markup, no styling, no
|
|
7
7
|
* router or network assumptions. The action is injected as `onSubmit`, so the
|
|
8
|
-
* same hook drives a client-side `fetch`
|
|
9
|
-
*
|
|
8
|
+
* same hook drives a client-side `fetch` or a React Router action submit.
|
|
9
|
+
* Reach for it directly when you want to own
|
|
10
10
|
* the markup completely (the "eject to headless" path); otherwise use a
|
|
11
11
|
* default component, which is built on this hook.
|
|
12
12
|
*
|
|
@@ -100,8 +100,7 @@ export function useAuthForm(options) {
|
|
|
100
100
|
return;
|
|
101
101
|
}
|
|
102
102
|
const fieldErrors = result?.fieldErrors;
|
|
103
|
-
const hasFieldErrors = fieldErrors &&
|
|
104
|
-
Object.keys(fieldErrors).length > 0;
|
|
103
|
+
const hasFieldErrors = fieldErrors && Object.keys(fieldErrors).length > 0;
|
|
105
104
|
if (result?.error || hasFieldErrors) {
|
|
106
105
|
if (result?.error)
|
|
107
106
|
setFormError(result.error);
|
|
@@ -134,9 +133,7 @@ export function useAuthForm(options) {
|
|
|
134
133
|
value: typeof raw === "boolean" ? "" : String(raw ?? ""),
|
|
135
134
|
onChange: (event) => {
|
|
136
135
|
const target = event.target;
|
|
137
|
-
const next = target.type === "checkbox"
|
|
138
|
-
? target.checked
|
|
139
|
-
: target.value;
|
|
136
|
+
const next = target.type === "checkbox" ? target.checked : target.value;
|
|
140
137
|
setValue(name, next);
|
|
141
138
|
},
|
|
142
139
|
"aria-invalid": hasError ? true : undefined,
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
* @module
|
|
15
15
|
*/
|
|
16
16
|
import { type ReactNode } from "react";
|
|
17
|
-
import type { UserInfoClaims } from "../../client/mod.
|
|
18
|
-
import type { BaseClassNames } from "./types.
|
|
17
|
+
import type { UserInfoClaims } from "../../client/mod.ts";
|
|
18
|
+
import type { BaseClassNames } from "./types.ts";
|
|
19
19
|
/**
|
|
20
20
|
* Per-slot class hooks for {@link UserMenu}: the shared {@link BaseClassNames}
|
|
21
21
|
* `root` plus the menu's own slots.
|
|
@@ -54,20 +54,15 @@ export function UserMenu(props) {
|
|
|
54
54
|
}, [open]);
|
|
55
55
|
if (!user)
|
|
56
56
|
return _jsx(_Fragment, { children: signedOut });
|
|
57
|
-
const runLogout = onLogout ??
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
const runLogout = onLogout ??
|
|
58
|
+
(async () => {
|
|
59
|
+
await logout();
|
|
60
|
+
});
|
|
60
61
|
if (children)
|
|
61
62
|
return _jsx(_Fragment, { children: children({ user, logout: runLogout }) });
|
|
62
|
-
return (_jsxs("div", { ref: rootRef, "data-oauth2-user-menu": "", className: combineClassNames(className, classNames?.root), children: [_jsx("button", { type: "button", "aria-expanded": open, "aria-controls": panelId, onClick: () => setOpen((value) => !value), "data-oauth2-user-trigger": "", className: classNames?.trigger, children: renderUser
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
: null, _jsx("button", { type: "button", onClick: () => {
|
|
68
|
-
void Promise.resolve(runLogout()).catch((error) => {
|
|
69
|
-
console.error("[@udibo/oauth2] logout failed:", error);
|
|
70
|
-
});
|
|
71
|
-
}, "data-oauth2-logout": "", className: classNames?.logout, children: labels?.logout ?? "Sign out" })] }))
|
|
72
|
-
: null] }));
|
|
63
|
+
return (_jsxs("div", { ref: rootRef, "data-oauth2-user-menu": "", className: combineClassNames(className, classNames?.root), children: [_jsx("button", { type: "button", "aria-expanded": open, "aria-controls": panelId, onClick: () => setOpen((value) => !value), "data-oauth2-user-trigger": "", className: classNames?.trigger, children: renderUser ? (renderUser(user)) : (_jsx("span", { "data-oauth2-user-name": "", className: classNames?.name, children: displayName(user) })) }), open ? (_jsxs("div", { id: panelId, "data-oauth2-user-panel": "", className: classNames?.menu, children: [items ? (_jsx("div", { "data-oauth2-user-items": "", className: classNames?.menuItem, children: items })) : null, _jsx("button", { type: "button", onClick: () => {
|
|
64
|
+
void Promise.resolve(runLogout()).catch((error) => {
|
|
65
|
+
console.error("[@udibo/oauth2] logout failed:", error);
|
|
66
|
+
});
|
|
67
|
+
}, "data-oauth2-logout": "", className: classNames?.logout, children: labels?.logout ?? "Sign out" })] })) : null] }));
|
|
73
68
|
}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @module
|
|
9
9
|
*/
|
|
10
10
|
import { type Context } from "react";
|
|
11
|
-
import type { OAuth2ClientBase, OAuth2Error, UserInfoClaims } from "../client/mod.
|
|
11
|
+
import type { OAuth2ClientBase, OAuth2Error, UserInfoClaims } from "../client/mod.ts";
|
|
12
12
|
/** Shape exposed by `useOAuth2()`. */
|
|
13
13
|
export interface OAuth2State {
|
|
14
14
|
/** Whether a user is currently authenticated. */
|
|
@@ -17,10 +17,9 @@
|
|
|
17
17
|
*
|
|
18
18
|
* @module
|
|
19
19
|
*/
|
|
20
|
-
|
|
21
|
-
export {
|
|
22
|
-
export {
|
|
23
|
-
export {
|
|
24
|
-
export {
|
|
25
|
-
export {
|
|
26
|
-
export { OAuth2Callback, type OAuth2CallbackProps } from "./callback.js";
|
|
20
|
+
export { OAuth2Context, type OAuth2ContextValue, type OAuth2State, } from "./context.ts";
|
|
21
|
+
export { OAuth2Provider, type OAuth2ProviderProps } from "./provider.tsx";
|
|
22
|
+
export { useBffClient, useDirectClient, useOAuth2, type UseOAuth2Result, } from "./use-oauth2.ts";
|
|
23
|
+
export { useAuthorization } from "./use-authorization.ts";
|
|
24
|
+
export { RequireAuth, type RequireAuthProps } from "./require-auth.tsx";
|
|
25
|
+
export { OAuth2Callback, type OAuth2CallbackProps } from "./callback.tsx";
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
* @module
|
|
7
7
|
*/
|
|
8
8
|
import { type ReactNode } from "react";
|
|
9
|
-
import type { OAuth2ClientBase } from "../client/mod.
|
|
10
|
-
import { type OAuth2State } from "./context.
|
|
9
|
+
import type { OAuth2ClientBase } from "../client/mod.ts";
|
|
10
|
+
import { type OAuth2State } from "./context.ts";
|
|
11
11
|
/** Props for {@link OAuth2Provider}. */
|
|
12
12
|
export interface OAuth2ProviderProps {
|
|
13
13
|
/**
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
// deno-lint-ignore-file no-window -- browser-only; `window` used only after isBrowser() guards
|
|
2
1
|
/**
|
|
3
2
|
* `<RequireAuth>` — gate a subtree behind authentication. If the user is
|
|
4
3
|
* not authenticated, calls `login({ returnTo })` (the {@link useOAuth2}
|
|
@@ -24,8 +23,7 @@ export function RequireAuth(props) {
|
|
|
24
23
|
return;
|
|
25
24
|
if (!isBrowser())
|
|
26
25
|
return;
|
|
27
|
-
const target = returnTo ??
|
|
28
|
-
`${window.location.pathname}${window.location.search}`;
|
|
26
|
+
const target = returnTo ?? `${window.location.pathname}${window.location.search}`;
|
|
29
27
|
login({ returnTo: target }).catch(() => { });
|
|
30
28
|
}, [isLoading, isAuthenticated, login, returnTo]);
|
|
31
29
|
if (isLoading || !isAuthenticated)
|
|
@@ -42,10 +42,9 @@
|
|
|
42
42
|
*
|
|
43
43
|
* @module
|
|
44
44
|
*/
|
|
45
|
-
import "../_dnt.polyfills.js";
|
|
46
45
|
import { type ReactNode } from "react";
|
|
47
|
-
import { type AuthorizationRedirect, type BaseLoginOptions, BffClient, DirectClient, type LoginRedirect, type LogoutRedirect, OAuth2ClientBase, type OAuth2Error, type SessionState, type UserInfoClaims } from "../client/mod.
|
|
48
|
-
import { type OAuth2State } from "./context.
|
|
46
|
+
import { type AuthorizationRedirect, type BaseLoginOptions, BffClient, DirectClient, type LoginRedirect, type LogoutRedirect, OAuth2ClientBase, type OAuth2Error, type SessionState, type UserInfoClaims } from "../client/mod.ts";
|
|
47
|
+
import { type OAuth2State } from "./context.ts";
|
|
49
48
|
/** Where a mock client starts. */
|
|
50
49
|
export interface MockOAuth2ClientState {
|
|
51
50
|
/** Whether the mock starts signed in. Defaults to `user !== null`. */
|
|
@@ -43,7 +43,6 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
43
43
|
*
|
|
44
44
|
* @module
|
|
45
45
|
*/
|
|
46
|
-
import "../_dnt.polyfills.js";
|
|
47
46
|
import { useMemo } from "react";
|
|
48
47
|
import { BffClient, DirectClient, OAuth2ClientBase, } from "../client/mod.js";
|
|
49
48
|
import { OAuth2Context } from "./context.js";
|
|
@@ -450,7 +449,7 @@ export function MockOAuth2Provider(props) {
|
|
|
450
449
|
: client.initialState.isAuthenticated,
|
|
451
450
|
isLoading: override.isLoading ?? false,
|
|
452
451
|
user: overrides("user")
|
|
453
|
-
? override.user ?? null
|
|
452
|
+
? (override.user ?? null)
|
|
454
453
|
: client.initialState.user,
|
|
455
454
|
error: override.error ?? null,
|
|
456
455
|
sessionExpiresIn: override.sessionExpiresIn ?? null,
|
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* `useOAuth2()` — the primary React hook for consuming OAuth2 state and
|
|
3
|
+
* driving auth actions, plus the two hooks that narrow the context's client
|
|
4
|
+
* to a concrete transport.
|
|
5
|
+
*
|
|
6
|
+
* @module
|
|
7
|
+
*/
|
|
8
|
+
import { type BaseLoginOptions, BffClient, DirectClient, type LogoutOptions, type OAuth2ClientBase, type OAuth2Error, type UserInfoClaims } from "../client/mod.ts";
|
|
2
9
|
/** Return value of {@link useOAuth2}. */
|
|
3
10
|
export interface UseOAuth2Result {
|
|
4
11
|
/** True iff a user is authenticated. */
|
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
*/
|
|
7
7
|
/** Throws `RangeError` unless the leeway is non-negative, finite seconds whose millisecond conversion is finite. */
|
|
8
8
|
export function assertClockSkewSeconds(clockSkewSeconds) {
|
|
9
|
-
if (!Number.isFinite(clockSkewSeconds) ||
|
|
9
|
+
if (!Number.isFinite(clockSkewSeconds) ||
|
|
10
|
+
clockSkewSeconds < 0 ||
|
|
10
11
|
!Number.isFinite(clockSkewSeconds * 1000)) {
|
|
11
12
|
throw new RangeError("clockSkewSeconds must be non-negative finite seconds with a finite millisecond conversion");
|
|
12
13
|
}
|
|
@@ -19,19 +19,18 @@
|
|
|
19
19
|
* @see https://datatracker.ietf.org/doc/html/rfc6749
|
|
20
20
|
* @module
|
|
21
21
|
*/
|
|
22
|
-
import "../
|
|
23
|
-
import type {
|
|
24
|
-
import type {
|
|
25
|
-
import type {
|
|
26
|
-
import type {
|
|
27
|
-
import type {
|
|
28
|
-
import type {
|
|
29
|
-
import type {
|
|
30
|
-
import type {
|
|
31
|
-
import type {
|
|
32
|
-
import type
|
|
33
|
-
import {
|
|
34
|
-
import { type SigningKeyProvider } from "./signing-keys.js";
|
|
22
|
+
import type { AuthorizeParameters } from "../models/authorization-code.ts";
|
|
23
|
+
import type { AuthenticationContext } from "../models/authentication.ts";
|
|
24
|
+
import type { ClientInterface } from "../models/client.ts";
|
|
25
|
+
import type { Token, TokenResponse } from "../models/token.ts";
|
|
26
|
+
import type { AuthorizationServerMetadata } from "../models/responses.ts";
|
|
27
|
+
import type { AbstractScope, BasicScope } from "../models/scope.ts";
|
|
28
|
+
import type { IsPublicSuffix } from "./redirect-uri.ts";
|
|
29
|
+
import type { DispatchableGrant } from "./grants/grant.ts";
|
|
30
|
+
import type { ClientServiceInterface } from "./services/client.ts";
|
|
31
|
+
import type { TokenServiceInterface } from "./services/token.ts";
|
|
32
|
+
import { ResourceServer, type ResourceServerOptions, type ResourceServerServices } from "./resource-server.ts";
|
|
33
|
+
import { type SigningKeyProvider } from "./signing-keys.ts";
|
|
35
34
|
/** What {@link AuthorizationServer.handleEndSessionRequest} tells the app. */
|
|
36
35
|
export interface EndSessionContext<Client extends ClientInterface> {
|
|
37
36
|
/** The logout request itself. */
|
|
@@ -784,31 +783,31 @@ export declare class AuthorizationServer<Client extends ClientInterface, User, S
|
|
|
784
783
|
* silently forwarding.
|
|
785
784
|
*/
|
|
786
785
|
export declare function localAuthServerFetch<Client extends ClientInterface, User, S extends AbstractScope>(authServer: AuthorizationServer<Client, User, S>): typeof fetch;
|
|
787
|
-
export { AbstractGrant } from "./grants/grant.
|
|
788
|
-
export type { DispatchableGrant, GrantOptions, GrantServices, } from "./grants/grant.
|
|
789
|
-
export { AuthorizationCodeGrant } from "./grants/authorization-code.
|
|
790
|
-
export type { PKCEClientCredentials } from "./grants/authorization-code.
|
|
791
|
-
export type { AuthorizationCodeGrantOptions, AuthorizationCodeGrantServices, GenerateAuthorizationCodeOptions, } from "./grants/authorization-code.
|
|
792
|
-
export { ClientCredentialsGrant } from "./grants/client-credentials.
|
|
793
|
-
export type { ClientCredentialsGrantOptions, ClientCredentialsGrantServices, } from "./grants/client-credentials.
|
|
794
|
-
export { createJwtAccessTokenGenerator, exportSigningKeyJwk, generateSigningKey, importSigningKeyJwk, RotatingSigningKeyProvider, type RotatingSigningKeyProviderOptions, type SigningKey, type SigningKeyProvider, signJwt, StaticSigningKeyProvider, verifyJwt, type VerifyJwtOptions, } from "./signing-keys.
|
|
795
|
-
export { RefreshTokenGrant } from "./grants/refresh-token.
|
|
796
|
-
export type { RefreshTokenGrantOptions, RefreshTokenGrantServices, TokenReuseEvent, } from "./grants/refresh-token.
|
|
797
|
-
export { PasswordGrant } from "./grants/password.
|
|
798
|
-
export type { PasswordGrantOptions, PasswordGrantServices, } from "./grants/password.
|
|
799
|
-
export { DeviceAuthorizationGrant } from "./grants/device-authorization.
|
|
800
|
-
export type { DeviceAuthorizationGrantOptions, DeviceAuthorizationGrantServices, } from "./grants/device-authorization.
|
|
801
|
-
export { AbstractTokenService, type AbstractTokenServiceOptions, type TokenServiceInterface, } from "./services/token.
|
|
802
|
-
export type { ClientServiceInterface } from "./services/client.
|
|
803
|
-
export { AbstractAuthorizationCodeService, type AbstractAuthorizationCodeServiceOptions, type AuthorizationCodeServiceInterface, } from "./services/authorization-code.
|
|
804
|
-
export type { DeviceAuthorizationServiceInterface } from "./services/device-authorization.
|
|
805
|
-
export type { UserServiceInterface } from "./services/user.
|
|
806
|
-
export type { AuthorizationCode, AuthorizeParameters, } from "../models/authorization-code.
|
|
807
|
-
export type { DeviceAuthorization } from "../models/device-authorization.
|
|
808
|
-
export type { AuthorizationServerMetadata, DeviceAuthorizationResponse, ErrorResponse, OAuth2ErrorCode, } from "../models/responses.
|
|
809
|
-
export { challengeMethods, CODE_VERIFIER_MAX_LENGTH, CODE_VERIFIER_MIN_LENGTH, CODE_VERIFIER_PATTERN, generateCodeChallenge, generateCodeVerifier, generateState, getChallengeMethod, validateCodeChallenge, validateCodeVerifier, verifyCodeChallenge, } from "../utils/pkce.
|
|
810
|
-
export type { ChallengeMethod, ChallengeMethods } from "../utils/pkce.
|
|
811
|
-
export { encodeBasicAuth, parseBasicAuth, tryParseBasicAuth, } from "../utils/basic-auth.
|
|
812
|
-
export type { BasicAuth } from "../utils/basic-auth.
|
|
813
|
-
export { checkRedirectUriPattern, isRedirectUriPattern, matchRedirectUri, } from "./redirect-uri.
|
|
814
|
-
export type { IsPublicSuffix, RedirectUriPatternRule, RedirectUriPatternViolation, } from "./redirect-uri.
|
|
786
|
+
export { AbstractGrant } from "./grants/grant.ts";
|
|
787
|
+
export type { DispatchableGrant, GrantOptions, GrantServices, } from "./grants/grant.ts";
|
|
788
|
+
export { AuthorizationCodeGrant } from "./grants/authorization-code.ts";
|
|
789
|
+
export type { PKCEClientCredentials } from "./grants/authorization-code.ts";
|
|
790
|
+
export type { AuthorizationCodeGrantOptions, AuthorizationCodeGrantServices, GenerateAuthorizationCodeOptions, } from "./grants/authorization-code.ts";
|
|
791
|
+
export { ClientCredentialsGrant } from "./grants/client-credentials.ts";
|
|
792
|
+
export type { ClientCredentialsGrantOptions, ClientCredentialsGrantServices, } from "./grants/client-credentials.ts";
|
|
793
|
+
export { createJwtAccessTokenGenerator, exportSigningKeyJwk, generateSigningKey, importSigningKeyJwk, RotatingSigningKeyProvider, type RotatingSigningKeyProviderOptions, type SigningKey, type SigningKeyProvider, signJwt, StaticSigningKeyProvider, verifyJwt, type VerifyJwtOptions, } from "./signing-keys.ts";
|
|
794
|
+
export { RefreshTokenGrant } from "./grants/refresh-token.ts";
|
|
795
|
+
export type { RefreshTokenGrantOptions, RefreshTokenGrantServices, TokenReuseEvent, } from "./grants/refresh-token.ts";
|
|
796
|
+
export { PasswordGrant } from "./grants/password.ts";
|
|
797
|
+
export type { PasswordGrantOptions, PasswordGrantServices, } from "./grants/password.ts";
|
|
798
|
+
export { DeviceAuthorizationGrant } from "./grants/device-authorization.ts";
|
|
799
|
+
export type { DeviceAuthorizationGrantOptions, DeviceAuthorizationGrantServices, } from "./grants/device-authorization.ts";
|
|
800
|
+
export { AbstractTokenService, type AbstractTokenServiceOptions, type TokenServiceInterface, } from "./services/token.ts";
|
|
801
|
+
export type { ClientServiceInterface } from "./services/client.ts";
|
|
802
|
+
export { AbstractAuthorizationCodeService, type AbstractAuthorizationCodeServiceOptions, type AuthorizationCodeServiceInterface, } from "./services/authorization-code.ts";
|
|
803
|
+
export type { DeviceAuthorizationServiceInterface } from "./services/device-authorization.ts";
|
|
804
|
+
export type { UserServiceInterface } from "./services/user.ts";
|
|
805
|
+
export type { AuthorizationCode, AuthorizeParameters, } from "../models/authorization-code.ts";
|
|
806
|
+
export type { DeviceAuthorization } from "../models/device-authorization.ts";
|
|
807
|
+
export type { AuthorizationServerMetadata, DeviceAuthorizationResponse, ErrorResponse, OAuth2ErrorCode, } from "../models/responses.ts";
|
|
808
|
+
export { challengeMethods, CODE_VERIFIER_MAX_LENGTH, CODE_VERIFIER_MIN_LENGTH, CODE_VERIFIER_PATTERN, generateCodeChallenge, generateCodeVerifier, generateState, getChallengeMethod, validateCodeChallenge, validateCodeVerifier, verifyCodeChallenge, } from "../utils/pkce.ts";
|
|
809
|
+
export type { ChallengeMethod, ChallengeMethods } from "../utils/pkce.ts";
|
|
810
|
+
export { encodeBasicAuth, parseBasicAuth, tryParseBasicAuth, } from "../utils/basic-auth.ts";
|
|
811
|
+
export type { BasicAuth } from "../utils/basic-auth.ts";
|
|
812
|
+
export { checkRedirectUriPattern, isRedirectUriPattern, matchRedirectUri, } from "./redirect-uri.ts";
|
|
813
|
+
export type { IsPublicSuffix, RedirectUriPatternRule, RedirectUriPatternViolation, } from "./redirect-uri.ts";
|
|
@@ -19,7 +19,6 @@
|
|
|
19
19
|
* @see https://datatracker.ietf.org/doc/html/rfc6749
|
|
20
20
|
* @module
|
|
21
21
|
*/
|
|
22
|
-
import "../_dnt.polyfills.js";
|
|
23
22
|
import { snapshotAuthenticationContext } from "../utils/authentication-context.js";
|
|
24
23
|
import { AccessDeniedError, InvalidRequestError, InvalidTokenError, isOAuth2Error, OAuth2Error, ServerError, UnauthorizedClientError, UnsupportedGrantTypeError, UnsupportedResponseTypeError, } from "../errors.js";
|
|
25
24
|
import { authenticateClientCredentials, extractClientCredentials, } from "./client-authentication.js";
|
|
@@ -119,8 +118,7 @@ const AUTHORIZATION_CODE_GRANT_TYPE = "authorization_code";
|
|
|
119
118
|
* }
|
|
120
119
|
* ```
|
|
121
120
|
*/
|
|
122
|
-
export const ENDPOINT_PATHS = Object
|
|
123
|
-
.fromEntries(ENDPOINT_ENTRIES.map(([key, { path }]) => [key, path]));
|
|
121
|
+
export const ENDPOINT_PATHS = Object.fromEntries(ENDPOINT_ENTRIES.map(([key, { path }]) => [key, path]));
|
|
124
122
|
/**
|
|
125
123
|
* The HTTP methods each endpoint in {@link ENDPOINT_PATHS} answers — `POST` for
|
|
126
124
|
* the token-style endpoints, `GET` for authorize/JWKS/discovery, both for
|
|
@@ -261,8 +259,8 @@ export class AuthorizationServer extends ResourceServer {
|
|
|
261
259
|
const { issuer } = context;
|
|
262
260
|
const endpoints = {};
|
|
263
261
|
for (const [key, { option, path }] of ADVERTISED_ENTRIES) {
|
|
264
|
-
endpoints[key] =
|
|
265
|
-
(issuer ? `${issuer}${path}` : undefined);
|
|
262
|
+
endpoints[key] =
|
|
263
|
+
context[option] ?? (issuer ? `${issuer}${path}` : undefined);
|
|
266
264
|
}
|
|
267
265
|
return endpoints;
|
|
268
266
|
}
|
|
@@ -310,7 +308,7 @@ export class AuthorizationServer extends ResourceServer {
|
|
|
310
308
|
headers: {
|
|
311
309
|
"Content-Type": "application/json;charset=UTF-8",
|
|
312
310
|
"Cache-Control": "no-store",
|
|
313
|
-
|
|
311
|
+
Pragma: "no-cache",
|
|
314
312
|
},
|
|
315
313
|
});
|
|
316
314
|
}
|
|
@@ -380,8 +378,7 @@ export class AuthorizationServer extends ResourceServer {
|
|
|
380
378
|
this.#assertSingletonParameters(body, parameters);
|
|
381
379
|
}
|
|
382
380
|
async #readBody(request, options = {}) {
|
|
383
|
-
const bytes = await readBoundedBody(request, this.#maxBodyBytes, options)
|
|
384
|
-
.catch((cause) => {
|
|
381
|
+
const bytes = await readBoundedBody(request, this.#maxBodyBytes, options).catch((cause) => {
|
|
385
382
|
throw new InvalidRequestError("request body could not be read", {
|
|
386
383
|
cause,
|
|
387
384
|
});
|
|
@@ -402,7 +399,9 @@ export class AuthorizationServer extends ResourceServer {
|
|
|
402
399
|
const bytes = await this.#readBody(request, { keepReadable: true });
|
|
403
400
|
const body = await new Response(bytes, {
|
|
404
401
|
headers: { "content-type": contentType },
|
|
405
|
-
})
|
|
402
|
+
})
|
|
403
|
+
.formData()
|
|
404
|
+
.catch(() => {
|
|
406
405
|
throw new InvalidRequestError("body must be application/x-www-form-urlencoded");
|
|
407
406
|
});
|
|
408
407
|
this.#assertSingletonParameters(body, ["client_id", "client_secret"]);
|
|
@@ -432,8 +431,7 @@ export class AuthorizationServer extends ResourceServer {
|
|
|
432
431
|
*/
|
|
433
432
|
async handleTokenRequest(request) {
|
|
434
433
|
try {
|
|
435
|
-
const { context, body, client, grant } = await this
|
|
436
|
-
.#beginClientAuthenticatedRequest(request, {
|
|
434
|
+
const { context, body, client, grant } = await this.#beginClientAuthenticatedRequest(request, {
|
|
437
435
|
grantFromBody: (body) => this.#grantFromBody(body),
|
|
438
436
|
validateBody: (body) => this.#assertTokenSingletonParameters(body),
|
|
439
437
|
});
|
|
@@ -473,7 +471,7 @@ export class AuthorizationServer extends ResourceServer {
|
|
|
473
471
|
}
|
|
474
472
|
async #oidcClaims(user, scope, authenticationContext) {
|
|
475
473
|
return {
|
|
476
|
-
...(await this.#userClaims?.(user, scope, snapshotAuthenticationContext(authenticationContext)) ?? {}),
|
|
474
|
+
...((await this.#userClaims?.(user, scope, snapshotAuthenticationContext(authenticationContext))) ?? {}),
|
|
477
475
|
sub: this.#subjectOf(user),
|
|
478
476
|
};
|
|
479
477
|
}
|
|
@@ -609,12 +607,12 @@ export class AuthorizationServer extends ResourceServer {
|
|
|
609
607
|
try {
|
|
610
608
|
const params = await this.#endSessionParameters(request);
|
|
611
609
|
const client = await this.#resolveEndSessionClient(request, params);
|
|
612
|
-
const result = await endSession({
|
|
610
|
+
const result = (await endSession({
|
|
613
611
|
request,
|
|
614
612
|
client,
|
|
615
613
|
subject: params.subject,
|
|
616
614
|
logoutHint: params.logoutHint,
|
|
617
|
-
}) ?? {};
|
|
615
|
+
})) ?? {};
|
|
618
616
|
const headers = new Headers(result.refused ? undefined : result.headers);
|
|
619
617
|
const authorized = result.refused
|
|
620
618
|
? undefined
|
|
@@ -638,7 +636,9 @@ export class AuthorizationServer extends ResourceServer {
|
|
|
638
636
|
const idTokenHint = params.get("id_token_hint");
|
|
639
637
|
const hint = idTokenHint ? await this.#readIdTokenHint(idTokenHint) : null;
|
|
640
638
|
const clientId = params.get("client_id");
|
|
641
|
-
if (clientId &&
|
|
639
|
+
if (clientId &&
|
|
640
|
+
hint &&
|
|
641
|
+
hint.audiences.length > 0 &&
|
|
642
642
|
!hint.audiences.includes(clientId)) {
|
|
643
643
|
throw new InvalidRequestError("client_id does not match the audience of id_token_hint");
|
|
644
644
|
}
|
|
@@ -675,7 +675,7 @@ export class AuthorizationServer extends ResourceServer {
|
|
|
675
675
|
return null;
|
|
676
676
|
const { services } = await this.authorizationContext(request);
|
|
677
677
|
try {
|
|
678
|
-
return await services.clientService.get(params.clientId) ?? null;
|
|
678
|
+
return (await services.clientService.get(params.clientId)) ?? null;
|
|
679
679
|
}
|
|
680
680
|
catch {
|
|
681
681
|
return null;
|
|
@@ -802,8 +802,7 @@ export class AuthorizationServer extends ResourceServer {
|
|
|
802
802
|
const { searchParams } = redirectUrl;
|
|
803
803
|
searchParams.set("error", error.extensions.error ?? "server_error");
|
|
804
804
|
// Use exposedMessage, never raw error.message, so 5xx server_error detail isn't leaked into the redirect.
|
|
805
|
-
const description = error.extensions.error_description ??
|
|
806
|
-
error.exposedMessage;
|
|
805
|
+
const description = error.extensions.error_description ?? error.exposedMessage;
|
|
807
806
|
if (description) {
|
|
808
807
|
searchParams.set("error_description", description);
|
|
809
808
|
}
|
|
@@ -884,8 +883,7 @@ export class AuthorizationServer extends ResourceServer {
|
|
|
884
883
|
const { grant, client, user, requestedScope, authorizedScope, services, handleConsent, } = options;
|
|
885
884
|
const acceptedScope = await grant.acceptedScope(client, user, requestedScope, services.tokenService);
|
|
886
885
|
let scope = acceptedScope ?? undefined;
|
|
887
|
-
const needsConsent = scope !== undefined &&
|
|
888
|
-
!(authorizedScope && authorizedScope.has(scope));
|
|
886
|
+
const needsConsent = scope !== undefined && !(authorizedScope && authorizedScope.has(scope));
|
|
889
887
|
if (needsConsent && handleConsent) {
|
|
890
888
|
const consent = await handleConsent(client, scope, user);
|
|
891
889
|
if (consent instanceof Response)
|
|
@@ -940,12 +938,8 @@ export class AuthorizationServer extends ResourceServer {
|
|
|
940
938
|
*/
|
|
941
939
|
async handleRevocationRequest(request) {
|
|
942
940
|
try {
|
|
943
|
-
const { context, body, client } = await this
|
|
944
|
-
.#
|
|
945
|
-
validateBody: (body) => this.#assertSingletonParameters(body, [
|
|
946
|
-
"token",
|
|
947
|
-
"token_type_hint",
|
|
948
|
-
]),
|
|
941
|
+
const { context, body, client } = await this.#beginClientAuthenticatedRequest(request, {
|
|
942
|
+
validateBody: (body) => this.#assertSingletonParameters(body, ["token", "token_type_hint"]),
|
|
949
943
|
});
|
|
950
944
|
const token = body.get("token");
|
|
951
945
|
if (typeof token !== "string") {
|
|
@@ -1027,12 +1021,8 @@ export class AuthorizationServer extends ResourceServer {
|
|
|
1027
1021
|
*/
|
|
1028
1022
|
async handleIntrospectionRequest(request) {
|
|
1029
1023
|
try {
|
|
1030
|
-
const { context, body, client } = await this
|
|
1031
|
-
.#
|
|
1032
|
-
validateBody: (body) => this.#assertSingletonParameters(body, [
|
|
1033
|
-
"token",
|
|
1034
|
-
"token_type_hint",
|
|
1035
|
-
]),
|
|
1024
|
+
const { context, body, client } = await this.#beginClientAuthenticatedRequest(request, {
|
|
1025
|
+
validateBody: (body) => this.#assertSingletonParameters(body, ["token", "token_type_hint"]),
|
|
1036
1026
|
});
|
|
1037
1027
|
const tokenValue = body.get("token");
|
|
1038
1028
|
if (typeof tokenValue !== "string") {
|
|
@@ -1044,9 +1034,10 @@ export class AuthorizationServer extends ResourceServer {
|
|
|
1044
1034
|
let response;
|
|
1045
1035
|
const resolved = await this.#resolveToken(tokenService, tokenValue, hint);
|
|
1046
1036
|
const expiresAt = resolved && this.#introspectedExpiry(resolved);
|
|
1047
|
-
if (!resolved ||
|
|
1037
|
+
if (!resolved ||
|
|
1038
|
+
(expiresAt && expiresAt < new Date()) ||
|
|
1048
1039
|
(this.#canIntrospectToken &&
|
|
1049
|
-
await this.#canIntrospectToken(client, resolved.token, resolved.tokenType) !== true)) {
|
|
1040
|
+
(await this.#canIntrospectToken(client, resolved.token, resolved.tokenType)) !== true)) {
|
|
1050
1041
|
response = { active: false };
|
|
1051
1042
|
}
|
|
1052
1043
|
else {
|
|
@@ -1088,7 +1079,7 @@ export class AuthorizationServer extends ResourceServer {
|
|
|
1088
1079
|
headers: {
|
|
1089
1080
|
"Content-Type": "application/json;charset=UTF-8",
|
|
1090
1081
|
"Cache-Control": "no-store",
|
|
1091
|
-
|
|
1082
|
+
Pragma: "no-cache",
|
|
1092
1083
|
},
|
|
1093
1084
|
});
|
|
1094
1085
|
}
|
|
@@ -1221,16 +1212,13 @@ export class AuthorizationServer extends ResourceServer {
|
|
|
1221
1212
|
*/
|
|
1222
1213
|
async handleDeviceAuthorizationRequest(request) {
|
|
1223
1214
|
try {
|
|
1224
|
-
const { context, body, client } = await this
|
|
1225
|
-
.#beginClientAuthenticatedRequest(request, {
|
|
1215
|
+
const { context, body, client } = await this.#beginClientAuthenticatedRequest(request, {
|
|
1226
1216
|
requiredGrantType: DEVICE_AUTHORIZATION_GRANT_TYPE,
|
|
1227
1217
|
validateBody: (body) => this.#assertSingletonParameters(body, ["scope"]),
|
|
1228
1218
|
});
|
|
1229
1219
|
const grant = this.#deviceAuthorizationGrant();
|
|
1230
1220
|
const scopeText = body.get("scope");
|
|
1231
|
-
const scope = typeof scopeText === "string"
|
|
1232
|
-
? grant.parseScope(scopeText)
|
|
1233
|
-
: undefined;
|
|
1221
|
+
const scope = typeof scopeText === "string" ? grant.parseScope(scopeText) : undefined;
|
|
1234
1222
|
// RFC 8628 §3.2 requires a verification_uri the user can visit.
|
|
1235
1223
|
if (!context.verificationUri) {
|
|
1236
1224
|
throw new ServerError("verificationUri must be configured for the device authorization " +
|
|
@@ -1249,7 +1237,7 @@ export class AuthorizationServer extends ResourceServer {
|
|
|
1249
1237
|
headers: {
|
|
1250
1238
|
"Content-Type": "application/json;charset=UTF-8",
|
|
1251
1239
|
"Cache-Control": "no-store",
|
|
1252
|
-
|
|
1240
|
+
Pragma: "no-cache",
|
|
1253
1241
|
},
|
|
1254
1242
|
});
|
|
1255
1243
|
}
|
|
@@ -1292,7 +1280,9 @@ export class AuthorizationServer extends ResourceServer {
|
|
|
1292
1280
|
export function localAuthServerFetch(authServer) {
|
|
1293
1281
|
return async (input, init) => {
|
|
1294
1282
|
const request = input instanceof Request
|
|
1295
|
-
?
|
|
1283
|
+
? init
|
|
1284
|
+
? new Request(input, init)
|
|
1285
|
+
: input
|
|
1296
1286
|
: new Request(String(input), init);
|
|
1297
1287
|
const url = new URL(request.url);
|
|
1298
1288
|
const path = url.pathname;
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
* @see https://datatracker.ietf.org/doc/html/rfc6749#section-2.3
|
|
7
7
|
* @module
|
|
8
8
|
*/
|
|
9
|
-
import type { ClientCredentials, ClientInterface } from "../models/client.
|
|
10
|
-
import type { ClientServiceInterface } from "./services/client.
|
|
9
|
+
import type { ClientCredentials, ClientInterface } from "../models/client.ts";
|
|
10
|
+
import type { ClientServiceInterface } from "./services/client.ts";
|
|
11
11
|
/**
|
|
12
12
|
* Reads the credentials a request presents: HTTP Basic first (RFC 6749 Section
|
|
13
13
|
* 2.3.1), then `client_id`/`client_secret` in `body`, the form body the
|
|
@@ -3,15 +3,15 @@
|
|
|
3
3
|
* RFC 6749 Section 4.1 and RFC 7636.
|
|
4
4
|
* @module
|
|
5
5
|
*/
|
|
6
|
-
import type { AuthorizationCode } from "../../models/authorization-code.
|
|
7
|
-
import type { AuthenticationContext } from "../../models/authentication.
|
|
8
|
-
import type { ClientCredentials, ClientInterface } from "../../models/client.
|
|
9
|
-
import type { Token } from "../../models/token.
|
|
10
|
-
import type { AbstractScope, BasicScope } from "../../models/scope.
|
|
11
|
-
import type { ChallengeMethod, ChallengeMethods } from "../../utils/pkce.
|
|
12
|
-
import type { ClientServiceInterface } from "../services/client.
|
|
13
|
-
import type { AuthorizationCodeServiceInterface } from "../services/authorization-code.
|
|
14
|
-
import { AbstractGrant, type GrantOptions, type GrantServices } from "./grant.
|
|
6
|
+
import type { AuthorizationCode } from "../../models/authorization-code.ts";
|
|
7
|
+
import type { AuthenticationContext } from "../../models/authentication.ts";
|
|
8
|
+
import type { ClientCredentials, ClientInterface } from "../../models/client.ts";
|
|
9
|
+
import type { Token } from "../../models/token.ts";
|
|
10
|
+
import type { AbstractScope, BasicScope } from "../../models/scope.ts";
|
|
11
|
+
import type { ChallengeMethod, ChallengeMethods } from "../../utils/pkce.ts";
|
|
12
|
+
import type { ClientServiceInterface } from "../services/client.ts";
|
|
13
|
+
import type { AuthorizationCodeServiceInterface } from "../services/authorization-code.ts";
|
|
14
|
+
import { AbstractGrant, type GrantOptions, type GrantServices } from "./grant.ts";
|
|
15
15
|
/** Services required by the authorization code grant. */
|
|
16
16
|
export interface AuthorizationCodeGrantServices<Client extends ClientInterface, User, S extends AbstractScope> extends GrantServices<Client, User, S> {
|
|
17
17
|
/** Generates, stores, and looks up authorization codes for the exchange. */
|
|
@@ -45,8 +45,8 @@ export class AuthorizationCodeGrant extends AbstractGrant {
|
|
|
45
45
|
});
|
|
46
46
|
this.challengeMethods = options.challengeMethods ?? defaultChallengeMethods;
|
|
47
47
|
this.requirePKCE = options.requirePKCE ?? true;
|
|
48
|
-
this.requireClientAuthentication =
|
|
49
|
-
true;
|
|
48
|
+
this.requireClientAuthentication =
|
|
49
|
+
options.requireClientAuthentication ?? true;
|
|
50
50
|
}
|
|
51
51
|
/**
|
|
52
52
|
* Extracts client credentials from a request, carrying the PKCE
|
|
@@ -178,8 +178,7 @@ export class AuthorizationCodeGrant extends AbstractGrant {
|
|
|
178
178
|
* @see https://datatracker.ietf.org/doc/html/rfc7636#section-4.5
|
|
179
179
|
*/
|
|
180
180
|
async token(request, client, body) {
|
|
181
|
-
const { authorizationCodeService, tokenService } = await this
|
|
182
|
-
.resolveServices(request);
|
|
181
|
+
const { authorizationCodeService, tokenService } = await this.resolveServices(request);
|
|
183
182
|
const code = body.get("code");
|
|
184
183
|
if (typeof code !== "string") {
|
|
185
184
|
throw new InvalidRequestError("code parameter required");
|
|
@@ -192,7 +191,7 @@ export class AuthorizationCodeGrant extends AbstractGrant {
|
|
|
192
191
|
if (!authorizationCode || authorizationCode.expiresAt < new Date()) {
|
|
193
192
|
throw new InvalidGrantError("invalid code");
|
|
194
193
|
}
|
|
195
|
-
if (!await authorizationCodeService.revoke(authorizationCode)) {
|
|
194
|
+
if (!(await authorizationCodeService.revoke(authorizationCode))) {
|
|
196
195
|
throw new InvalidGrantError("code already used");
|
|
197
196
|
}
|
|
198
197
|
const codeVerifier = body.get("code_verifier");
|
|
@@ -200,7 +199,7 @@ export class AuthorizationCodeGrant extends AbstractGrant {
|
|
|
200
199
|
if (!validateCodeVerifier(codeVerifier)) {
|
|
201
200
|
throw new InvalidRequestError("code_verifier must be 43-128 characters using [A-Z] / [a-z] / [0-9] / - / . / _ / ~");
|
|
202
201
|
}
|
|
203
|
-
if (!await this.verifyCode(authorizationCode, codeVerifier)) {
|
|
202
|
+
if (!(await this.verifyCode(authorizationCode, codeVerifier))) {
|
|
204
203
|
throw new InvalidGrantError("code_verifier verification failed");
|
|
205
204
|
}
|
|
206
205
|
}
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
* RFC 6749 Section 4.4.
|
|
4
4
|
* @module
|
|
5
5
|
*/
|
|
6
|
-
import type { ClientInterface } from "../../models/client.
|
|
7
|
-
import type { Token } from "../../models/token.
|
|
8
|
-
import type { AbstractScope, BasicScope } from "../../models/scope.
|
|
9
|
-
import { AbstractGrant, type GrantOptions, type GrantServices } from "./grant.
|
|
6
|
+
import type { ClientInterface } from "../../models/client.ts";
|
|
7
|
+
import type { Token } from "../../models/token.ts";
|
|
8
|
+
import type { AbstractScope, BasicScope } from "../../models/scope.ts";
|
|
9
|
+
import { AbstractGrant, type GrantOptions, type GrantServices } from "./grant.ts";
|
|
10
10
|
/** Services required by the client credentials grant. */
|
|
11
11
|
export type ClientCredentialsGrantServices<Client extends ClientInterface, User, S extends AbstractScope> = GrantServices<Client, User, S>;
|
|
12
12
|
/**
|