@atproto/oauth-types 0.1.5 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (90) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/dist/atproto-loopback-client-metadata.d.ts +4 -1
  3. package/dist/atproto-loopback-client-metadata.d.ts.map +1 -1
  4. package/dist/atproto-loopback-client-metadata.js +1 -2
  5. package/dist/atproto-loopback-client-metadata.js.map +1 -1
  6. package/dist/constants.d.ts +0 -6
  7. package/dist/constants.d.ts.map +1 -1
  8. package/dist/constants.js +1 -17
  9. package/dist/constants.js.map +1 -1
  10. package/dist/index.d.ts +2 -0
  11. package/dist/index.d.ts.map +1 -1
  12. package/dist/index.js +2 -0
  13. package/dist/index.js.map +1 -1
  14. package/dist/oauth-authorization-code-grant-token-request.d.ts +2 -2
  15. package/dist/oauth-authorization-code-grant-token-request.d.ts.map +1 -1
  16. package/dist/oauth-authorization-code-grant-token-request.js +2 -1
  17. package/dist/oauth-authorization-code-grant-token-request.js.map +1 -1
  18. package/dist/oauth-authorization-details.d.ts +42 -4
  19. package/dist/oauth-authorization-details.d.ts.map +1 -1
  20. package/dist/oauth-authorization-details.js +21 -1
  21. package/dist/oauth-authorization-details.js.map +1 -1
  22. package/dist/oauth-authorization-request-jar.d.ts +1 -1
  23. package/dist/oauth-authorization-request-par.d.ts +11 -11
  24. package/dist/oauth-authorization-request-parameters.d.ts +10 -10
  25. package/dist/oauth-authorization-request-parameters.d.ts.map +1 -1
  26. package/dist/oauth-authorization-request-parameters.js +3 -2
  27. package/dist/oauth-authorization-request-parameters.js.map +1 -1
  28. package/dist/oauth-authorization-request-query.d.ts +11 -11
  29. package/dist/oauth-authorization-server-metadata.d.ts +69 -66
  30. package/dist/oauth-authorization-server-metadata.d.ts.map +1 -1
  31. package/dist/oauth-authorization-server-metadata.js +14 -10
  32. package/dist/oauth-authorization-server-metadata.js.map +1 -1
  33. package/dist/oauth-client-id-discoverable.d.ts +3 -2
  34. package/dist/oauth-client-id-discoverable.d.ts.map +1 -1
  35. package/dist/oauth-client-id-discoverable.js +54 -31
  36. package/dist/oauth-client-id-discoverable.js.map +1 -1
  37. package/dist/oauth-client-id-loopback.d.ts +5 -5
  38. package/dist/oauth-client-id-loopback.d.ts.map +1 -1
  39. package/dist/oauth-client-id-loopback.js +32 -31
  40. package/dist/oauth-client-id-loopback.js.map +1 -1
  41. package/dist/oauth-client-metadata.d.ts +112 -102
  42. package/dist/oauth-client-metadata.d.ts.map +1 -1
  43. package/dist/oauth-client-metadata.js +18 -8
  44. package/dist/oauth-client-metadata.js.map +1 -1
  45. package/dist/oauth-issuer-identifier.d.ts +2 -1
  46. package/dist/oauth-issuer-identifier.d.ts.map +1 -1
  47. package/dist/oauth-issuer-identifier.js +8 -23
  48. package/dist/oauth-issuer-identifier.js.map +1 -1
  49. package/dist/oauth-protected-resource-metadata.d.ts +15 -12
  50. package/dist/oauth-protected-resource-metadata.d.ts.map +1 -1
  51. package/dist/oauth-protected-resource-metadata.js +15 -5
  52. package/dist/oauth-protected-resource-metadata.js.map +1 -1
  53. package/dist/oauth-redirect-uri.d.ts +10 -0
  54. package/dist/oauth-redirect-uri.d.ts.map +1 -0
  55. package/dist/oauth-redirect-uri.js +35 -0
  56. package/dist/oauth-redirect-uri.js.map +1 -0
  57. package/dist/oauth-refresh-token-grant-token-request.d.ts +0 -3
  58. package/dist/oauth-refresh-token-grant-token-request.d.ts.map +1 -1
  59. package/dist/oauth-refresh-token-grant-token-request.js +0 -2
  60. package/dist/oauth-refresh-token-grant-token-request.js.map +1 -1
  61. package/dist/oauth-token-request.d.ts +2 -5
  62. package/dist/oauth-token-request.d.ts.map +1 -1
  63. package/dist/oauth-token-response.d.ts +9 -12
  64. package/dist/oauth-token-response.d.ts.map +1 -1
  65. package/dist/oauth-token-response.js +4 -2
  66. package/dist/oauth-token-response.js.map +1 -1
  67. package/dist/uri.d.ts +20 -0
  68. package/dist/uri.d.ts.map +1 -0
  69. package/dist/uri.js +127 -0
  70. package/dist/uri.js.map +1 -0
  71. package/dist/util.js +5 -6
  72. package/dist/util.js.map +1 -1
  73. package/package.json +2 -2
  74. package/src/atproto-loopback-client-metadata.ts +8 -3
  75. package/src/constants.ts +0 -16
  76. package/src/index.ts +2 -0
  77. package/src/oauth-authorization-code-grant-token-request.ts +2 -1
  78. package/src/oauth-authorization-details.ts +21 -1
  79. package/src/oauth-authorization-request-parameters.ts +3 -2
  80. package/src/oauth-authorization-server-metadata.ts +14 -10
  81. package/src/oauth-client-id-discoverable.ts +69 -51
  82. package/src/oauth-client-id-loopback.ts +40 -40
  83. package/src/oauth-client-metadata.ts +18 -8
  84. package/src/oauth-issuer-identifier.ts +14 -24
  85. package/src/oauth-protected-resource-metadata.ts +15 -5
  86. package/src/oauth-redirect-uri.ts +56 -0
  87. package/src/oauth-refresh-token-grant-token-request.ts +0 -2
  88. package/src/oauth-token-response.ts +4 -2
  89. package/src/uri.ts +171 -0
  90. package/tsconfig.build.tsbuildinfo +1 -0
@@ -2,7 +2,7 @@ import { z } from 'zod';
2
2
  export declare const oauthAuthorizationRequestQuerySchema: z.ZodUnion<[z.ZodObject<{
3
3
  client_id: z.ZodString;
4
4
  state: z.ZodOptional<z.ZodString>;
5
- redirect_uri: z.ZodOptional<z.ZodString>;
5
+ redirect_uri: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, `${string}:${string}`, string>, `http://[::1]${string}` | "http://localhost" | `http://localhost#${string}` | `http://localhost?${string}` | `http://localhost/${string}` | `http://localhost:${string}` | "http://127.0.0.1" | `http://127.0.0.1#${string}` | `http://127.0.0.1?${string}` | `http://127.0.0.1/${string}` | `http://127.0.0.1:${string}`, string>, `http://[::1]${string}` | "http://127.0.0.1" | `http://127.0.0.1#${string}` | `http://127.0.0.1?${string}` | `http://127.0.0.1/${string}` | `http://127.0.0.1:${string}`, string>, z.ZodEffects<z.ZodEffects<z.ZodString, `${string}:${string}`, string>, `https://${string}`, string>, z.ZodEffects<z.ZodEffects<z.ZodString, `${string}:${string}`, string>, `${string}.${string}:/${string}`, string>]>>;
6
6
  scope: z.ZodOptional<z.ZodString>;
7
7
  response_type: z.ZodEnum<["code", "token", "none", "code id_token token", "code id_token", "code token", "id_token token", "id_token"]>;
8
8
  code_challenge: z.ZodOptional<z.ZodString>;
@@ -27,18 +27,18 @@ export declare const oauthAuthorizationRequestQuerySchema: z.ZodUnion<[z.ZodObje
27
27
  login_hint: z.ZodOptional<z.ZodString>;
28
28
  ui_locales: z.ZodOptional<z.ZodString>;
29
29
  id_token_hint: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, `${string}.${string}.${string}`, string>>;
30
- display: z.ZodOptional<z.ZodEnum<["page", "popup", "touch"]>>;
30
+ display: z.ZodOptional<z.ZodEnum<["page", "popup", "touch", "wap"]>>;
31
31
  prompt: z.ZodOptional<z.ZodEnum<["none", "login", "consent", "select_account"]>>;
32
32
  authorization_details: z.ZodOptional<z.ZodArray<z.ZodObject<{
33
33
  type: z.ZodString;
34
- locations: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
34
+ locations: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, `${string}:${string}`, string>, "many">>;
35
35
  actions: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
36
36
  datatypes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
37
37
  identifier: z.ZodOptional<z.ZodString>;
38
38
  privileges: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
39
39
  }, "strip", z.ZodTypeAny, {
40
40
  type: string;
41
- locations?: string[] | undefined;
41
+ locations?: `${string}:${string}`[] | undefined;
42
42
  actions?: string[] | undefined;
43
43
  datatypes?: string[] | undefined;
44
44
  identifier?: string | undefined;
@@ -54,7 +54,7 @@ export declare const oauthAuthorizationRequestQuerySchema: z.ZodUnion<[z.ZodObje
54
54
  }, "strip", z.ZodTypeAny, {
55
55
  client_id: string;
56
56
  response_type: "code" | "none" | "token" | "code id_token token" | "code id_token" | "code token" | "id_token token" | "id_token";
57
- redirect_uri?: string | undefined;
57
+ redirect_uri?: `http://[::1]${string}` | "http://127.0.0.1" | `http://127.0.0.1#${string}` | `http://127.0.0.1?${string}` | `http://127.0.0.1/${string}` | `http://127.0.0.1:${string}` | `https://${string}` | `${string}.${string}:/${string}` | undefined;
58
58
  scope?: string | undefined;
59
59
  nonce?: string | undefined;
60
60
  state?: string | undefined;
@@ -63,7 +63,7 @@ export declare const oauthAuthorizationRequestQuerySchema: z.ZodUnion<[z.ZodObje
63
63
  dpop_jkt?: string | undefined;
64
64
  response_mode?: "query" | "fragment" | "form_post" | undefined;
65
65
  max_age?: number | undefined;
66
- claims?: Partial<Record<"id_token" | "userinfo", Partial<Record<"auth_time" | "nonce" | "acr" | "name" | "family_name" | "given_name" | "middle_name" | "nickname" | "preferred_username" | "gender" | "picture" | "profile" | "website" | "birthdate" | "zoneinfo" | "locale" | "updated_at" | "email" | "email_verified" | "phone_number" | "phone_number_verified" | "address", {
66
+ claims?: Partial<Record<"id_token" | "userinfo", Partial<Record<"email" | "auth_time" | "nonce" | "acr" | "name" | "family_name" | "given_name" | "middle_name" | "nickname" | "preferred_username" | "gender" | "picture" | "profile" | "website" | "birthdate" | "zoneinfo" | "locale" | "updated_at" | "email_verified" | "phone_number" | "phone_number_verified" | "address", {
67
67
  values?: (string | number | boolean)[] | undefined;
68
68
  value?: string | number | boolean | undefined;
69
69
  essential?: boolean | undefined;
@@ -71,11 +71,11 @@ export declare const oauthAuthorizationRequestQuerySchema: z.ZodUnion<[z.ZodObje
71
71
  login_hint?: string | undefined;
72
72
  ui_locales?: string | undefined;
73
73
  id_token_hint?: `${string}.${string}.${string}` | undefined;
74
- display?: "page" | "popup" | "touch" | undefined;
74
+ display?: "page" | "popup" | "touch" | "wap" | undefined;
75
75
  prompt?: "none" | "login" | "consent" | "select_account" | undefined;
76
76
  authorization_details?: {
77
77
  type: string;
78
- locations?: string[] | undefined;
78
+ locations?: `${string}:${string}`[] | undefined;
79
79
  actions?: string[] | undefined;
80
80
  datatypes?: string[] | undefined;
81
81
  identifier?: string | undefined;
@@ -93,7 +93,7 @@ export declare const oauthAuthorizationRequestQuerySchema: z.ZodUnion<[z.ZodObje
93
93
  dpop_jkt?: string | undefined;
94
94
  response_mode?: "query" | "fragment" | "form_post" | undefined;
95
95
  max_age?: number | undefined;
96
- claims?: Partial<Record<"id_token" | "userinfo", Partial<Record<"auth_time" | "nonce" | "acr" | "name" | "family_name" | "given_name" | "middle_name" | "nickname" | "preferred_username" | "gender" | "picture" | "profile" | "website" | "birthdate" | "zoneinfo" | "locale" | "updated_at" | "email" | "email_verified" | "phone_number" | "phone_number_verified" | "address", {
96
+ claims?: Partial<Record<"id_token" | "userinfo", Partial<Record<"email" | "auth_time" | "nonce" | "acr" | "name" | "family_name" | "given_name" | "middle_name" | "nickname" | "preferred_username" | "gender" | "picture" | "profile" | "website" | "birthdate" | "zoneinfo" | "locale" | "updated_at" | "email_verified" | "phone_number" | "phone_number_verified" | "address", {
97
97
  values?: (string | number | boolean)[] | undefined;
98
98
  value?: string | number | boolean | undefined;
99
99
  essential?: boolean | undefined;
@@ -101,7 +101,7 @@ export declare const oauthAuthorizationRequestQuerySchema: z.ZodUnion<[z.ZodObje
101
101
  login_hint?: string | undefined;
102
102
  ui_locales?: string | undefined;
103
103
  id_token_hint?: string | undefined;
104
- display?: "page" | "popup" | "touch" | undefined;
104
+ display?: "page" | "popup" | "touch" | "wap" | undefined;
105
105
  prompt?: "none" | "login" | "consent" | "select_account" | undefined;
106
106
  authorization_details?: {
107
107
  type: string;
@@ -114,7 +114,7 @@ export declare const oauthAuthorizationRequestQuerySchema: z.ZodUnion<[z.ZodObje
114
114
  }>, z.ZodObject<{
115
115
  request: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, `${string}.${string}.${string}`, string>, z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, `${string}.${string}`, string>]>;
116
116
  }, "strip", z.ZodTypeAny, {
117
- request: `${string}.${string}.${string}` | `${string}.${string}`;
117
+ request: `${string}.${string}` | `${string}.${string}.${string}`;
118
118
  }, {
119
119
  request: string;
120
120
  }>, z.ZodObject<{
@@ -1,9 +1,12 @@
1
1
  import { z } from 'zod';
2
2
  /**
3
3
  * @see {@link https://datatracker.ietf.org/doc/html/rfc8414}
4
+ * @note we do not enforce https: scheme in URIs to support development
5
+ * environments. Make sure to validate the URIs before using it in a production
6
+ * environment.
4
7
  */
5
8
  export declare const oauthAuthorizationServerMetadataSchema: z.ZodObject<{
6
- issuer: z.ZodEffects<z.ZodString, string, string>;
9
+ issuer: z.ZodEffects<z.ZodEffects<z.ZodString, `http://[::1]${string}` | "http://localhost" | `http://localhost#${string}` | `http://localhost?${string}` | `http://localhost/${string}` | `http://localhost:${string}` | "http://127.0.0.1" | `http://127.0.0.1#${string}` | `http://127.0.0.1?${string}` | `http://127.0.0.1/${string}` | `http://127.0.0.1:${string}` | `https://${string}`, string>, `http://[::1]${string}` | "http://localhost" | `http://localhost#${string}` | `http://localhost?${string}` | `http://localhost/${string}` | `http://localhost:${string}` | "http://127.0.0.1" | `http://127.0.0.1#${string}` | `http://127.0.0.1?${string}` | `http://127.0.0.1/${string}` | `http://127.0.0.1:${string}` | `https://${string}`, string>;
7
10
  claims_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
8
11
  claims_locales_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
9
12
  claims_parameter_supported: z.ZodOptional<z.ZodBoolean>;
@@ -24,26 +27,26 @@ export declare const oauthAuthorizationServerMetadataSchema: z.ZodObject<{
24
27
  authorization_details_types_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
25
28
  request_object_encryption_alg_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
26
29
  request_object_encryption_enc_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
27
- jwks_uri: z.ZodOptional<z.ZodString>;
28
- authorization_endpoint: z.ZodString;
29
- token_endpoint: z.ZodString;
30
+ jwks_uri: z.ZodOptional<z.ZodEffects<z.ZodString, `http://[::1]${string}` | "http://localhost" | `http://localhost#${string}` | `http://localhost?${string}` | `http://localhost/${string}` | `http://localhost:${string}` | "http://127.0.0.1" | `http://127.0.0.1#${string}` | `http://127.0.0.1?${string}` | `http://127.0.0.1/${string}` | `http://127.0.0.1:${string}` | `https://${string}`, string>>;
31
+ authorization_endpoint: z.ZodEffects<z.ZodString, `http://[::1]${string}` | "http://localhost" | `http://localhost#${string}` | `http://localhost?${string}` | `http://localhost/${string}` | `http://localhost:${string}` | "http://127.0.0.1" | `http://127.0.0.1#${string}` | `http://127.0.0.1?${string}` | `http://127.0.0.1/${string}` | `http://127.0.0.1:${string}` | `https://${string}`, string>;
32
+ token_endpoint: z.ZodEffects<z.ZodString, `http://[::1]${string}` | "http://localhost" | `http://localhost#${string}` | `http://localhost?${string}` | `http://localhost/${string}` | `http://localhost:${string}` | "http://127.0.0.1" | `http://127.0.0.1#${string}` | `http://127.0.0.1?${string}` | `http://127.0.0.1/${string}` | `http://127.0.0.1:${string}` | `https://${string}`, string>;
30
33
  token_endpoint_auth_methods_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
31
34
  token_endpoint_auth_signing_alg_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
32
- revocation_endpoint: z.ZodOptional<z.ZodString>;
33
- introspection_endpoint: z.ZodOptional<z.ZodString>;
34
- pushed_authorization_request_endpoint: z.ZodOptional<z.ZodString>;
35
+ revocation_endpoint: z.ZodOptional<z.ZodEffects<z.ZodString, `http://[::1]${string}` | "http://localhost" | `http://localhost#${string}` | `http://localhost?${string}` | `http://localhost/${string}` | `http://localhost:${string}` | "http://127.0.0.1" | `http://127.0.0.1#${string}` | `http://127.0.0.1?${string}` | `http://127.0.0.1/${string}` | `http://127.0.0.1:${string}` | `https://${string}`, string>>;
36
+ introspection_endpoint: z.ZodOptional<z.ZodEffects<z.ZodString, `http://[::1]${string}` | "http://localhost" | `http://localhost#${string}` | `http://localhost?${string}` | `http://localhost/${string}` | `http://localhost:${string}` | "http://127.0.0.1" | `http://127.0.0.1#${string}` | `http://127.0.0.1?${string}` | `http://127.0.0.1/${string}` | `http://127.0.0.1:${string}` | `https://${string}`, string>>;
37
+ pushed_authorization_request_endpoint: z.ZodOptional<z.ZodEffects<z.ZodString, `http://[::1]${string}` | "http://localhost" | `http://localhost#${string}` | `http://localhost?${string}` | `http://localhost/${string}` | `http://localhost:${string}` | "http://127.0.0.1" | `http://127.0.0.1#${string}` | `http://127.0.0.1?${string}` | `http://127.0.0.1/${string}` | `http://127.0.0.1:${string}` | `https://${string}`, string>>;
35
38
  require_pushed_authorization_requests: z.ZodOptional<z.ZodBoolean>;
36
- userinfo_endpoint: z.ZodOptional<z.ZodString>;
37
- end_session_endpoint: z.ZodOptional<z.ZodString>;
38
- registration_endpoint: z.ZodOptional<z.ZodString>;
39
+ userinfo_endpoint: z.ZodOptional<z.ZodEffects<z.ZodString, `http://[::1]${string}` | "http://localhost" | `http://localhost#${string}` | `http://localhost?${string}` | `http://localhost/${string}` | `http://localhost:${string}` | "http://127.0.0.1" | `http://127.0.0.1#${string}` | `http://127.0.0.1?${string}` | `http://127.0.0.1/${string}` | `http://127.0.0.1:${string}` | `https://${string}`, string>>;
40
+ end_session_endpoint: z.ZodOptional<z.ZodEffects<z.ZodString, `http://[::1]${string}` | "http://localhost" | `http://localhost#${string}` | `http://localhost?${string}` | `http://localhost/${string}` | `http://localhost:${string}` | "http://127.0.0.1" | `http://127.0.0.1#${string}` | `http://127.0.0.1?${string}` | `http://127.0.0.1/${string}` | `http://127.0.0.1:${string}` | `https://${string}`, string>>;
41
+ registration_endpoint: z.ZodOptional<z.ZodEffects<z.ZodString, `http://[::1]${string}` | "http://localhost" | `http://localhost#${string}` | `http://localhost?${string}` | `http://localhost/${string}` | `http://localhost:${string}` | "http://127.0.0.1" | `http://127.0.0.1#${string}` | `http://127.0.0.1?${string}` | `http://127.0.0.1/${string}` | `http://127.0.0.1:${string}` | `https://${string}`, string>>;
39
42
  dpop_signing_alg_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
40
- protected_resources: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
43
+ protected_resources: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, `http://[::1]${string}` | "http://localhost" | `http://localhost#${string}` | `http://localhost?${string}` | `http://localhost/${string}` | `http://localhost:${string}` | "http://127.0.0.1" | `http://127.0.0.1#${string}` | `http://127.0.0.1?${string}` | `http://127.0.0.1/${string}` | `http://127.0.0.1:${string}` | `https://${string}`, string>, "many">>;
41
44
  client_id_metadata_document_supported: z.ZodOptional<z.ZodBoolean>;
42
45
  }, "strip", z.ZodTypeAny, {
43
- issuer: string;
44
- authorization_endpoint: string;
45
- token_endpoint: string;
46
- jwks_uri?: string | undefined;
46
+ issuer: `http://[::1]${string}` | "http://localhost" | `http://localhost#${string}` | `http://localhost?${string}` | `http://localhost/${string}` | `http://localhost:${string}` | "http://127.0.0.1" | `http://127.0.0.1#${string}` | `http://127.0.0.1?${string}` | `http://127.0.0.1/${string}` | `http://127.0.0.1:${string}` | `https://${string}`;
47
+ authorization_endpoint: `http://[::1]${string}` | "http://localhost" | `http://localhost#${string}` | `http://localhost?${string}` | `http://localhost/${string}` | `http://localhost:${string}` | "http://127.0.0.1" | `http://127.0.0.1#${string}` | `http://127.0.0.1?${string}` | `http://127.0.0.1/${string}` | `http://127.0.0.1:${string}` | `https://${string}`;
48
+ token_endpoint: `http://[::1]${string}` | "http://localhost" | `http://localhost#${string}` | `http://localhost?${string}` | `http://localhost/${string}` | `http://localhost:${string}` | "http://127.0.0.1" | `http://127.0.0.1#${string}` | `http://127.0.0.1?${string}` | `http://127.0.0.1/${string}` | `http://127.0.0.1:${string}` | `https://${string}`;
49
+ jwks_uri?: `http://[::1]${string}` | "http://localhost" | `http://localhost#${string}` | `http://localhost?${string}` | `http://localhost/${string}` | `http://localhost:${string}` | "http://127.0.0.1" | `http://127.0.0.1#${string}` | `http://127.0.0.1?${string}` | `http://127.0.0.1/${string}` | `http://127.0.0.1:${string}` | `https://${string}` | undefined;
47
50
  claims_supported?: string[] | undefined;
48
51
  claims_locales_supported?: string[] | undefined;
49
52
  claims_parameter_supported?: boolean | undefined;
@@ -66,15 +69,15 @@ export declare const oauthAuthorizationServerMetadataSchema: z.ZodObject<{
66
69
  request_object_encryption_enc_values_supported?: string[] | undefined;
67
70
  token_endpoint_auth_methods_supported?: string[] | undefined;
68
71
  token_endpoint_auth_signing_alg_values_supported?: string[] | undefined;
69
- revocation_endpoint?: string | undefined;
70
- introspection_endpoint?: string | undefined;
71
- pushed_authorization_request_endpoint?: string | undefined;
72
+ revocation_endpoint?: `http://[::1]${string}` | "http://localhost" | `http://localhost#${string}` | `http://localhost?${string}` | `http://localhost/${string}` | `http://localhost:${string}` | "http://127.0.0.1" | `http://127.0.0.1#${string}` | `http://127.0.0.1?${string}` | `http://127.0.0.1/${string}` | `http://127.0.0.1:${string}` | `https://${string}` | undefined;
73
+ introspection_endpoint?: `http://[::1]${string}` | "http://localhost" | `http://localhost#${string}` | `http://localhost?${string}` | `http://localhost/${string}` | `http://localhost:${string}` | "http://127.0.0.1" | `http://127.0.0.1#${string}` | `http://127.0.0.1?${string}` | `http://127.0.0.1/${string}` | `http://127.0.0.1:${string}` | `https://${string}` | undefined;
74
+ pushed_authorization_request_endpoint?: `http://[::1]${string}` | "http://localhost" | `http://localhost#${string}` | `http://localhost?${string}` | `http://localhost/${string}` | `http://localhost:${string}` | "http://127.0.0.1" | `http://127.0.0.1#${string}` | `http://127.0.0.1?${string}` | `http://127.0.0.1/${string}` | `http://127.0.0.1:${string}` | `https://${string}` | undefined;
72
75
  require_pushed_authorization_requests?: boolean | undefined;
73
- userinfo_endpoint?: string | undefined;
74
- end_session_endpoint?: string | undefined;
75
- registration_endpoint?: string | undefined;
76
+ userinfo_endpoint?: `http://[::1]${string}` | "http://localhost" | `http://localhost#${string}` | `http://localhost?${string}` | `http://localhost/${string}` | `http://localhost:${string}` | "http://127.0.0.1" | `http://127.0.0.1#${string}` | `http://127.0.0.1?${string}` | `http://127.0.0.1/${string}` | `http://127.0.0.1:${string}` | `https://${string}` | undefined;
77
+ end_session_endpoint?: `http://[::1]${string}` | "http://localhost" | `http://localhost#${string}` | `http://localhost?${string}` | `http://localhost/${string}` | `http://localhost:${string}` | "http://127.0.0.1" | `http://127.0.0.1#${string}` | `http://127.0.0.1?${string}` | `http://127.0.0.1/${string}` | `http://127.0.0.1:${string}` | `https://${string}` | undefined;
78
+ registration_endpoint?: `http://[::1]${string}` | "http://localhost" | `http://localhost#${string}` | `http://localhost?${string}` | `http://localhost/${string}` | `http://localhost:${string}` | "http://127.0.0.1" | `http://127.0.0.1#${string}` | `http://127.0.0.1?${string}` | `http://127.0.0.1/${string}` | `http://127.0.0.1:${string}` | `https://${string}` | undefined;
76
79
  dpop_signing_alg_values_supported?: string[] | undefined;
77
- protected_resources?: string[] | undefined;
80
+ protected_resources?: (`http://[::1]${string}` | "http://localhost" | `http://localhost#${string}` | `http://localhost?${string}` | `http://localhost/${string}` | `http://localhost:${string}` | "http://127.0.0.1" | `http://127.0.0.1#${string}` | `http://127.0.0.1?${string}` | `http://127.0.0.1/${string}` | `http://127.0.0.1:${string}` | `https://${string}`)[] | undefined;
78
81
  client_id_metadata_document_supported?: boolean | undefined;
79
82
  }, {
80
83
  issuer: string;
@@ -116,7 +119,7 @@ export declare const oauthAuthorizationServerMetadataSchema: z.ZodObject<{
116
119
  }>;
117
120
  export type OAuthAuthorizationServerMetadata = z.infer<typeof oauthAuthorizationServerMetadataSchema>;
118
121
  export declare const oauthAuthorizationServerMetadataValidator: z.ZodEffects<z.ZodEffects<z.ZodObject<{
119
- issuer: z.ZodEffects<z.ZodString, string, string>;
122
+ issuer: z.ZodEffects<z.ZodEffects<z.ZodString, `http://[::1]${string}` | "http://localhost" | `http://localhost#${string}` | `http://localhost?${string}` | `http://localhost/${string}` | `http://localhost:${string}` | "http://127.0.0.1" | `http://127.0.0.1#${string}` | `http://127.0.0.1?${string}` | `http://127.0.0.1/${string}` | `http://127.0.0.1:${string}` | `https://${string}`, string>, `http://[::1]${string}` | "http://localhost" | `http://localhost#${string}` | `http://localhost?${string}` | `http://localhost/${string}` | `http://localhost:${string}` | "http://127.0.0.1" | `http://127.0.0.1#${string}` | `http://127.0.0.1?${string}` | `http://127.0.0.1/${string}` | `http://127.0.0.1:${string}` | `https://${string}`, string>;
120
123
  claims_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
121
124
  claims_locales_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
122
125
  claims_parameter_supported: z.ZodOptional<z.ZodBoolean>;
@@ -137,26 +140,26 @@ export declare const oauthAuthorizationServerMetadataValidator: z.ZodEffects<z.Z
137
140
  authorization_details_types_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
138
141
  request_object_encryption_alg_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
139
142
  request_object_encryption_enc_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
140
- jwks_uri: z.ZodOptional<z.ZodString>;
141
- authorization_endpoint: z.ZodString;
142
- token_endpoint: z.ZodString;
143
+ jwks_uri: z.ZodOptional<z.ZodEffects<z.ZodString, `http://[::1]${string}` | "http://localhost" | `http://localhost#${string}` | `http://localhost?${string}` | `http://localhost/${string}` | `http://localhost:${string}` | "http://127.0.0.1" | `http://127.0.0.1#${string}` | `http://127.0.0.1?${string}` | `http://127.0.0.1/${string}` | `http://127.0.0.1:${string}` | `https://${string}`, string>>;
144
+ authorization_endpoint: z.ZodEffects<z.ZodString, `http://[::1]${string}` | "http://localhost" | `http://localhost#${string}` | `http://localhost?${string}` | `http://localhost/${string}` | `http://localhost:${string}` | "http://127.0.0.1" | `http://127.0.0.1#${string}` | `http://127.0.0.1?${string}` | `http://127.0.0.1/${string}` | `http://127.0.0.1:${string}` | `https://${string}`, string>;
145
+ token_endpoint: z.ZodEffects<z.ZodString, `http://[::1]${string}` | "http://localhost" | `http://localhost#${string}` | `http://localhost?${string}` | `http://localhost/${string}` | `http://localhost:${string}` | "http://127.0.0.1" | `http://127.0.0.1#${string}` | `http://127.0.0.1?${string}` | `http://127.0.0.1/${string}` | `http://127.0.0.1:${string}` | `https://${string}`, string>;
143
146
  token_endpoint_auth_methods_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
144
147
  token_endpoint_auth_signing_alg_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
145
- revocation_endpoint: z.ZodOptional<z.ZodString>;
146
- introspection_endpoint: z.ZodOptional<z.ZodString>;
147
- pushed_authorization_request_endpoint: z.ZodOptional<z.ZodString>;
148
+ revocation_endpoint: z.ZodOptional<z.ZodEffects<z.ZodString, `http://[::1]${string}` | "http://localhost" | `http://localhost#${string}` | `http://localhost?${string}` | `http://localhost/${string}` | `http://localhost:${string}` | "http://127.0.0.1" | `http://127.0.0.1#${string}` | `http://127.0.0.1?${string}` | `http://127.0.0.1/${string}` | `http://127.0.0.1:${string}` | `https://${string}`, string>>;
149
+ introspection_endpoint: z.ZodOptional<z.ZodEffects<z.ZodString, `http://[::1]${string}` | "http://localhost" | `http://localhost#${string}` | `http://localhost?${string}` | `http://localhost/${string}` | `http://localhost:${string}` | "http://127.0.0.1" | `http://127.0.0.1#${string}` | `http://127.0.0.1?${string}` | `http://127.0.0.1/${string}` | `http://127.0.0.1:${string}` | `https://${string}`, string>>;
150
+ pushed_authorization_request_endpoint: z.ZodOptional<z.ZodEffects<z.ZodString, `http://[::1]${string}` | "http://localhost" | `http://localhost#${string}` | `http://localhost?${string}` | `http://localhost/${string}` | `http://localhost:${string}` | "http://127.0.0.1" | `http://127.0.0.1#${string}` | `http://127.0.0.1?${string}` | `http://127.0.0.1/${string}` | `http://127.0.0.1:${string}` | `https://${string}`, string>>;
148
151
  require_pushed_authorization_requests: z.ZodOptional<z.ZodBoolean>;
149
- userinfo_endpoint: z.ZodOptional<z.ZodString>;
150
- end_session_endpoint: z.ZodOptional<z.ZodString>;
151
- registration_endpoint: z.ZodOptional<z.ZodString>;
152
+ userinfo_endpoint: z.ZodOptional<z.ZodEffects<z.ZodString, `http://[::1]${string}` | "http://localhost" | `http://localhost#${string}` | `http://localhost?${string}` | `http://localhost/${string}` | `http://localhost:${string}` | "http://127.0.0.1" | `http://127.0.0.1#${string}` | `http://127.0.0.1?${string}` | `http://127.0.0.1/${string}` | `http://127.0.0.1:${string}` | `https://${string}`, string>>;
153
+ end_session_endpoint: z.ZodOptional<z.ZodEffects<z.ZodString, `http://[::1]${string}` | "http://localhost" | `http://localhost#${string}` | `http://localhost?${string}` | `http://localhost/${string}` | `http://localhost:${string}` | "http://127.0.0.1" | `http://127.0.0.1#${string}` | `http://127.0.0.1?${string}` | `http://127.0.0.1/${string}` | `http://127.0.0.1:${string}` | `https://${string}`, string>>;
154
+ registration_endpoint: z.ZodOptional<z.ZodEffects<z.ZodString, `http://[::1]${string}` | "http://localhost" | `http://localhost#${string}` | `http://localhost?${string}` | `http://localhost/${string}` | `http://localhost:${string}` | "http://127.0.0.1" | `http://127.0.0.1#${string}` | `http://127.0.0.1?${string}` | `http://127.0.0.1/${string}` | `http://127.0.0.1:${string}` | `https://${string}`, string>>;
152
155
  dpop_signing_alg_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
153
- protected_resources: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
156
+ protected_resources: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, `http://[::1]${string}` | "http://localhost" | `http://localhost#${string}` | `http://localhost?${string}` | `http://localhost/${string}` | `http://localhost:${string}` | "http://127.0.0.1" | `http://127.0.0.1#${string}` | `http://127.0.0.1?${string}` | `http://127.0.0.1/${string}` | `http://127.0.0.1:${string}` | `https://${string}`, string>, "many">>;
154
157
  client_id_metadata_document_supported: z.ZodOptional<z.ZodBoolean>;
155
158
  }, "strip", z.ZodTypeAny, {
156
- issuer: string;
157
- authorization_endpoint: string;
158
- token_endpoint: string;
159
- jwks_uri?: string | undefined;
159
+ issuer: `http://[::1]${string}` | "http://localhost" | `http://localhost#${string}` | `http://localhost?${string}` | `http://localhost/${string}` | `http://localhost:${string}` | "http://127.0.0.1" | `http://127.0.0.1#${string}` | `http://127.0.0.1?${string}` | `http://127.0.0.1/${string}` | `http://127.0.0.1:${string}` | `https://${string}`;
160
+ authorization_endpoint: `http://[::1]${string}` | "http://localhost" | `http://localhost#${string}` | `http://localhost?${string}` | `http://localhost/${string}` | `http://localhost:${string}` | "http://127.0.0.1" | `http://127.0.0.1#${string}` | `http://127.0.0.1?${string}` | `http://127.0.0.1/${string}` | `http://127.0.0.1:${string}` | `https://${string}`;
161
+ token_endpoint: `http://[::1]${string}` | "http://localhost" | `http://localhost#${string}` | `http://localhost?${string}` | `http://localhost/${string}` | `http://localhost:${string}` | "http://127.0.0.1" | `http://127.0.0.1#${string}` | `http://127.0.0.1?${string}` | `http://127.0.0.1/${string}` | `http://127.0.0.1:${string}` | `https://${string}`;
162
+ jwks_uri?: `http://[::1]${string}` | "http://localhost" | `http://localhost#${string}` | `http://localhost?${string}` | `http://localhost/${string}` | `http://localhost:${string}` | "http://127.0.0.1" | `http://127.0.0.1#${string}` | `http://127.0.0.1?${string}` | `http://127.0.0.1/${string}` | `http://127.0.0.1:${string}` | `https://${string}` | undefined;
160
163
  claims_supported?: string[] | undefined;
161
164
  claims_locales_supported?: string[] | undefined;
162
165
  claims_parameter_supported?: boolean | undefined;
@@ -179,15 +182,15 @@ export declare const oauthAuthorizationServerMetadataValidator: z.ZodEffects<z.Z
179
182
  request_object_encryption_enc_values_supported?: string[] | undefined;
180
183
  token_endpoint_auth_methods_supported?: string[] | undefined;
181
184
  token_endpoint_auth_signing_alg_values_supported?: string[] | undefined;
182
- revocation_endpoint?: string | undefined;
183
- introspection_endpoint?: string | undefined;
184
- pushed_authorization_request_endpoint?: string | undefined;
185
+ revocation_endpoint?: `http://[::1]${string}` | "http://localhost" | `http://localhost#${string}` | `http://localhost?${string}` | `http://localhost/${string}` | `http://localhost:${string}` | "http://127.0.0.1" | `http://127.0.0.1#${string}` | `http://127.0.0.1?${string}` | `http://127.0.0.1/${string}` | `http://127.0.0.1:${string}` | `https://${string}` | undefined;
186
+ introspection_endpoint?: `http://[::1]${string}` | "http://localhost" | `http://localhost#${string}` | `http://localhost?${string}` | `http://localhost/${string}` | `http://localhost:${string}` | "http://127.0.0.1" | `http://127.0.0.1#${string}` | `http://127.0.0.1?${string}` | `http://127.0.0.1/${string}` | `http://127.0.0.1:${string}` | `https://${string}` | undefined;
187
+ pushed_authorization_request_endpoint?: `http://[::1]${string}` | "http://localhost" | `http://localhost#${string}` | `http://localhost?${string}` | `http://localhost/${string}` | `http://localhost:${string}` | "http://127.0.0.1" | `http://127.0.0.1#${string}` | `http://127.0.0.1?${string}` | `http://127.0.0.1/${string}` | `http://127.0.0.1:${string}` | `https://${string}` | undefined;
185
188
  require_pushed_authorization_requests?: boolean | undefined;
186
- userinfo_endpoint?: string | undefined;
187
- end_session_endpoint?: string | undefined;
188
- registration_endpoint?: string | undefined;
189
+ userinfo_endpoint?: `http://[::1]${string}` | "http://localhost" | `http://localhost#${string}` | `http://localhost?${string}` | `http://localhost/${string}` | `http://localhost:${string}` | "http://127.0.0.1" | `http://127.0.0.1#${string}` | `http://127.0.0.1?${string}` | `http://127.0.0.1/${string}` | `http://127.0.0.1:${string}` | `https://${string}` | undefined;
190
+ end_session_endpoint?: `http://[::1]${string}` | "http://localhost" | `http://localhost#${string}` | `http://localhost?${string}` | `http://localhost/${string}` | `http://localhost:${string}` | "http://127.0.0.1" | `http://127.0.0.1#${string}` | `http://127.0.0.1?${string}` | `http://127.0.0.1/${string}` | `http://127.0.0.1:${string}` | `https://${string}` | undefined;
191
+ registration_endpoint?: `http://[::1]${string}` | "http://localhost" | `http://localhost#${string}` | `http://localhost?${string}` | `http://localhost/${string}` | `http://localhost:${string}` | "http://127.0.0.1" | `http://127.0.0.1#${string}` | `http://127.0.0.1?${string}` | `http://127.0.0.1/${string}` | `http://127.0.0.1:${string}` | `https://${string}` | undefined;
189
192
  dpop_signing_alg_values_supported?: string[] | undefined;
190
- protected_resources?: string[] | undefined;
193
+ protected_resources?: (`http://[::1]${string}` | "http://localhost" | `http://localhost#${string}` | `http://localhost?${string}` | `http://localhost/${string}` | `http://localhost:${string}` | "http://127.0.0.1" | `http://127.0.0.1#${string}` | `http://127.0.0.1?${string}` | `http://127.0.0.1/${string}` | `http://127.0.0.1:${string}` | `https://${string}`)[] | undefined;
191
194
  client_id_metadata_document_supported?: boolean | undefined;
192
195
  }, {
193
196
  issuer: string;
@@ -227,10 +230,10 @@ export declare const oauthAuthorizationServerMetadataValidator: z.ZodEffects<z.Z
227
230
  protected_resources?: string[] | undefined;
228
231
  client_id_metadata_document_supported?: boolean | undefined;
229
232
  }>, {
230
- issuer: string;
231
- authorization_endpoint: string;
232
- token_endpoint: string;
233
- jwks_uri?: string | undefined;
233
+ issuer: `http://[::1]${string}` | "http://localhost" | `http://localhost#${string}` | `http://localhost?${string}` | `http://localhost/${string}` | `http://localhost:${string}` | "http://127.0.0.1" | `http://127.0.0.1#${string}` | `http://127.0.0.1?${string}` | `http://127.0.0.1/${string}` | `http://127.0.0.1:${string}` | `https://${string}`;
234
+ authorization_endpoint: `http://[::1]${string}` | "http://localhost" | `http://localhost#${string}` | `http://localhost?${string}` | `http://localhost/${string}` | `http://localhost:${string}` | "http://127.0.0.1" | `http://127.0.0.1#${string}` | `http://127.0.0.1?${string}` | `http://127.0.0.1/${string}` | `http://127.0.0.1:${string}` | `https://${string}`;
235
+ token_endpoint: `http://[::1]${string}` | "http://localhost" | `http://localhost#${string}` | `http://localhost?${string}` | `http://localhost/${string}` | `http://localhost:${string}` | "http://127.0.0.1" | `http://127.0.0.1#${string}` | `http://127.0.0.1?${string}` | `http://127.0.0.1/${string}` | `http://127.0.0.1:${string}` | `https://${string}`;
236
+ jwks_uri?: `http://[::1]${string}` | "http://localhost" | `http://localhost#${string}` | `http://localhost?${string}` | `http://localhost/${string}` | `http://localhost:${string}` | "http://127.0.0.1" | `http://127.0.0.1#${string}` | `http://127.0.0.1?${string}` | `http://127.0.0.1/${string}` | `http://127.0.0.1:${string}` | `https://${string}` | undefined;
234
237
  claims_supported?: string[] | undefined;
235
238
  claims_locales_supported?: string[] | undefined;
236
239
  claims_parameter_supported?: boolean | undefined;
@@ -253,15 +256,15 @@ export declare const oauthAuthorizationServerMetadataValidator: z.ZodEffects<z.Z
253
256
  request_object_encryption_enc_values_supported?: string[] | undefined;
254
257
  token_endpoint_auth_methods_supported?: string[] | undefined;
255
258
  token_endpoint_auth_signing_alg_values_supported?: string[] | undefined;
256
- revocation_endpoint?: string | undefined;
257
- introspection_endpoint?: string | undefined;
258
- pushed_authorization_request_endpoint?: string | undefined;
259
+ revocation_endpoint?: `http://[::1]${string}` | "http://localhost" | `http://localhost#${string}` | `http://localhost?${string}` | `http://localhost/${string}` | `http://localhost:${string}` | "http://127.0.0.1" | `http://127.0.0.1#${string}` | `http://127.0.0.1?${string}` | `http://127.0.0.1/${string}` | `http://127.0.0.1:${string}` | `https://${string}` | undefined;
260
+ introspection_endpoint?: `http://[::1]${string}` | "http://localhost" | `http://localhost#${string}` | `http://localhost?${string}` | `http://localhost/${string}` | `http://localhost:${string}` | "http://127.0.0.1" | `http://127.0.0.1#${string}` | `http://127.0.0.1?${string}` | `http://127.0.0.1/${string}` | `http://127.0.0.1:${string}` | `https://${string}` | undefined;
261
+ pushed_authorization_request_endpoint?: `http://[::1]${string}` | "http://localhost" | `http://localhost#${string}` | `http://localhost?${string}` | `http://localhost/${string}` | `http://localhost:${string}` | "http://127.0.0.1" | `http://127.0.0.1#${string}` | `http://127.0.0.1?${string}` | `http://127.0.0.1/${string}` | `http://127.0.0.1:${string}` | `https://${string}` | undefined;
259
262
  require_pushed_authorization_requests?: boolean | undefined;
260
- userinfo_endpoint?: string | undefined;
261
- end_session_endpoint?: string | undefined;
262
- registration_endpoint?: string | undefined;
263
+ userinfo_endpoint?: `http://[::1]${string}` | "http://localhost" | `http://localhost#${string}` | `http://localhost?${string}` | `http://localhost/${string}` | `http://localhost:${string}` | "http://127.0.0.1" | `http://127.0.0.1#${string}` | `http://127.0.0.1?${string}` | `http://127.0.0.1/${string}` | `http://127.0.0.1:${string}` | `https://${string}` | undefined;
264
+ end_session_endpoint?: `http://[::1]${string}` | "http://localhost" | `http://localhost#${string}` | `http://localhost?${string}` | `http://localhost/${string}` | `http://localhost:${string}` | "http://127.0.0.1" | `http://127.0.0.1#${string}` | `http://127.0.0.1?${string}` | `http://127.0.0.1/${string}` | `http://127.0.0.1:${string}` | `https://${string}` | undefined;
265
+ registration_endpoint?: `http://[::1]${string}` | "http://localhost" | `http://localhost#${string}` | `http://localhost?${string}` | `http://localhost/${string}` | `http://localhost:${string}` | "http://127.0.0.1" | `http://127.0.0.1#${string}` | `http://127.0.0.1?${string}` | `http://127.0.0.1/${string}` | `http://127.0.0.1:${string}` | `https://${string}` | undefined;
263
266
  dpop_signing_alg_values_supported?: string[] | undefined;
264
- protected_resources?: string[] | undefined;
267
+ protected_resources?: (`http://[::1]${string}` | "http://localhost" | `http://localhost#${string}` | `http://localhost?${string}` | `http://localhost/${string}` | `http://localhost:${string}` | "http://127.0.0.1" | `http://127.0.0.1#${string}` | `http://127.0.0.1?${string}` | `http://127.0.0.1/${string}` | `http://127.0.0.1:${string}` | `https://${string}`)[] | undefined;
265
268
  client_id_metadata_document_supported?: boolean | undefined;
266
269
  }, {
267
270
  issuer: string;
@@ -301,10 +304,10 @@ export declare const oauthAuthorizationServerMetadataValidator: z.ZodEffects<z.Z
301
304
  protected_resources?: string[] | undefined;
302
305
  client_id_metadata_document_supported?: boolean | undefined;
303
306
  }>, {
304
- issuer: string;
305
- authorization_endpoint: string;
306
- token_endpoint: string;
307
- jwks_uri?: string | undefined;
307
+ issuer: `http://[::1]${string}` | "http://localhost" | `http://localhost#${string}` | `http://localhost?${string}` | `http://localhost/${string}` | `http://localhost:${string}` | "http://127.0.0.1" | `http://127.0.0.1#${string}` | `http://127.0.0.1?${string}` | `http://127.0.0.1/${string}` | `http://127.0.0.1:${string}` | `https://${string}`;
308
+ authorization_endpoint: `http://[::1]${string}` | "http://localhost" | `http://localhost#${string}` | `http://localhost?${string}` | `http://localhost/${string}` | `http://localhost:${string}` | "http://127.0.0.1" | `http://127.0.0.1#${string}` | `http://127.0.0.1?${string}` | `http://127.0.0.1/${string}` | `http://127.0.0.1:${string}` | `https://${string}`;
309
+ token_endpoint: `http://[::1]${string}` | "http://localhost" | `http://localhost#${string}` | `http://localhost?${string}` | `http://localhost/${string}` | `http://localhost:${string}` | "http://127.0.0.1" | `http://127.0.0.1#${string}` | `http://127.0.0.1?${string}` | `http://127.0.0.1/${string}` | `http://127.0.0.1:${string}` | `https://${string}`;
310
+ jwks_uri?: `http://[::1]${string}` | "http://localhost" | `http://localhost#${string}` | `http://localhost?${string}` | `http://localhost/${string}` | `http://localhost:${string}` | "http://127.0.0.1" | `http://127.0.0.1#${string}` | `http://127.0.0.1?${string}` | `http://127.0.0.1/${string}` | `http://127.0.0.1:${string}` | `https://${string}` | undefined;
308
311
  claims_supported?: string[] | undefined;
309
312
  claims_locales_supported?: string[] | undefined;
310
313
  claims_parameter_supported?: boolean | undefined;
@@ -327,15 +330,15 @@ export declare const oauthAuthorizationServerMetadataValidator: z.ZodEffects<z.Z
327
330
  request_object_encryption_enc_values_supported?: string[] | undefined;
328
331
  token_endpoint_auth_methods_supported?: string[] | undefined;
329
332
  token_endpoint_auth_signing_alg_values_supported?: string[] | undefined;
330
- revocation_endpoint?: string | undefined;
331
- introspection_endpoint?: string | undefined;
332
- pushed_authorization_request_endpoint?: string | undefined;
333
+ revocation_endpoint?: `http://[::1]${string}` | "http://localhost" | `http://localhost#${string}` | `http://localhost?${string}` | `http://localhost/${string}` | `http://localhost:${string}` | "http://127.0.0.1" | `http://127.0.0.1#${string}` | `http://127.0.0.1?${string}` | `http://127.0.0.1/${string}` | `http://127.0.0.1:${string}` | `https://${string}` | undefined;
334
+ introspection_endpoint?: `http://[::1]${string}` | "http://localhost" | `http://localhost#${string}` | `http://localhost?${string}` | `http://localhost/${string}` | `http://localhost:${string}` | "http://127.0.0.1" | `http://127.0.0.1#${string}` | `http://127.0.0.1?${string}` | `http://127.0.0.1/${string}` | `http://127.0.0.1:${string}` | `https://${string}` | undefined;
335
+ pushed_authorization_request_endpoint?: `http://[::1]${string}` | "http://localhost" | `http://localhost#${string}` | `http://localhost?${string}` | `http://localhost/${string}` | `http://localhost:${string}` | "http://127.0.0.1" | `http://127.0.0.1#${string}` | `http://127.0.0.1?${string}` | `http://127.0.0.1/${string}` | `http://127.0.0.1:${string}` | `https://${string}` | undefined;
333
336
  require_pushed_authorization_requests?: boolean | undefined;
334
- userinfo_endpoint?: string | undefined;
335
- end_session_endpoint?: string | undefined;
336
- registration_endpoint?: string | undefined;
337
+ userinfo_endpoint?: `http://[::1]${string}` | "http://localhost" | `http://localhost#${string}` | `http://localhost?${string}` | `http://localhost/${string}` | `http://localhost:${string}` | "http://127.0.0.1" | `http://127.0.0.1#${string}` | `http://127.0.0.1?${string}` | `http://127.0.0.1/${string}` | `http://127.0.0.1:${string}` | `https://${string}` | undefined;
338
+ end_session_endpoint?: `http://[::1]${string}` | "http://localhost" | `http://localhost#${string}` | `http://localhost?${string}` | `http://localhost/${string}` | `http://localhost:${string}` | "http://127.0.0.1" | `http://127.0.0.1#${string}` | `http://127.0.0.1?${string}` | `http://127.0.0.1/${string}` | `http://127.0.0.1:${string}` | `https://${string}` | undefined;
339
+ registration_endpoint?: `http://[::1]${string}` | "http://localhost" | `http://localhost#${string}` | `http://localhost?${string}` | `http://localhost/${string}` | `http://localhost:${string}` | "http://127.0.0.1" | `http://127.0.0.1#${string}` | `http://127.0.0.1?${string}` | `http://127.0.0.1/${string}` | `http://127.0.0.1:${string}` | `https://${string}` | undefined;
337
340
  dpop_signing_alg_values_supported?: string[] | undefined;
338
- protected_resources?: string[] | undefined;
341
+ protected_resources?: (`http://[::1]${string}` | "http://localhost" | `http://localhost#${string}` | `http://localhost?${string}` | `http://localhost/${string}` | `http://localhost:${string}` | "http://127.0.0.1" | `http://127.0.0.1#${string}` | `http://127.0.0.1?${string}` | `http://127.0.0.1/${string}` | `http://127.0.0.1:${string}` | `https://${string}`)[] | undefined;
339
342
  client_id_metadata_document_supported?: boolean | undefined;
340
343
  }, {
341
344
  issuer: string;
@@ -1 +1 @@
1
- {"version":3,"file":"oauth-authorization-server-metadata.d.ts","sourceRoot":"","sources":["../src/oauth-authorization-server-metadata.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAKvB;;GAEG;AACH,eAAO,MAAM,sCAAsC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2DjD,CAAA;AAEF,MAAM,MAAM,gCAAgC,GAAG,CAAC,CAAC,KAAK,CACpD,OAAO,sCAAsC,CAC9C,CAAA;AAED,eAAO,MAAM,yCAAyC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuBhD,CAAA"}
1
+ {"version":3,"file":"oauth-authorization-server-metadata.d.ts","sourceRoot":"","sources":["../src/oauth-authorization-server-metadata.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAMvB;;;;;GAKG;AACH,eAAO,MAAM,sCAAsC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2DjD,CAAA;AAEF,MAAM,MAAM,gCAAgC,GAAG,CAAC,CAAC,KAAK,CACpD,OAAO,sCAAsC,CAC9C,CAAA;AAED,eAAO,MAAM,yCAAyC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuBhD,CAAA"}
@@ -4,8 +4,12 @@ exports.oauthAuthorizationServerMetadataValidator = exports.oauthAuthorizationSe
4
4
  const zod_1 = require("zod");
5
5
  const oauth_code_challenge_method_js_1 = require("./oauth-code-challenge-method.js");
6
6
  const oauth_issuer_identifier_js_1 = require("./oauth-issuer-identifier.js");
7
+ const uri_js_1 = require("./uri.js");
7
8
  /**
8
9
  * @see {@link https://datatracker.ietf.org/doc/html/rfc8414}
10
+ * @note we do not enforce https: scheme in URIs to support development
11
+ * environments. Make sure to validate the URIs before using it in a production
12
+ * environment.
9
13
  */
10
14
  exports.oauthAuthorizationServerMetadataSchema = zod_1.z.object({
11
15
  issuer: oauth_issuer_identifier_js_1.oauthIssuerIdentifierSchema,
@@ -36,24 +40,24 @@ exports.oauthAuthorizationServerMetadataSchema = zod_1.z.object({
36
40
  request_object_encryption_enc_values_supported: zod_1.z
37
41
  .array(zod_1.z.string())
38
42
  .optional(),
39
- jwks_uri: zod_1.z.string().url().optional(),
40
- authorization_endpoint: zod_1.z.string().url(), // .optional(),
41
- token_endpoint: zod_1.z.string().url(), // .optional(),
43
+ jwks_uri: uri_js_1.webUriSchema.optional(),
44
+ authorization_endpoint: uri_js_1.webUriSchema, // .optional(),
45
+ token_endpoint: uri_js_1.webUriSchema, // .optional(),
42
46
  token_endpoint_auth_methods_supported: zod_1.z.array(zod_1.z.string()).optional(),
43
47
  token_endpoint_auth_signing_alg_values_supported: zod_1.z
44
48
  .array(zod_1.z.string())
45
49
  .optional(),
46
- revocation_endpoint: zod_1.z.string().url().optional(),
47
- introspection_endpoint: zod_1.z.string().url().optional(),
48
- pushed_authorization_request_endpoint: zod_1.z.string().url().optional(),
50
+ revocation_endpoint: uri_js_1.webUriSchema.optional(),
51
+ introspection_endpoint: uri_js_1.webUriSchema.optional(),
52
+ pushed_authorization_request_endpoint: uri_js_1.webUriSchema.optional(),
49
53
  require_pushed_authorization_requests: zod_1.z.boolean().optional(),
50
- userinfo_endpoint: zod_1.z.string().url().optional(),
51
- end_session_endpoint: zod_1.z.string().url().optional(),
52
- registration_endpoint: zod_1.z.string().url().optional(),
54
+ userinfo_endpoint: uri_js_1.webUriSchema.optional(),
55
+ end_session_endpoint: uri_js_1.webUriSchema.optional(),
56
+ registration_endpoint: uri_js_1.webUriSchema.optional(),
53
57
  // https://datatracker.ietf.org/doc/html/rfc9449#section-5.1
54
58
  dpop_signing_alg_values_supported: zod_1.z.array(zod_1.z.string()).optional(),
55
59
  // https://datatracker.ietf.org/doc/html/draft-ietf-oauth-resource-metadata-05#section-4
56
- protected_resources: zod_1.z.array(zod_1.z.string().url()).optional(),
60
+ protected_resources: zod_1.z.array(uri_js_1.webUriSchema).optional(),
57
61
  // https://drafts.aaronpk.com/draft-parecki-oauth-client-id-metadata-document/draft-parecki-oauth-client-id-metadata-document.html
58
62
  client_id_metadata_document_supported: zod_1.z.boolean().optional(),
59
63
  });
@@ -1 +1 @@
1
- {"version":3,"file":"oauth-authorization-server-metadata.js","sourceRoot":"","sources":["../src/oauth-authorization-server-metadata.ts"],"names":[],"mappings":";;;AAAA,6BAAuB;AAEvB,qFAAiF;AAC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AC5C,CAAC,CAAA;QACJ,CAAC;IACH,CAAC;AACH,CAAC,CAAC,CAAA"}
@@ -1,8 +1,9 @@
1
- import { OAuthClientId } from './oauth-client-id.js';
1
+ import { TypeOf, z } from 'zod';
2
2
  /**
3
3
  * @see {@link https://drafts.aaronpk.com/draft-parecki-oauth-client-id-metadata-document/draft-parecki-oauth-client-id-metadata-document.html}
4
4
  */
5
- export type OAuthClientIdDiscoverable = OAuthClientId & `https://${string}`;
5
+ export declare const oauthClientIdDiscoverableSchema: z.ZodEffects<z.ZodIntersection<z.ZodString, z.ZodEffects<z.ZodEffects<z.ZodString, `${string}:${string}`, string>, `https://${string}`, string>>, `https://${string}/${string}`, string>;
6
+ export type OAuthClientIdDiscoverable = TypeOf<typeof oauthClientIdDiscoverableSchema>;
6
7
  export declare function isOAuthClientIdDiscoverable(clientId: string): clientId is OAuthClientIdDiscoverable;
7
8
  export declare function assertOAuthDiscoverableClientId(value: string): asserts value is OAuthClientIdDiscoverable;
8
9
  export declare function parseOAuthDiscoverableClientId(clientId: string): URL;
@@ -1 +1 @@
1
- {"version":3,"file":"oauth-client-id-discoverable.d.ts","sourceRoot":"","sources":["../src/oauth-client-id-discoverable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAGpD;;GAEG;AACH,MAAM,MAAM,yBAAyB,GAAG,aAAa,GAAG,WAAW,MAAM,EAAE,CAAA;AAE3E,wBAAgB,2BAA2B,CACzC,QAAQ,EAAE,MAAM,GACf,QAAQ,IAAI,yBAAyB,CAOvC;AAED,wBAAgB,+BAA+B,CAC7C,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,KAAK,IAAI,yBAAyB,CAE5C;AAED,wBAAgB,8BAA8B,CAAC,QAAQ,EAAE,MAAM,GAAG,GAAG,CA2CpE"}
1
+ {"version":3,"file":"oauth-client-id-discoverable.d.ts","sourceRoot":"","sources":["../src/oauth-client-id-discoverable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAK/B;;GAEG;AACH,eAAO,MAAM,+BAA+B,0LA0DxC,CAAA;AAEJ,MAAM,MAAM,yBAAyB,GAAG,MAAM,CAC5C,OAAO,+BAA+B,CACvC,CAAA;AAED,wBAAgB,2BAA2B,CACzC,QAAQ,EAAE,MAAM,GACf,QAAQ,IAAI,yBAAyB,CAEvC;AAED,wBAAgB,+BAA+B,CAC7C,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,KAAK,IAAI,yBAAyB,CAE5C;AAED,wBAAgB,8BAA8B,CAAC,QAAQ,EAAE,MAAM,GAAG,GAAG,CAEpE"}
@@ -1,51 +1,74 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.parseOAuthDiscoverableClientId = exports.assertOAuthDiscoverableClientId = exports.isOAuthClientIdDiscoverable = void 0;
4
- const util_js_1 = require("./util.js");
5
- function isOAuthClientIdDiscoverable(clientId) {
6
- try {
7
- parseOAuthDiscoverableClientId(clientId);
8
- return true;
9
- }
10
- catch {
11
- return false;
12
- }
13
- }
3
+ exports.oauthClientIdDiscoverableSchema = void 0;
14
4
  exports.isOAuthClientIdDiscoverable = isOAuthClientIdDiscoverable;
15
- function assertOAuthDiscoverableClientId(value) {
16
- void parseOAuthDiscoverableClientId(value);
17
- }
18
5
  exports.assertOAuthDiscoverableClientId = assertOAuthDiscoverableClientId;
19
- function parseOAuthDiscoverableClientId(clientId) {
20
- const url = new URL(clientId);
21
- if (url.protocol !== 'https:') {
22
- throw new TypeError('ClientID must use the "https:" protocol');
23
- }
6
+ exports.parseOAuthDiscoverableClientId = parseOAuthDiscoverableClientId;
7
+ const zod_1 = require("zod");
8
+ const oauth_client_id_js_1 = require("./oauth-client-id.js");
9
+ const uri_js_1 = require("./uri.js");
10
+ const util_js_1 = require("./util.js");
11
+ /**
12
+ * @see {@link https://drafts.aaronpk.com/draft-parecki-oauth-client-id-metadata-document/draft-parecki-oauth-client-id-metadata-document.html}
13
+ */
14
+ exports.oauthClientIdDiscoverableSchema = zod_1.z
15
+ .intersection(oauth_client_id_js_1.oauthClientIdSchema, uri_js_1.httpsUriSchema)
16
+ .superRefine((value, ctx) => {
17
+ const url = new URL(value);
24
18
  if (url.username || url.password) {
25
- throw new TypeError('ClientID must not contain credentials');
19
+ ctx.addIssue({
20
+ code: zod_1.z.ZodIssueCode.custom,
21
+ message: 'ClientID must not contain credentials',
22
+ });
23
+ return false;
26
24
  }
27
25
  if (url.hash) {
28
- throw new TypeError('ClientID must not contain a fragment');
29
- }
30
- if (url.hostname === 'localhost') {
31
- throw new TypeError('ClientID hostname must not be "localhost"');
26
+ ctx.addIssue({
27
+ code: zod_1.z.ZodIssueCode.custom,
28
+ message: 'ClientID must not contain a fragment',
29
+ });
30
+ return false;
32
31
  }
33
32
  if (url.pathname === '/') {
34
- throw new TypeError('ClientID must contain a path component (e.g. "/client-metadata.json")');
33
+ ctx.addIssue({
34
+ code: zod_1.z.ZodIssueCode.custom,
35
+ message: 'ClientID must contain a path component (e.g. "/client-metadata.json")',
36
+ });
37
+ return false;
35
38
  }
36
39
  if (url.pathname.endsWith('/')) {
37
- throw new TypeError('ClientID path must not end with a trailing slash');
40
+ ctx.addIssue({
41
+ code: zod_1.z.ZodIssueCode.custom,
42
+ message: 'ClientID path must not end with a trailing slash',
43
+ });
44
+ return false;
38
45
  }
39
46
  if ((0, util_js_1.isHostnameIP)(url.hostname)) {
40
- throw new TypeError('ClientID hostname must not be an IP address');
47
+ ctx.addIssue({
48
+ code: zod_1.z.ZodIssueCode.custom,
49
+ message: 'ClientID hostname must not be an IP address',
50
+ });
51
+ return false;
41
52
  }
42
53
  // URL constructor normalizes the URL, so we extract the path manually to
43
54
  // avoid normalization, then compare it to the normalized path to ensure
44
55
  // that the URL does not contain path traversal or other unexpected characters
45
- if ((0, util_js_1.extractUrlPath)(clientId) !== url.pathname) {
46
- throw new TypeError(`ClientID must be in canonical form ("${url.href}", got "${clientId}")`);
56
+ if ((0, util_js_1.extractUrlPath)(value) !== url.pathname) {
57
+ ctx.addIssue({
58
+ code: zod_1.z.ZodIssueCode.custom,
59
+ message: `ClientID must be in canonical form ("${url.href}", got "${value}")`,
60
+ });
61
+ return false;
47
62
  }
48
- return url;
63
+ return true;
64
+ });
65
+ function isOAuthClientIdDiscoverable(clientId) {
66
+ return exports.oauthClientIdDiscoverableSchema.safeParse(clientId).success;
67
+ }
68
+ function assertOAuthDiscoverableClientId(value) {
69
+ void exports.oauthClientIdDiscoverableSchema.parse(value);
70
+ }
71
+ function parseOAuthDiscoverableClientId(clientId) {
72
+ return new URL(exports.oauthClientIdDiscoverableSchema.parse(clientId));
49
73
  }
50
- exports.parseOAuthDiscoverableClientId = parseOAuthDiscoverableClientId;
51
74
  //# sourceMappingURL=oauth-client-id-discoverable.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"oauth-client-id-discoverable.js","sourceRoot":"","sources":["../src/oauth-client-id-discoverable.ts"],"names":[],"mappings":";;;AACA,uCAAwD;AAOxD,SAAgB,2BAA2B,CACzC,QAAgB;IAEhB,IAAI,CAAC;QACH,8BAA8B,CAAC,QAAQ,CAAC,CAAA;QACxC,OAAO,IAAI,CAAA;IACb,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAA;IACd,CAAC;AACH,CAAC;AATD,kEASC;AAED,SAAgB,+BAA+B,CAC7C,KAAa;IAEb,KAAK,8BAA8B,CAAC,KAAK,CAAC,CAAA;AAC5C,CAAC;AAJD,0EAIC;AAED,SAAgB,8BAA8B,CAAC,QAAgB;IAC7D,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,QAAQ,CAAC,CAAA;IAE7B,IAAI,GAAG,CAAC,QAAQ,KAAK,QAAQ,EAAE,CAAC;QAC9B,MAAM,IAAI,SAAS,CAAC,yCAAyC,CAAC,CAAA;IAChE,CAAC;IAED,IAAI,GAAG,CAAC,QAAQ,IAAI,GAAG,CAAC,QAAQ,EAAE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