@udibo/oauth2 0.14.1 → 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 +8 -8
- package/{esm → dist}/adapters/hono/bff/bff.js +31 -26
- 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
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal constant-time byte comparison for modules that also run in
|
|
3
|
+
* browsers, where `node:crypto` is unavailable.
|
|
4
|
+
*
|
|
5
|
+
* @module
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Compares two byte arrays without an early exit on the first differing byte.
|
|
9
|
+
* Returns `false` immediately when the lengths differ, so the length is not
|
|
10
|
+
* secret.
|
|
11
|
+
*/
|
|
12
|
+
export function constantTimeEqual(a, b) {
|
|
13
|
+
if (a.byteLength !== b.byteLength)
|
|
14
|
+
return false;
|
|
15
|
+
let difference = 0;
|
|
16
|
+
for (let i = 0; i < a.byteLength; i++)
|
|
17
|
+
difference |= a[i] ^ b[i];
|
|
18
|
+
return difference === 0;
|
|
19
|
+
}
|
|
@@ -84,7 +84,10 @@ async function fetchOnOwnConnection(createHttpClient, input, init) {
|
|
|
84
84
|
}
|
|
85
85
|
function watchBody(response, onError) {
|
|
86
86
|
const { body: source, status } = response;
|
|
87
|
-
if (!source ||
|
|
87
|
+
if (!source ||
|
|
88
|
+
status < 200 ||
|
|
89
|
+
status > 599 ||
|
|
90
|
+
NULL_BODY_STATUSES.has(status)) {
|
|
88
91
|
return response;
|
|
89
92
|
}
|
|
90
93
|
const reader = source.getReader();
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal cancellable sleep shared by the client and the identity service.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Resolves after `ms` milliseconds. When `signal` aborts first, rejects with
|
|
8
|
+
* the signal's reason and clears the timer. Uses the global `setTimeout`, so
|
|
9
|
+
* fake timers control it.
|
|
10
|
+
*/
|
|
11
|
+
export declare function delay(ms: number, options?: {
|
|
12
|
+
signal?: AbortSignal;
|
|
13
|
+
}): Promise<void>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal cancellable sleep shared by the client and the identity service.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Resolves after `ms` milliseconds. When `signal` aborts first, rejects with
|
|
8
|
+
* the signal's reason and clears the timer. Uses the global `setTimeout`, so
|
|
9
|
+
* fake timers control it.
|
|
10
|
+
*/
|
|
11
|
+
export function delay(ms, options = {}) {
|
|
12
|
+
const { signal } = options;
|
|
13
|
+
return new Promise((resolve, reject) => {
|
|
14
|
+
if (signal?.aborted) {
|
|
15
|
+
reject(signal.reason);
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
const onAbort = () => {
|
|
19
|
+
clearTimeout(timer);
|
|
20
|
+
reject(signal?.reason);
|
|
21
|
+
};
|
|
22
|
+
const timer = setTimeout(() => {
|
|
23
|
+
signal?.removeEventListener("abort", onAbort);
|
|
24
|
+
resolve();
|
|
25
|
+
}, ms);
|
|
26
|
+
signal?.addEventListener("abort", onAbort, { once: true });
|
|
27
|
+
});
|
|
28
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal binary-to-text codecs shared by the modules that run in both
|
|
3
|
+
* browsers and servers.
|
|
4
|
+
*
|
|
5
|
+
* @module
|
|
6
|
+
*/
|
|
7
|
+
/** Lowercase hexadecimal encoding of `bytes`. */
|
|
8
|
+
export declare function encodeHex(bytes: Uint8Array | ArrayBuffer): string;
|
|
9
|
+
/** Standard-alphabet base64 with `=` padding. */
|
|
10
|
+
export declare function encodeBase64(bytes: Uint8Array): string;
|
|
11
|
+
/**
|
|
12
|
+
* Decodes standard-alphabet base64, padded or not.
|
|
13
|
+
*
|
|
14
|
+
* @throws {TypeError} on a character outside the alphabet.
|
|
15
|
+
* @throws {RangeError} on a length that leaves a remainder of 1 when divided
|
|
16
|
+
* by 4.
|
|
17
|
+
*/
|
|
18
|
+
export declare function decodeBase64(input: string): Uint8Array;
|
|
19
|
+
/** URL-safe base64 without padding. */
|
|
20
|
+
export declare function encodeBase64Url(bytes: Uint8Array): string;
|
|
21
|
+
/**
|
|
22
|
+
* Decodes URL-safe base64, padded or not.
|
|
23
|
+
*
|
|
24
|
+
* @throws {TypeError} on a character outside the alphabet.
|
|
25
|
+
* @throws {RangeError} on a length that leaves a remainder of 1 when divided
|
|
26
|
+
* by 4.
|
|
27
|
+
*/
|
|
28
|
+
export declare function decodeBase64Url(input: string): Uint8Array;
|
|
29
|
+
/** RFC 4648 base32 with `=` padding. */
|
|
30
|
+
export declare function encodeBase32(bytes: Uint8Array): string;
|
|
31
|
+
/**
|
|
32
|
+
* Decodes RFC 4648 base32. The input length must be a multiple of 8,
|
|
33
|
+
* counting padding.
|
|
34
|
+
*
|
|
35
|
+
* @throws {TypeError} on a character outside the alphabet or an unpadded
|
|
36
|
+
* length.
|
|
37
|
+
* @throws {RangeError} on a length no encoding can produce.
|
|
38
|
+
*/
|
|
39
|
+
export declare function decodeBase32(input: string): Uint8Array;
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal binary-to-text codecs shared by the modules that run in both
|
|
3
|
+
* browsers and servers.
|
|
4
|
+
*
|
|
5
|
+
* @module
|
|
6
|
+
*/
|
|
7
|
+
const BASE64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
8
|
+
const BASE64URL = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";
|
|
9
|
+
const BASE32 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";
|
|
10
|
+
const lookup = (alphabet) => new Map([...alphabet].map((char, index) => [char, index]));
|
|
11
|
+
const BASE64_LOOKUP = lookup(BASE64);
|
|
12
|
+
const BASE64URL_LOOKUP = lookup(BASE64URL);
|
|
13
|
+
const BASE32_LOOKUP = lookup(BASE32);
|
|
14
|
+
const HEX = Array.from({ length: 256 }, (_, byte) => byte.toString(16).padStart(2, "0"));
|
|
15
|
+
/** Lowercase hexadecimal encoding of `bytes`. */
|
|
16
|
+
export function encodeHex(bytes) {
|
|
17
|
+
const view = bytes instanceof Uint8Array ? bytes : new Uint8Array(bytes);
|
|
18
|
+
let out = "";
|
|
19
|
+
for (const byte of view)
|
|
20
|
+
out += HEX[byte];
|
|
21
|
+
return out;
|
|
22
|
+
}
|
|
23
|
+
function encodeBits(bytes, alphabet, bitsPerChar) {
|
|
24
|
+
let out = "";
|
|
25
|
+
let buffer = 0;
|
|
26
|
+
let bits = 0;
|
|
27
|
+
const mask = (1 << bitsPerChar) - 1;
|
|
28
|
+
for (const byte of bytes) {
|
|
29
|
+
buffer = (buffer << 8) | byte;
|
|
30
|
+
bits += 8;
|
|
31
|
+
while (bits >= bitsPerChar) {
|
|
32
|
+
bits -= bitsPerChar;
|
|
33
|
+
out += alphabet[(buffer >> bits) & mask];
|
|
34
|
+
}
|
|
35
|
+
buffer &= (1 << bits) - 1;
|
|
36
|
+
}
|
|
37
|
+
if (bits > 0)
|
|
38
|
+
out += alphabet[(buffer << (bitsPerChar - bits)) & mask];
|
|
39
|
+
return out;
|
|
40
|
+
}
|
|
41
|
+
function pad(encoded, multiple) {
|
|
42
|
+
return (encoded + "=".repeat((multiple - (encoded.length % multiple)) % multiple));
|
|
43
|
+
}
|
|
44
|
+
function decodeBits(input, table, bitsPerChar, name, paddingWindow, invalidRemainders) {
|
|
45
|
+
let text = input;
|
|
46
|
+
for (let x = Math.max(0, text.length - paddingWindow); x < text.length; ++x) {
|
|
47
|
+
if (text[x] === "=") {
|
|
48
|
+
for (let y = x + 1; y < text.length; ++y) {
|
|
49
|
+
if (text[y] !== "=") {
|
|
50
|
+
throw new TypeError(`Cannot decode input as ${name}: Invalid character (${text[y]})`);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
text = text.slice(0, x);
|
|
54
|
+
break;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
const modulus = name === "base32" ? 8 : 4;
|
|
58
|
+
if (invalidRemainders.includes(text.length % modulus)) {
|
|
59
|
+
throw new RangeError(`Cannot decode input as ${name}: Length (${text.length}), excluding ` +
|
|
60
|
+
`padding, must not have a remainder of ${invalidRemainders.join(", ")} when divided by ${modulus}`);
|
|
61
|
+
}
|
|
62
|
+
const out = new Uint8Array(Math.floor((text.length * bitsPerChar) / 8));
|
|
63
|
+
let buffer = 0;
|
|
64
|
+
let bits = 0;
|
|
65
|
+
let index = 0;
|
|
66
|
+
for (const char of text) {
|
|
67
|
+
const value = table.get(char);
|
|
68
|
+
if (value === undefined) {
|
|
69
|
+
throw new TypeError(`Cannot decode input as ${name}: Invalid character (${char})`);
|
|
70
|
+
}
|
|
71
|
+
buffer = (buffer << bitsPerChar) | value;
|
|
72
|
+
bits += bitsPerChar;
|
|
73
|
+
if (bits >= 8) {
|
|
74
|
+
bits -= 8;
|
|
75
|
+
out[index++] = (buffer >> bits) & 0xff;
|
|
76
|
+
buffer &= (1 << bits) - 1;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return out;
|
|
80
|
+
}
|
|
81
|
+
/** Standard-alphabet base64 with `=` padding. */
|
|
82
|
+
export function encodeBase64(bytes) {
|
|
83
|
+
return pad(encodeBits(bytes, BASE64, 6), 4);
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Decodes standard-alphabet base64, padded or not.
|
|
87
|
+
*
|
|
88
|
+
* @throws {TypeError} on a character outside the alphabet.
|
|
89
|
+
* @throws {RangeError} on a length that leaves a remainder of 1 when divided
|
|
90
|
+
* by 4.
|
|
91
|
+
*/
|
|
92
|
+
export function decodeBase64(input) {
|
|
93
|
+
return decodeBits(input, BASE64_LOOKUP, 6, "base64", 2, [1]);
|
|
94
|
+
}
|
|
95
|
+
/** URL-safe base64 without padding. */
|
|
96
|
+
export function encodeBase64Url(bytes) {
|
|
97
|
+
return encodeBits(bytes, BASE64URL, 6);
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Decodes URL-safe base64, padded or not.
|
|
101
|
+
*
|
|
102
|
+
* @throws {TypeError} on a character outside the alphabet.
|
|
103
|
+
* @throws {RangeError} on a length that leaves a remainder of 1 when divided
|
|
104
|
+
* by 4.
|
|
105
|
+
*/
|
|
106
|
+
export function decodeBase64Url(input) {
|
|
107
|
+
return decodeBits(input, BASE64URL_LOOKUP, 6, "base64", 2, [1]);
|
|
108
|
+
}
|
|
109
|
+
/** RFC 4648 base32 with `=` padding. */
|
|
110
|
+
export function encodeBase32(bytes) {
|
|
111
|
+
return pad(encodeBits(bytes, BASE32, 5), 8);
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Decodes RFC 4648 base32. The input length must be a multiple of 8,
|
|
115
|
+
* counting padding.
|
|
116
|
+
*
|
|
117
|
+
* @throws {TypeError} on a character outside the alphabet or an unpadded
|
|
118
|
+
* length.
|
|
119
|
+
* @throws {RangeError} on a length no encoding can produce.
|
|
120
|
+
*/
|
|
121
|
+
export function decodeBase32(input) {
|
|
122
|
+
if (input.length % 8 !== 0) {
|
|
123
|
+
throw new TypeError(`Invalid base32 string: length (${input.length}) must be a multiple of 8`);
|
|
124
|
+
}
|
|
125
|
+
return decodeBits(input, BASE32_LOOKUP, 5, "base32", 6, [1, 3, 6]);
|
|
126
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { AuthenticationContext } from "../models/authentication.
|
|
1
|
+
import type { AuthenticationContext } from "../models/authentication.ts";
|
|
2
2
|
/** Copies verified event claims without sharing mutable method arrays. */
|
|
3
3
|
export declare function snapshotAuthenticationContext(context: AuthenticationContext | undefined): AuthenticationContext | undefined;
|
|
@@ -22,9 +22,8 @@
|
|
|
22
22
|
*
|
|
23
23
|
* @module
|
|
24
24
|
*/
|
|
25
|
-
import "../
|
|
26
|
-
import {
|
|
27
|
-
import { toArrayBuffer } from "./_buffer.js";
|
|
25
|
+
import { sha256Hash } from "../server/utils/hash.ts";
|
|
26
|
+
import { toArrayBuffer } from "./_buffer.ts";
|
|
28
27
|
export { sha256Hash };
|
|
29
28
|
export { toArrayBuffer };
|
|
30
29
|
/** Constant-time string equality (length difference short-circuits to false). */
|
|
@@ -22,11 +22,10 @@
|
|
|
22
22
|
*
|
|
23
23
|
* @module
|
|
24
24
|
*/
|
|
25
|
-
import "../_dnt.polyfills.js";
|
|
26
|
-
import { timingSafeEqual } from "../deps/jsr.io/@std/crypto/1.1.0/timing_safe_equal.js";
|
|
27
|
-
import { decodeBase64Url, encodeBase64Url } from "../deps/jsr.io/@std/encoding/1.0.11/base64url.js";
|
|
28
25
|
import { sha256Hash } from "../server/utils/hash.js";
|
|
29
26
|
import { toArrayBuffer } from "./_buffer.js";
|
|
27
|
+
import { constantTimeEqual } from "./_constant-time.js";
|
|
28
|
+
import { decodeBase64Url, encodeBase64Url } from "./_encoding.js";
|
|
30
29
|
export { sha256Hash };
|
|
31
30
|
export { toArrayBuffer };
|
|
32
31
|
function toBytes(secret) {
|
|
@@ -39,7 +38,7 @@ export function timingSafeEqualString(a, b) {
|
|
|
39
38
|
const bBytes = encoder.encode(b);
|
|
40
39
|
if (aBytes.byteLength !== bBytes.byteLength)
|
|
41
40
|
return false;
|
|
42
|
-
return
|
|
41
|
+
return constantTimeEqual(aBytes, bBytes);
|
|
43
42
|
}
|
|
44
43
|
/** URL-safe base64 encode (no padding). */
|
|
45
44
|
export function base64urlEncode(bytes) {
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* @see https://datatracker.ietf.org/doc/html/rfc7636
|
|
7
7
|
* @module
|
|
8
8
|
*/
|
|
9
|
-
import { encodeBase64Url } from "
|
|
9
|
+
import { encodeBase64Url } from "./_encoding.js";
|
|
10
10
|
/**
|
|
11
11
|
* Minimum length for code verifier per RFC 7636 Section 4.1.
|
|
12
12
|
* @see https://datatracker.ietf.org/doc/html/rfc7636#section-4.1
|
|
@@ -15,7 +15,7 @@ export const PROVIDER_TEXT_MAX_LENGTH = 200;
|
|
|
15
15
|
* every byte a remote server chose that reaches a message.
|
|
16
16
|
*/
|
|
17
17
|
export function sanitizeProviderText(value) {
|
|
18
|
-
//
|
|
18
|
+
// oxlint-disable-next-line no-control-regex
|
|
19
19
|
const flattened = value.replace(/[\u0000-\u001F\u007F-\u009F]+/g, " ");
|
|
20
20
|
return flattened.trim().slice(0, PROVIDER_TEXT_MAX_LENGTH).toWellFormed();
|
|
21
21
|
}
|
package/package.json
CHANGED
|
@@ -1,92 +1,215 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@udibo/oauth2",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0",
|
|
4
4
|
"description": "A flexible OAuth2 toolkit: framework-agnostic authorization & resource servers, a typed client, Hono adapters (including a backend-for-frontend), and React bindings.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"authorization-server",
|
|
7
|
+
"bff",
|
|
8
|
+
"hono",
|
|
9
|
+
"oauth2",
|
|
10
|
+
"oidc",
|
|
11
|
+
"openid-connect",
|
|
12
|
+
"react",
|
|
13
|
+
"resource-server"
|
|
14
|
+
],
|
|
15
|
+
"homepage": "https://github.com/udibo/oauth2#readme",
|
|
16
|
+
"bugs": {
|
|
17
|
+
"url": "https://github.com/udibo/oauth2/issues"
|
|
18
|
+
},
|
|
19
|
+
"license": "MIT",
|
|
20
|
+
"author": "Udibo",
|
|
5
21
|
"repository": {
|
|
6
22
|
"type": "git",
|
|
7
23
|
"url": "git+https://github.com/udibo/oauth2.git"
|
|
8
24
|
},
|
|
9
|
-
"
|
|
10
|
-
|
|
11
|
-
"url": "https://github.com/udibo/oauth2/issues"
|
|
25
|
+
"bin": {
|
|
26
|
+
"udibo-oauth2": "./dist/cli/bin.js"
|
|
12
27
|
},
|
|
13
|
-
"
|
|
28
|
+
"files": [
|
|
29
|
+
"dist",
|
|
30
|
+
"!dist/**/*.test.*",
|
|
31
|
+
"README.md",
|
|
32
|
+
"LICENSE",
|
|
33
|
+
"SECURITY.md"
|
|
34
|
+
],
|
|
35
|
+
"type": "module",
|
|
36
|
+
"sideEffects": false,
|
|
14
37
|
"exports": {
|
|
15
38
|
"./server": {
|
|
16
|
-
"
|
|
39
|
+
"types": "./dist/server/mod.d.ts",
|
|
40
|
+
"default": "./dist/server/mod.js"
|
|
17
41
|
},
|
|
18
42
|
"./server/authorization": {
|
|
19
|
-
"
|
|
43
|
+
"types": "./dist/server/authorization-server.d.ts",
|
|
44
|
+
"default": "./dist/server/authorization-server.js"
|
|
20
45
|
},
|
|
21
46
|
"./server/resource": {
|
|
22
|
-
"
|
|
47
|
+
"types": "./dist/server/resource-server.d.ts",
|
|
48
|
+
"default": "./dist/server/resource-server.js"
|
|
23
49
|
},
|
|
24
50
|
"./server/public-suffix": {
|
|
25
|
-
"
|
|
51
|
+
"types": "./dist/server/public-suffix/mod.d.ts",
|
|
52
|
+
"default": "./dist/server/public-suffix/mod.js"
|
|
26
53
|
},
|
|
27
54
|
"./client": {
|
|
28
|
-
"
|
|
55
|
+
"types": "./dist/client/mod.d.ts",
|
|
56
|
+
"default": "./dist/client/mod.js"
|
|
29
57
|
},
|
|
30
58
|
"./identity": {
|
|
31
|
-
"
|
|
59
|
+
"types": "./dist/identity/mod.d.ts",
|
|
60
|
+
"default": "./dist/identity/mod.js"
|
|
32
61
|
},
|
|
33
62
|
"./identity/external": {
|
|
34
|
-
"
|
|
63
|
+
"types": "./dist/identity/external/mod.d.ts",
|
|
64
|
+
"default": "./dist/identity/external/mod.js"
|
|
35
65
|
},
|
|
36
66
|
"./identity/mfa": {
|
|
37
|
-
"
|
|
67
|
+
"types": "./dist/identity/mfa/mod.d.ts",
|
|
68
|
+
"default": "./dist/identity/mfa/mod.js"
|
|
38
69
|
},
|
|
39
70
|
"./identity/migration": {
|
|
40
|
-
"
|
|
71
|
+
"types": "./dist/identity/migration.d.ts",
|
|
72
|
+
"default": "./dist/identity/migration.js"
|
|
41
73
|
},
|
|
42
74
|
"./hono/resource-server": {
|
|
43
|
-
"
|
|
75
|
+
"types": "./dist/adapters/hono/resource-server.d.ts",
|
|
76
|
+
"default": "./dist/adapters/hono/resource-server.js"
|
|
44
77
|
},
|
|
45
78
|
"./hono/authorization-server": {
|
|
46
|
-
"
|
|
79
|
+
"types": "./dist/adapters/hono/authorization-server.d.ts",
|
|
80
|
+
"default": "./dist/adapters/hono/authorization-server.js"
|
|
47
81
|
},
|
|
48
82
|
"./hono/bff": {
|
|
49
|
-
"
|
|
83
|
+
"types": "./dist/adapters/hono/bff/mod.d.ts",
|
|
84
|
+
"default": "./dist/adapters/hono/bff/mod.js"
|
|
50
85
|
},
|
|
51
86
|
"./hono/bff/testing": {
|
|
52
|
-
"
|
|
87
|
+
"types": "./dist/adapters/hono/bff/testing.d.ts",
|
|
88
|
+
"default": "./dist/adapters/hono/bff/testing.js"
|
|
53
89
|
},
|
|
54
90
|
"./hono/identity": {
|
|
55
|
-
"
|
|
91
|
+
"types": "./dist/adapters/hono/identity.d.ts",
|
|
92
|
+
"default": "./dist/adapters/hono/identity.js"
|
|
56
93
|
},
|
|
57
94
|
"./hono/log": {
|
|
58
|
-
"
|
|
95
|
+
"types": "./dist/adapters/hono/log.d.ts",
|
|
96
|
+
"default": "./dist/adapters/hono/log.js"
|
|
59
97
|
},
|
|
60
98
|
"./react": {
|
|
61
|
-
"
|
|
99
|
+
"types": "./dist/react/mod.d.ts",
|
|
100
|
+
"default": "./dist/react/mod.js"
|
|
62
101
|
},
|
|
63
102
|
"./react/components": {
|
|
64
|
-
"
|
|
103
|
+
"types": "./dist/react/components/mod.d.ts",
|
|
104
|
+
"default": "./dist/react/components/mod.js"
|
|
65
105
|
},
|
|
66
106
|
"./react/testing": {
|
|
67
|
-
"
|
|
107
|
+
"types": "./dist/react/testing.d.ts",
|
|
108
|
+
"default": "./dist/react/testing.js"
|
|
68
109
|
},
|
|
69
110
|
"./testing": {
|
|
70
|
-
"
|
|
111
|
+
"types": "./dist/testing/mod.d.ts",
|
|
112
|
+
"default": "./dist/testing/mod.js"
|
|
71
113
|
},
|
|
72
114
|
"./testing/contract": {
|
|
73
|
-
"
|
|
115
|
+
"types": "./dist/testing/contract/mod.d.ts",
|
|
116
|
+
"default": "./dist/testing/contract/mod.js"
|
|
74
117
|
},
|
|
75
118
|
"./crypto": {
|
|
76
|
-
"
|
|
119
|
+
"types": "./dist/utils/crypto.d.ts",
|
|
120
|
+
"default": "./dist/utils/crypto.js"
|
|
77
121
|
},
|
|
78
122
|
"./url": {
|
|
79
|
-
"
|
|
80
|
-
|
|
123
|
+
"types": "./dist/utils/url.d.ts",
|
|
124
|
+
"default": "./dist/utils/url.js"
|
|
125
|
+
},
|
|
126
|
+
"./package.json": "./package.json"
|
|
81
127
|
},
|
|
82
|
-
"scripts": {},
|
|
83
128
|
"publishConfig": {
|
|
84
|
-
"access": "public"
|
|
129
|
+
"access": "public",
|
|
130
|
+
"provenance": true
|
|
131
|
+
},
|
|
132
|
+
"scripts": {
|
|
133
|
+
"build": "node -e \"require('node:fs').rmSync('dist', { recursive: true, force: true })\" && tsc -p tsconfig.build.json",
|
|
134
|
+
"check": "pnpm build && pnpm typecheck:examples && pnpm lint && pnpm fmt:check && tsc --noEmit && pnpm doc:lint && pnpm doc:check && pnpm doc:links && pnpm llms:check",
|
|
135
|
+
"typecheck:examples": "pnpm -r --filter \"./examples/**\" --filter \"./templates/**\" typecheck",
|
|
136
|
+
"fmt": "oxfmt",
|
|
137
|
+
"fmt:check": "oxfmt --check",
|
|
138
|
+
"lint": "oxlint --type-aware --type-check",
|
|
139
|
+
"test": "vitest run",
|
|
140
|
+
"test:coverage": "vitest run --coverage",
|
|
141
|
+
"test:browser": "playwright test",
|
|
142
|
+
"smoke": "node scripts/npm-smoke.ts",
|
|
143
|
+
"jsr:dry-run": "jsr publish --dry-run --allow-dirty",
|
|
144
|
+
"doc:lint": "node scripts/doc-lint.ts",
|
|
145
|
+
"doc:check": "node scripts/doc-check.ts",
|
|
146
|
+
"doc:links": "node scripts/doc-links.ts",
|
|
147
|
+
"llms:generate": "node scripts/llms.ts",
|
|
148
|
+
"llms:check": "node scripts/llms.ts --check",
|
|
149
|
+
"psl:update": "node scripts/public-suffix-list.ts",
|
|
150
|
+
"psl:check": "node scripts/public-suffix-list.ts --check",
|
|
151
|
+
"release:verify": "node scripts/verify-release.ts"
|
|
85
152
|
},
|
|
86
153
|
"dependencies": {
|
|
87
|
-
"@
|
|
154
|
+
"@hono/node-server": "^2.1.3",
|
|
155
|
+
"@udibo/http-error": "^0.12.0"
|
|
156
|
+
},
|
|
157
|
+
"devDependencies": {
|
|
158
|
+
"@playwright/test": "^1.63.0",
|
|
159
|
+
"@sebbo2002/semantic-release-jsr": "3.2.1",
|
|
160
|
+
"@semantic-release/changelog": "6.0.3",
|
|
161
|
+
"@semantic-release/exec": "7.1.0",
|
|
162
|
+
"@semantic-release/git": "10.0.1",
|
|
163
|
+
"@semantic-release/github": "12.0.8",
|
|
164
|
+
"@semantic-release/npm": "13.1.5",
|
|
165
|
+
"@testing-library/dom": "^10.4.2",
|
|
166
|
+
"@testing-library/react": "^16.3.3",
|
|
167
|
+
"@types/node": "^26.6.4",
|
|
168
|
+
"@types/react": "^19.3.0",
|
|
169
|
+
"@types/react-dom": "^19.3.0",
|
|
170
|
+
"@vitest/coverage-v8": "^5.0.3",
|
|
171
|
+
"axe-core": "^4.14.0",
|
|
172
|
+
"conventional-changelog-conventionalcommits": "9.3.1",
|
|
173
|
+
"hono": "^4.13.13",
|
|
174
|
+
"jsdom": "^30.1.2",
|
|
175
|
+
"jsr": "^0.14.3",
|
|
176
|
+
"oxfmt": "^0.72.0",
|
|
177
|
+
"oxlint": "^1.87.0",
|
|
178
|
+
"oxlint-tsgolint": "^7.0.2003",
|
|
179
|
+
"react": "^19.3.0",
|
|
180
|
+
"react-dom": "^19.3.0",
|
|
181
|
+
"semantic-release": "25.0.5",
|
|
182
|
+
"typescript": "^7.0.2",
|
|
183
|
+
"vite": "^8.3.3",
|
|
184
|
+
"vitest": "^5.0.3",
|
|
185
|
+
"yaml": "2.9.1"
|
|
186
|
+
},
|
|
187
|
+
"peerDependencies": {
|
|
188
|
+
"@types/react": "^19.0.0",
|
|
88
189
|
"hono": "^4.7.0",
|
|
89
|
-
"react": "^19.0.0"
|
|
190
|
+
"react": "^19.0.0",
|
|
191
|
+
"react-dom": "^19.0.0",
|
|
192
|
+
"vitest": ">=3.0.0"
|
|
193
|
+
},
|
|
194
|
+
"peerDependenciesMeta": {
|
|
195
|
+
"hono": {
|
|
196
|
+
"optional": true
|
|
197
|
+
},
|
|
198
|
+
"react": {
|
|
199
|
+
"optional": true
|
|
200
|
+
},
|
|
201
|
+
"react-dom": {
|
|
202
|
+
"optional": true
|
|
203
|
+
},
|
|
204
|
+
"@types/react": {
|
|
205
|
+
"optional": true
|
|
206
|
+
},
|
|
207
|
+
"vitest": {
|
|
208
|
+
"optional": true
|
|
209
|
+
}
|
|
210
|
+
},
|
|
211
|
+
"engines": {
|
|
212
|
+
"node": ">=22"
|
|
90
213
|
},
|
|
91
|
-
"
|
|
214
|
+
"packageManager": "pnpm@12.10.1"
|
|
92
215
|
}
|
package/esm/_dnt.polyfills.d.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
declare global {
|
|
2
|
-
interface Object {
|
|
3
|
-
/**
|
|
4
|
-
* Determines whether an object has a property with the specified name.
|
|
5
|
-
* @param o An object.
|
|
6
|
-
* @param v A property name.
|
|
7
|
-
*/
|
|
8
|
-
hasOwn(o: object, v: PropertyKey): boolean;
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
export {};
|
|
12
|
-
declare global {
|
|
13
|
-
interface Error {
|
|
14
|
-
cause?: unknown;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
export {};
|
|
18
|
-
declare global {
|
|
19
|
-
interface PromiseConstructor {
|
|
20
|
-
/**
|
|
21
|
-
* Creates a Promise that can be resolved or rejected using provided functions.
|
|
22
|
-
* @returns An object containing `promise` promise object, `resolve` and `reject` functions.
|
|
23
|
-
*/
|
|
24
|
-
withResolvers<T>(): {
|
|
25
|
-
promise: Promise<T>;
|
|
26
|
-
resolve: (value: T | PromiseLike<T>) => void;
|
|
27
|
-
reject: (reason?: any) => void;
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
export {};
|
package/esm/_dnt.polyfills.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
// https://github.com/tc39/proposal-accessible-object-hasownproperty/blob/main/polyfill.js
|
|
2
|
-
if (!Object.hasOwn) {
|
|
3
|
-
Object.defineProperty(Object, "hasOwn", {
|
|
4
|
-
value: function (object, property) {
|
|
5
|
-
if (object == null) {
|
|
6
|
-
throw new TypeError("Cannot convert undefined or null to object");
|
|
7
|
-
}
|
|
8
|
-
return Object.prototype.hasOwnProperty.call(Object(object), property);
|
|
9
|
-
},
|
|
10
|
-
configurable: true,
|
|
11
|
-
enumerable: false,
|
|
12
|
-
writable: true,
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
// https://github.com/tc39/proposal-promise-with-resolvers/blob/3a78801e073e99217dbeb2c43ba7212f3bdc8b83/polyfills.js#L1C1-L9C2
|
|
16
|
-
if (Promise.withResolvers === undefined) {
|
|
17
|
-
Promise.withResolvers = () => {
|
|
18
|
-
const out = {};
|
|
19
|
-
out.promise = new Promise((resolve_, reject_) => {
|
|
20
|
-
out.resolve = resolve_;
|
|
21
|
-
out.reject = reject_;
|
|
22
|
-
});
|
|
23
|
-
return out;
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
export {};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Make an assertion that `actual` and `expected` are almost equal numbers
|
|
3
|
-
* through a given tolerance. It can be used to take into account IEEE-754
|
|
4
|
-
* double-precision floating-point representation limitations. If the values
|
|
5
|
-
* are not almost equal then throw.
|
|
6
|
-
*
|
|
7
|
-
* The default tolerance is one hundred thousandth of a percent of the
|
|
8
|
-
* expected value.
|
|
9
|
-
*
|
|
10
|
-
* @example Usage
|
|
11
|
-
* ```ts ignore
|
|
12
|
-
* import { assertAlmostEquals } from "@std/assert";
|
|
13
|
-
*
|
|
14
|
-
* assertAlmostEquals(0.01, 0.02); // Throws
|
|
15
|
-
* assertAlmostEquals(1e-8, 1e-9); // Throws
|
|
16
|
-
* assertAlmostEquals(1.000000001e-8, 1.000000002e-8); // Doesn't throw
|
|
17
|
-
* assertAlmostEquals(0.01, 0.02, 0.1); // Doesn't throw
|
|
18
|
-
* assertAlmostEquals(0.1 + 0.2, 0.3, 1e-16); // Doesn't throw
|
|
19
|
-
* assertAlmostEquals(0.1 + 0.2, 0.3, 1e-17); // Throws
|
|
20
|
-
* ```
|
|
21
|
-
*
|
|
22
|
-
* @param actual The actual value to compare.
|
|
23
|
-
* @param expected The expected value to compare.
|
|
24
|
-
* @param tolerance The tolerance to consider the values almost equal. The
|
|
25
|
-
* default is one hundred thousandth of a percent of the expected value.
|
|
26
|
-
* @param msg The optional message to include in the error.
|
|
27
|
-
* @throws {AssertionError} If the values are not almost equal.
|
|
28
|
-
*/
|
|
29
|
-
export declare function assertAlmostEquals(actual: number, expected: number, tolerance?: number, msg?: string): void;
|