@atproto/oauth-types 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (146) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/LICENSE.txt +7 -0
  3. package/README.md +3 -0
  4. package/dist/access-token.d.ts +4 -0
  5. package/dist/access-token.d.ts.map +1 -0
  6. package/dist/access-token.js +6 -0
  7. package/dist/access-token.js.map +1 -0
  8. package/dist/atproto-loopback-client-metadata.d.ts +3 -0
  9. package/dist/atproto-loopback-client-metadata.d.ts.map +1 -0
  10. package/dist/atproto-loopback-client-metadata.js +26 -0
  11. package/dist/atproto-loopback-client-metadata.js.map +1 -0
  12. package/dist/constants.d.ts +3 -0
  13. package/dist/constants.d.ts.map +1 -0
  14. package/dist/constants.js +11 -0
  15. package/dist/constants.js.map +1 -0
  16. package/dist/index.d.ts +27 -0
  17. package/dist/index.d.ts.map +1 -0
  18. package/dist/index.js +43 -0
  19. package/dist/index.js.map +1 -0
  20. package/dist/oauth-authentication-request-parameters.d.ts +128 -0
  21. package/dist/oauth-authentication-request-parameters.d.ts.map +1 -0
  22. package/dist/oauth-authentication-request-parameters.js +76 -0
  23. package/dist/oauth-authentication-request-parameters.js.map +1 -0
  24. package/dist/oauth-authorization-details.d.ts +54 -0
  25. package/dist/oauth-authorization-details.d.ts.map +1 -0
  26. package/dist/oauth-authorization-details.js +20 -0
  27. package/dist/oauth-authorization-details.js.map +1 -0
  28. package/dist/oauth-authorization-server-metadata.d.ts +428 -0
  29. package/dist/oauth-authorization-server-metadata.d.ts.map +1 -0
  30. package/dist/oauth-authorization-server-metadata.js +88 -0
  31. package/dist/oauth-authorization-server-metadata.js.map +1 -0
  32. package/dist/oauth-client-credentials.d.ts +66 -0
  33. package/dist/oauth-client-credentials.d.ts.map +1 -0
  34. package/dist/oauth-client-credentials.js +30 -0
  35. package/dist/oauth-client-credentials.js.map +1 -0
  36. package/dist/oauth-client-id-discoverable.d.ts +8 -0
  37. package/dist/oauth-client-id-discoverable.d.ts.map +1 -0
  38. package/dist/oauth-client-id-discoverable.js +48 -0
  39. package/dist/oauth-client-id-discoverable.js.map +1 -0
  40. package/dist/oauth-client-id-loopback.d.ts +5 -0
  41. package/dist/oauth-client-id-loopback.d.ts.map +1 -0
  42. package/dist/oauth-client-id-loopback.js +44 -0
  43. package/dist/oauth-client-id-loopback.js.map +1 -0
  44. package/dist/oauth-client-id-url.d.ts +3 -0
  45. package/dist/oauth-client-id-url.d.ts.map +1 -0
  46. package/dist/oauth-client-id-url.js +21 -0
  47. package/dist/oauth-client-id-url.js.map +1 -0
  48. package/dist/oauth-client-id.d.ts +4 -0
  49. package/dist/oauth-client-id.d.ts.map +1 -0
  50. package/dist/oauth-client-id.js +6 -0
  51. package/dist/oauth-client-id.js.map +1 -0
  52. package/dist/oauth-client-identification.d.ts +31 -0
  53. package/dist/oauth-client-identification.d.ts.map +1 -0
  54. package/dist/oauth-client-identification.js +12 -0
  55. package/dist/oauth-client-identification.js.map +1 -0
  56. package/dist/oauth-client-metadata.d.ts +1576 -0
  57. package/dist/oauth-client-metadata.d.ts.map +1 -0
  58. package/dist/oauth-client-metadata.js +70 -0
  59. package/dist/oauth-client-metadata.js.map +1 -0
  60. package/dist/oauth-endpoint-auth-method.d.ts +4 -0
  61. package/dist/oauth-endpoint-auth-method.d.ts.map +1 -0
  62. package/dist/oauth-endpoint-auth-method.js +14 -0
  63. package/dist/oauth-endpoint-auth-method.js.map +1 -0
  64. package/dist/oauth-endpoint-name.d.ts +2 -0
  65. package/dist/oauth-endpoint-name.d.ts.map +1 -0
  66. package/dist/oauth-endpoint-name.js +3 -0
  67. package/dist/oauth-endpoint-name.js.map +1 -0
  68. package/dist/oauth-grant-type.d.ts +4 -0
  69. package/dist/oauth-grant-type.d.ts.map +1 -0
  70. package/dist/oauth-grant-type.js +14 -0
  71. package/dist/oauth-grant-type.js.map +1 -0
  72. package/dist/oauth-issuer-identifier.d.ts +3 -0
  73. package/dist/oauth-issuer-identifier.d.ts.map +1 -0
  74. package/dist/oauth-issuer-identifier.js +59 -0
  75. package/dist/oauth-issuer-identifier.js.map +1 -0
  76. package/dist/oauth-par-response.d.ts +10 -0
  77. package/dist/oauth-par-response.d.ts.map +1 -0
  78. package/dist/oauth-par-response.js +8 -0
  79. package/dist/oauth-par-response.js.map +1 -0
  80. package/dist/oauth-protected-resource-metadata.d.ts +90 -0
  81. package/dist/oauth-protected-resource-metadata.d.ts.map +1 -0
  82. package/dist/oauth-protected-resource-metadata.js +75 -0
  83. package/dist/oauth-protected-resource-metadata.js.map +1 -0
  84. package/dist/oauth-response-mode.d.ts +4 -0
  85. package/dist/oauth-response-mode.d.ts.map +1 -0
  86. package/dist/oauth-response-mode.js +10 -0
  87. package/dist/oauth-response-mode.js.map +1 -0
  88. package/dist/oauth-response-type.d.ts +4 -0
  89. package/dist/oauth-response-type.d.ts.map +1 -0
  90. package/dist/oauth-response-type.js +17 -0
  91. package/dist/oauth-response-type.js.map +1 -0
  92. package/dist/oauth-token-response.d.ts +103 -0
  93. package/dist/oauth-token-response.d.ts.map +1 -0
  94. package/dist/oauth-token-response.js +26 -0
  95. package/dist/oauth-token-response.js.map +1 -0
  96. package/dist/oauth-token-type.d.ts +4 -0
  97. package/dist/oauth-token-type.d.ts.map +1 -0
  98. package/dist/oauth-token-type.js +16 -0
  99. package/dist/oauth-token-type.js.map +1 -0
  100. package/dist/oidc-claims-parameter.d.ts +4 -0
  101. package/dist/oidc-claims-parameter.d.ts.map +1 -0
  102. package/dist/oidc-claims-parameter.js +36 -0
  103. package/dist/oidc-claims-parameter.js.map +1 -0
  104. package/dist/oidc-claims-properties.d.ts +16 -0
  105. package/dist/oidc-claims-properties.d.ts.map +1 -0
  106. package/dist/oidc-claims-properties.js +11 -0
  107. package/dist/oidc-claims-properties.js.map +1 -0
  108. package/dist/oidc-entity-type.d.ts +4 -0
  109. package/dist/oidc-entity-type.d.ts.map +1 -0
  110. package/dist/oidc-entity-type.js +6 -0
  111. package/dist/oidc-entity-type.js.map +1 -0
  112. package/dist/util.d.ts +5 -0
  113. package/dist/util.d.ts.map +1 -0
  114. package/dist/util.js +23 -0
  115. package/dist/util.js.map +1 -0
  116. package/package.json +37 -0
  117. package/src/access-token.ts +4 -0
  118. package/src/atproto-loopback-client-metadata.ts +30 -0
  119. package/src/constants.ts +9 -0
  120. package/src/index.ts +27 -0
  121. package/src/oauth-authentication-request-parameters.ts +104 -0
  122. package/src/oauth-authorization-details.ts +28 -0
  123. package/src/oauth-authorization-server-metadata.ts +106 -0
  124. package/src/oauth-client-credentials.ts +34 -0
  125. package/src/oauth-client-id-discoverable.ts +66 -0
  126. package/src/oauth-client-id-loopback.ts +58 -0
  127. package/src/oauth-client-id-url.ts +25 -0
  128. package/src/oauth-client-id.ts +4 -0
  129. package/src/oauth-client-identification.ts +14 -0
  130. package/src/oauth-client-metadata.ts +75 -0
  131. package/src/oauth-endpoint-auth-method.ts +13 -0
  132. package/src/oauth-endpoint-name.ts +5 -0
  133. package/src/oauth-grant-type.ts +13 -0
  134. package/src/oauth-issuer-identifier.ts +61 -0
  135. package/src/oauth-par-response.ts +7 -0
  136. package/src/oauth-protected-resource-metadata.ts +85 -0
  137. package/src/oauth-response-mode.ts +9 -0
  138. package/src/oauth-response-type.ts +17 -0
  139. package/src/oauth-token-response.ts +29 -0
  140. package/src/oauth-token-type.ts +15 -0
  141. package/src/oidc-claims-parameter.ts +40 -0
  142. package/src/oidc-claims-properties.ts +11 -0
  143. package/src/oidc-entity-type.ts +5 -0
  144. package/src/util.ts +20 -0
  145. package/tsconfig.build.json +8 -0
  146. package/tsconfig.json +4 -0
@@ -0,0 +1,428 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * @see {@link https://datatracker.ietf.org/doc/html/rfc8414}
4
+ */
5
+ export declare const oauthAuthorizationServerMetadataSchema: z.ZodObject<{
6
+ issuer: z.ZodEffects<z.ZodString, string, string>;
7
+ claims_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
8
+ claims_locales_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
9
+ claims_parameter_supported: z.ZodOptional<z.ZodBoolean>;
10
+ request_parameter_supported: z.ZodOptional<z.ZodBoolean>;
11
+ request_uri_parameter_supported: z.ZodOptional<z.ZodBoolean>;
12
+ require_request_uri_registration: z.ZodOptional<z.ZodBoolean>;
13
+ scopes_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
14
+ subject_types_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
15
+ response_types_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
16
+ response_modes_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
17
+ grant_types_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
18
+ code_challenge_methods_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
19
+ ui_locales_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
20
+ id_token_signing_alg_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
21
+ display_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
22
+ request_object_signing_alg_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
23
+ authorization_response_iss_parameter_supported: z.ZodOptional<z.ZodBoolean>;
24
+ authorization_details_types_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
25
+ request_object_encryption_alg_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
26
+ 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
+ token_endpoint_auth_methods_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
31
+ token_endpoint_auth_signing_alg_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
32
+ revocation_endpoint: z.ZodOptional<z.ZodString>;
33
+ revocation_endpoint_auth_methods_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
34
+ revocation_endpoint_auth_signing_alg_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
35
+ introspection_endpoint: z.ZodOptional<z.ZodString>;
36
+ introspection_endpoint_auth_methods_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
37
+ introspection_endpoint_auth_signing_alg_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
38
+ pushed_authorization_request_endpoint: z.ZodOptional<z.ZodString>;
39
+ pushed_authorization_request_endpoint_auth_methods_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
40
+ pushed_authorization_request_endpoint_auth_signing_alg_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
41
+ require_pushed_authorization_requests: z.ZodOptional<z.ZodBoolean>;
42
+ userinfo_endpoint: z.ZodOptional<z.ZodString>;
43
+ end_session_endpoint: z.ZodOptional<z.ZodString>;
44
+ registration_endpoint: z.ZodOptional<z.ZodString>;
45
+ dpop_signing_alg_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
46
+ protected_resources: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
47
+ }, "strip", z.ZodTypeAny, {
48
+ issuer: string;
49
+ authorization_endpoint: string;
50
+ token_endpoint: string;
51
+ jwks_uri?: string | undefined;
52
+ claims_supported?: string[] | undefined;
53
+ claims_locales_supported?: string[] | undefined;
54
+ claims_parameter_supported?: boolean | undefined;
55
+ request_parameter_supported?: boolean | undefined;
56
+ request_uri_parameter_supported?: boolean | undefined;
57
+ require_request_uri_registration?: boolean | undefined;
58
+ scopes_supported?: string[] | undefined;
59
+ subject_types_supported?: string[] | undefined;
60
+ response_types_supported?: string[] | undefined;
61
+ response_modes_supported?: string[] | undefined;
62
+ grant_types_supported?: string[] | undefined;
63
+ code_challenge_methods_supported?: string[] | undefined;
64
+ ui_locales_supported?: string[] | undefined;
65
+ id_token_signing_alg_values_supported?: string[] | undefined;
66
+ display_values_supported?: string[] | undefined;
67
+ request_object_signing_alg_values_supported?: string[] | undefined;
68
+ authorization_response_iss_parameter_supported?: boolean | undefined;
69
+ authorization_details_types_supported?: string[] | undefined;
70
+ request_object_encryption_alg_values_supported?: string[] | undefined;
71
+ request_object_encryption_enc_values_supported?: string[] | undefined;
72
+ token_endpoint_auth_methods_supported?: string[] | undefined;
73
+ token_endpoint_auth_signing_alg_values_supported?: string[] | undefined;
74
+ revocation_endpoint?: string | undefined;
75
+ revocation_endpoint_auth_methods_supported?: string[] | undefined;
76
+ revocation_endpoint_auth_signing_alg_values_supported?: string[] | undefined;
77
+ introspection_endpoint?: string | undefined;
78
+ introspection_endpoint_auth_methods_supported?: string[] | undefined;
79
+ introspection_endpoint_auth_signing_alg_values_supported?: string[] | undefined;
80
+ pushed_authorization_request_endpoint?: string | undefined;
81
+ pushed_authorization_request_endpoint_auth_methods_supported?: string[] | undefined;
82
+ pushed_authorization_request_endpoint_auth_signing_alg_values_supported?: string[] | undefined;
83
+ require_pushed_authorization_requests?: boolean | undefined;
84
+ userinfo_endpoint?: string | undefined;
85
+ end_session_endpoint?: string | undefined;
86
+ registration_endpoint?: string | undefined;
87
+ dpop_signing_alg_values_supported?: string[] | undefined;
88
+ protected_resources?: string[] | undefined;
89
+ }, {
90
+ issuer: string;
91
+ authorization_endpoint: string;
92
+ token_endpoint: string;
93
+ jwks_uri?: string | undefined;
94
+ claims_supported?: string[] | undefined;
95
+ claims_locales_supported?: string[] | undefined;
96
+ claims_parameter_supported?: boolean | undefined;
97
+ request_parameter_supported?: boolean | undefined;
98
+ request_uri_parameter_supported?: boolean | undefined;
99
+ require_request_uri_registration?: boolean | undefined;
100
+ scopes_supported?: string[] | undefined;
101
+ subject_types_supported?: string[] | undefined;
102
+ response_types_supported?: string[] | undefined;
103
+ response_modes_supported?: string[] | undefined;
104
+ grant_types_supported?: string[] | undefined;
105
+ code_challenge_methods_supported?: string[] | undefined;
106
+ ui_locales_supported?: string[] | undefined;
107
+ id_token_signing_alg_values_supported?: string[] | undefined;
108
+ display_values_supported?: string[] | undefined;
109
+ request_object_signing_alg_values_supported?: string[] | undefined;
110
+ authorization_response_iss_parameter_supported?: boolean | undefined;
111
+ authorization_details_types_supported?: string[] | undefined;
112
+ request_object_encryption_alg_values_supported?: string[] | undefined;
113
+ request_object_encryption_enc_values_supported?: string[] | undefined;
114
+ token_endpoint_auth_methods_supported?: string[] | undefined;
115
+ token_endpoint_auth_signing_alg_values_supported?: string[] | undefined;
116
+ revocation_endpoint?: string | undefined;
117
+ revocation_endpoint_auth_methods_supported?: string[] | undefined;
118
+ revocation_endpoint_auth_signing_alg_values_supported?: string[] | undefined;
119
+ introspection_endpoint?: string | undefined;
120
+ introspection_endpoint_auth_methods_supported?: string[] | undefined;
121
+ introspection_endpoint_auth_signing_alg_values_supported?: string[] | undefined;
122
+ pushed_authorization_request_endpoint?: string | undefined;
123
+ pushed_authorization_request_endpoint_auth_methods_supported?: string[] | undefined;
124
+ pushed_authorization_request_endpoint_auth_signing_alg_values_supported?: string[] | undefined;
125
+ require_pushed_authorization_requests?: boolean | undefined;
126
+ userinfo_endpoint?: string | undefined;
127
+ end_session_endpoint?: string | undefined;
128
+ registration_endpoint?: string | undefined;
129
+ dpop_signing_alg_values_supported?: string[] | undefined;
130
+ protected_resources?: string[] | undefined;
131
+ }>;
132
+ export type OAuthAuthorizationServerMetadata = z.infer<typeof oauthAuthorizationServerMetadataSchema>;
133
+ export declare const oauthAuthorizationServerMetadataValidator: z.ZodEffects<z.ZodEffects<z.ZodObject<{
134
+ issuer: z.ZodEffects<z.ZodString, string, string>;
135
+ claims_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
136
+ claims_locales_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
137
+ claims_parameter_supported: z.ZodOptional<z.ZodBoolean>;
138
+ request_parameter_supported: z.ZodOptional<z.ZodBoolean>;
139
+ request_uri_parameter_supported: z.ZodOptional<z.ZodBoolean>;
140
+ require_request_uri_registration: z.ZodOptional<z.ZodBoolean>;
141
+ scopes_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
142
+ subject_types_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
143
+ response_types_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
144
+ response_modes_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
145
+ grant_types_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
146
+ code_challenge_methods_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
147
+ ui_locales_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
148
+ id_token_signing_alg_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
149
+ display_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
150
+ request_object_signing_alg_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
151
+ authorization_response_iss_parameter_supported: z.ZodOptional<z.ZodBoolean>;
152
+ authorization_details_types_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
153
+ request_object_encryption_alg_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
154
+ request_object_encryption_enc_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
155
+ jwks_uri: z.ZodOptional<z.ZodString>;
156
+ authorization_endpoint: z.ZodString;
157
+ token_endpoint: z.ZodString;
158
+ token_endpoint_auth_methods_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
159
+ token_endpoint_auth_signing_alg_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
160
+ revocation_endpoint: z.ZodOptional<z.ZodString>;
161
+ revocation_endpoint_auth_methods_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
162
+ revocation_endpoint_auth_signing_alg_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
163
+ introspection_endpoint: z.ZodOptional<z.ZodString>;
164
+ introspection_endpoint_auth_methods_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
165
+ introspection_endpoint_auth_signing_alg_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
166
+ pushed_authorization_request_endpoint: z.ZodOptional<z.ZodString>;
167
+ pushed_authorization_request_endpoint_auth_methods_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
168
+ pushed_authorization_request_endpoint_auth_signing_alg_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
169
+ require_pushed_authorization_requests: z.ZodOptional<z.ZodBoolean>;
170
+ userinfo_endpoint: z.ZodOptional<z.ZodString>;
171
+ end_session_endpoint: z.ZodOptional<z.ZodString>;
172
+ registration_endpoint: z.ZodOptional<z.ZodString>;
173
+ dpop_signing_alg_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
174
+ protected_resources: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
175
+ }, "strip", z.ZodTypeAny, {
176
+ issuer: string;
177
+ authorization_endpoint: string;
178
+ token_endpoint: string;
179
+ jwks_uri?: string | undefined;
180
+ claims_supported?: string[] | undefined;
181
+ claims_locales_supported?: string[] | undefined;
182
+ claims_parameter_supported?: boolean | undefined;
183
+ request_parameter_supported?: boolean | undefined;
184
+ request_uri_parameter_supported?: boolean | undefined;
185
+ require_request_uri_registration?: boolean | undefined;
186
+ scopes_supported?: string[] | undefined;
187
+ subject_types_supported?: string[] | undefined;
188
+ response_types_supported?: string[] | undefined;
189
+ response_modes_supported?: string[] | undefined;
190
+ grant_types_supported?: string[] | undefined;
191
+ code_challenge_methods_supported?: string[] | undefined;
192
+ ui_locales_supported?: string[] | undefined;
193
+ id_token_signing_alg_values_supported?: string[] | undefined;
194
+ display_values_supported?: string[] | undefined;
195
+ request_object_signing_alg_values_supported?: string[] | undefined;
196
+ authorization_response_iss_parameter_supported?: boolean | undefined;
197
+ authorization_details_types_supported?: string[] | undefined;
198
+ request_object_encryption_alg_values_supported?: string[] | undefined;
199
+ request_object_encryption_enc_values_supported?: string[] | undefined;
200
+ token_endpoint_auth_methods_supported?: string[] | undefined;
201
+ token_endpoint_auth_signing_alg_values_supported?: string[] | undefined;
202
+ revocation_endpoint?: string | undefined;
203
+ revocation_endpoint_auth_methods_supported?: string[] | undefined;
204
+ revocation_endpoint_auth_signing_alg_values_supported?: string[] | undefined;
205
+ introspection_endpoint?: string | undefined;
206
+ introspection_endpoint_auth_methods_supported?: string[] | undefined;
207
+ introspection_endpoint_auth_signing_alg_values_supported?: string[] | undefined;
208
+ pushed_authorization_request_endpoint?: string | undefined;
209
+ pushed_authorization_request_endpoint_auth_methods_supported?: string[] | undefined;
210
+ pushed_authorization_request_endpoint_auth_signing_alg_values_supported?: string[] | undefined;
211
+ require_pushed_authorization_requests?: boolean | undefined;
212
+ userinfo_endpoint?: string | undefined;
213
+ end_session_endpoint?: string | undefined;
214
+ registration_endpoint?: string | undefined;
215
+ dpop_signing_alg_values_supported?: string[] | undefined;
216
+ protected_resources?: string[] | undefined;
217
+ }, {
218
+ issuer: string;
219
+ authorization_endpoint: string;
220
+ token_endpoint: string;
221
+ jwks_uri?: string | undefined;
222
+ claims_supported?: string[] | undefined;
223
+ claims_locales_supported?: string[] | undefined;
224
+ claims_parameter_supported?: boolean | undefined;
225
+ request_parameter_supported?: boolean | undefined;
226
+ request_uri_parameter_supported?: boolean | undefined;
227
+ require_request_uri_registration?: boolean | undefined;
228
+ scopes_supported?: string[] | undefined;
229
+ subject_types_supported?: string[] | undefined;
230
+ response_types_supported?: string[] | undefined;
231
+ response_modes_supported?: string[] | undefined;
232
+ grant_types_supported?: string[] | undefined;
233
+ code_challenge_methods_supported?: string[] | undefined;
234
+ ui_locales_supported?: string[] | undefined;
235
+ id_token_signing_alg_values_supported?: string[] | undefined;
236
+ display_values_supported?: string[] | undefined;
237
+ request_object_signing_alg_values_supported?: string[] | undefined;
238
+ authorization_response_iss_parameter_supported?: boolean | undefined;
239
+ authorization_details_types_supported?: string[] | undefined;
240
+ request_object_encryption_alg_values_supported?: string[] | undefined;
241
+ request_object_encryption_enc_values_supported?: string[] | undefined;
242
+ token_endpoint_auth_methods_supported?: string[] | undefined;
243
+ token_endpoint_auth_signing_alg_values_supported?: string[] | undefined;
244
+ revocation_endpoint?: string | undefined;
245
+ revocation_endpoint_auth_methods_supported?: string[] | undefined;
246
+ revocation_endpoint_auth_signing_alg_values_supported?: string[] | undefined;
247
+ introspection_endpoint?: string | undefined;
248
+ introspection_endpoint_auth_methods_supported?: string[] | undefined;
249
+ introspection_endpoint_auth_signing_alg_values_supported?: string[] | undefined;
250
+ pushed_authorization_request_endpoint?: string | undefined;
251
+ pushed_authorization_request_endpoint_auth_methods_supported?: string[] | undefined;
252
+ pushed_authorization_request_endpoint_auth_signing_alg_values_supported?: string[] | undefined;
253
+ require_pushed_authorization_requests?: boolean | undefined;
254
+ userinfo_endpoint?: string | undefined;
255
+ end_session_endpoint?: string | undefined;
256
+ registration_endpoint?: string | undefined;
257
+ dpop_signing_alg_values_supported?: string[] | undefined;
258
+ protected_resources?: string[] | undefined;
259
+ }>, {
260
+ issuer: string;
261
+ authorization_endpoint: string;
262
+ token_endpoint: string;
263
+ jwks_uri?: string | undefined;
264
+ claims_supported?: string[] | undefined;
265
+ claims_locales_supported?: string[] | undefined;
266
+ claims_parameter_supported?: boolean | undefined;
267
+ request_parameter_supported?: boolean | undefined;
268
+ request_uri_parameter_supported?: boolean | undefined;
269
+ require_request_uri_registration?: boolean | undefined;
270
+ scopes_supported?: string[] | undefined;
271
+ subject_types_supported?: string[] | undefined;
272
+ response_types_supported?: string[] | undefined;
273
+ response_modes_supported?: string[] | undefined;
274
+ grant_types_supported?: string[] | undefined;
275
+ code_challenge_methods_supported?: string[] | undefined;
276
+ ui_locales_supported?: string[] | undefined;
277
+ id_token_signing_alg_values_supported?: string[] | undefined;
278
+ display_values_supported?: string[] | undefined;
279
+ request_object_signing_alg_values_supported?: string[] | undefined;
280
+ authorization_response_iss_parameter_supported?: boolean | undefined;
281
+ authorization_details_types_supported?: string[] | undefined;
282
+ request_object_encryption_alg_values_supported?: string[] | undefined;
283
+ request_object_encryption_enc_values_supported?: string[] | undefined;
284
+ token_endpoint_auth_methods_supported?: string[] | undefined;
285
+ token_endpoint_auth_signing_alg_values_supported?: string[] | undefined;
286
+ revocation_endpoint?: string | undefined;
287
+ revocation_endpoint_auth_methods_supported?: string[] | undefined;
288
+ revocation_endpoint_auth_signing_alg_values_supported?: string[] | undefined;
289
+ introspection_endpoint?: string | undefined;
290
+ introspection_endpoint_auth_methods_supported?: string[] | undefined;
291
+ introspection_endpoint_auth_signing_alg_values_supported?: string[] | undefined;
292
+ pushed_authorization_request_endpoint?: string | undefined;
293
+ pushed_authorization_request_endpoint_auth_methods_supported?: string[] | undefined;
294
+ pushed_authorization_request_endpoint_auth_signing_alg_values_supported?: string[] | undefined;
295
+ require_pushed_authorization_requests?: boolean | undefined;
296
+ userinfo_endpoint?: string | undefined;
297
+ end_session_endpoint?: string | undefined;
298
+ registration_endpoint?: string | undefined;
299
+ dpop_signing_alg_values_supported?: string[] | undefined;
300
+ protected_resources?: string[] | undefined;
301
+ }, {
302
+ issuer: string;
303
+ authorization_endpoint: string;
304
+ token_endpoint: string;
305
+ jwks_uri?: string | undefined;
306
+ claims_supported?: string[] | undefined;
307
+ claims_locales_supported?: string[] | undefined;
308
+ claims_parameter_supported?: boolean | undefined;
309
+ request_parameter_supported?: boolean | undefined;
310
+ request_uri_parameter_supported?: boolean | undefined;
311
+ require_request_uri_registration?: boolean | undefined;
312
+ scopes_supported?: string[] | undefined;
313
+ subject_types_supported?: string[] | undefined;
314
+ response_types_supported?: string[] | undefined;
315
+ response_modes_supported?: string[] | undefined;
316
+ grant_types_supported?: string[] | undefined;
317
+ code_challenge_methods_supported?: string[] | undefined;
318
+ ui_locales_supported?: string[] | undefined;
319
+ id_token_signing_alg_values_supported?: string[] | undefined;
320
+ display_values_supported?: string[] | undefined;
321
+ request_object_signing_alg_values_supported?: string[] | undefined;
322
+ authorization_response_iss_parameter_supported?: boolean | undefined;
323
+ authorization_details_types_supported?: string[] | undefined;
324
+ request_object_encryption_alg_values_supported?: string[] | undefined;
325
+ request_object_encryption_enc_values_supported?: string[] | undefined;
326
+ token_endpoint_auth_methods_supported?: string[] | undefined;
327
+ token_endpoint_auth_signing_alg_values_supported?: string[] | undefined;
328
+ revocation_endpoint?: string | undefined;
329
+ revocation_endpoint_auth_methods_supported?: string[] | undefined;
330
+ revocation_endpoint_auth_signing_alg_values_supported?: string[] | undefined;
331
+ introspection_endpoint?: string | undefined;
332
+ introspection_endpoint_auth_methods_supported?: string[] | undefined;
333
+ introspection_endpoint_auth_signing_alg_values_supported?: string[] | undefined;
334
+ pushed_authorization_request_endpoint?: string | undefined;
335
+ pushed_authorization_request_endpoint_auth_methods_supported?: string[] | undefined;
336
+ pushed_authorization_request_endpoint_auth_signing_alg_values_supported?: string[] | undefined;
337
+ require_pushed_authorization_requests?: boolean | undefined;
338
+ userinfo_endpoint?: string | undefined;
339
+ end_session_endpoint?: string | undefined;
340
+ registration_endpoint?: string | undefined;
341
+ dpop_signing_alg_values_supported?: string[] | undefined;
342
+ protected_resources?: string[] | undefined;
343
+ }>, {
344
+ issuer: string;
345
+ authorization_endpoint: string;
346
+ token_endpoint: string;
347
+ jwks_uri?: string | undefined;
348
+ claims_supported?: string[] | undefined;
349
+ claims_locales_supported?: string[] | undefined;
350
+ claims_parameter_supported?: boolean | undefined;
351
+ request_parameter_supported?: boolean | undefined;
352
+ request_uri_parameter_supported?: boolean | undefined;
353
+ require_request_uri_registration?: boolean | undefined;
354
+ scopes_supported?: string[] | undefined;
355
+ subject_types_supported?: string[] | undefined;
356
+ response_types_supported?: string[] | undefined;
357
+ response_modes_supported?: string[] | undefined;
358
+ grant_types_supported?: string[] | undefined;
359
+ code_challenge_methods_supported?: string[] | undefined;
360
+ ui_locales_supported?: string[] | undefined;
361
+ id_token_signing_alg_values_supported?: string[] | undefined;
362
+ display_values_supported?: string[] | undefined;
363
+ request_object_signing_alg_values_supported?: string[] | undefined;
364
+ authorization_response_iss_parameter_supported?: boolean | undefined;
365
+ authorization_details_types_supported?: string[] | undefined;
366
+ request_object_encryption_alg_values_supported?: string[] | undefined;
367
+ request_object_encryption_enc_values_supported?: string[] | undefined;
368
+ token_endpoint_auth_methods_supported?: string[] | undefined;
369
+ token_endpoint_auth_signing_alg_values_supported?: string[] | undefined;
370
+ revocation_endpoint?: string | undefined;
371
+ revocation_endpoint_auth_methods_supported?: string[] | undefined;
372
+ revocation_endpoint_auth_signing_alg_values_supported?: string[] | undefined;
373
+ introspection_endpoint?: string | undefined;
374
+ introspection_endpoint_auth_methods_supported?: string[] | undefined;
375
+ introspection_endpoint_auth_signing_alg_values_supported?: string[] | undefined;
376
+ pushed_authorization_request_endpoint?: string | undefined;
377
+ pushed_authorization_request_endpoint_auth_methods_supported?: string[] | undefined;
378
+ pushed_authorization_request_endpoint_auth_signing_alg_values_supported?: string[] | undefined;
379
+ require_pushed_authorization_requests?: boolean | undefined;
380
+ userinfo_endpoint?: string | undefined;
381
+ end_session_endpoint?: string | undefined;
382
+ registration_endpoint?: string | undefined;
383
+ dpop_signing_alg_values_supported?: string[] | undefined;
384
+ protected_resources?: string[] | undefined;
385
+ }, {
386
+ issuer: string;
387
+ authorization_endpoint: string;
388
+ token_endpoint: string;
389
+ jwks_uri?: string | undefined;
390
+ claims_supported?: string[] | undefined;
391
+ claims_locales_supported?: string[] | undefined;
392
+ claims_parameter_supported?: boolean | undefined;
393
+ request_parameter_supported?: boolean | undefined;
394
+ request_uri_parameter_supported?: boolean | undefined;
395
+ require_request_uri_registration?: boolean | undefined;
396
+ scopes_supported?: string[] | undefined;
397
+ subject_types_supported?: string[] | undefined;
398
+ response_types_supported?: string[] | undefined;
399
+ response_modes_supported?: string[] | undefined;
400
+ grant_types_supported?: string[] | undefined;
401
+ code_challenge_methods_supported?: string[] | undefined;
402
+ ui_locales_supported?: string[] | undefined;
403
+ id_token_signing_alg_values_supported?: string[] | undefined;
404
+ display_values_supported?: string[] | undefined;
405
+ request_object_signing_alg_values_supported?: string[] | undefined;
406
+ authorization_response_iss_parameter_supported?: boolean | undefined;
407
+ authorization_details_types_supported?: string[] | undefined;
408
+ request_object_encryption_alg_values_supported?: string[] | undefined;
409
+ request_object_encryption_enc_values_supported?: string[] | undefined;
410
+ token_endpoint_auth_methods_supported?: string[] | undefined;
411
+ token_endpoint_auth_signing_alg_values_supported?: string[] | undefined;
412
+ revocation_endpoint?: string | undefined;
413
+ revocation_endpoint_auth_methods_supported?: string[] | undefined;
414
+ revocation_endpoint_auth_signing_alg_values_supported?: string[] | undefined;
415
+ introspection_endpoint?: string | undefined;
416
+ introspection_endpoint_auth_methods_supported?: string[] | undefined;
417
+ introspection_endpoint_auth_signing_alg_values_supported?: string[] | undefined;
418
+ pushed_authorization_request_endpoint?: string | undefined;
419
+ pushed_authorization_request_endpoint_auth_methods_supported?: string[] | undefined;
420
+ pushed_authorization_request_endpoint_auth_signing_alg_values_supported?: string[] | undefined;
421
+ require_pushed_authorization_requests?: boolean | undefined;
422
+ userinfo_endpoint?: string | undefined;
423
+ end_session_endpoint?: string | undefined;
424
+ registration_endpoint?: string | undefined;
425
+ dpop_signing_alg_values_supported?: string[] | undefined;
426
+ protected_resources?: string[] | undefined;
427
+ }>;
428
+ //# sourceMappingURL=oauth-authorization-server-metadata.d.ts.map
@@ -0,0 +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;AAIvB;;GAEG;AACH,eAAO,MAAM,sCAAsC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqEjD,CAAA;AAEF,MAAM,MAAM,gCAAgC,GAAG,CAAC,CAAC,KAAK,CACpD,OAAO,sCAAsC,CAC9C,CAAA;AAED,eAAO,MAAM,yCAAyC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuBhD,CAAA"}
@@ -0,0 +1,88 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.oauthAuthorizationServerMetadataValidator = exports.oauthAuthorizationServerMetadataSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const oauth_issuer_identifier_js_1 = require("./oauth-issuer-identifier.js");
6
+ /**
7
+ * @see {@link https://datatracker.ietf.org/doc/html/rfc8414}
8
+ */
9
+ exports.oauthAuthorizationServerMetadataSchema = zod_1.z.object({
10
+ issuer: oauth_issuer_identifier_js_1.oauthIssuerIdentifierSchema,
11
+ claims_supported: zod_1.z.array(zod_1.z.string()).optional(),
12
+ claims_locales_supported: zod_1.z.array(zod_1.z.string()).optional(),
13
+ claims_parameter_supported: zod_1.z.boolean().optional(),
14
+ request_parameter_supported: zod_1.z.boolean().optional(),
15
+ request_uri_parameter_supported: zod_1.z.boolean().optional(),
16
+ require_request_uri_registration: zod_1.z.boolean().optional(),
17
+ scopes_supported: zod_1.z.array(zod_1.z.string()).optional(),
18
+ subject_types_supported: zod_1.z.array(zod_1.z.string()).optional(),
19
+ response_types_supported: zod_1.z.array(zod_1.z.string()).optional(),
20
+ response_modes_supported: zod_1.z.array(zod_1.z.string()).optional(),
21
+ grant_types_supported: zod_1.z.array(zod_1.z.string()).optional(),
22
+ code_challenge_methods_supported: zod_1.z.array(zod_1.z.string()).min(1).optional(),
23
+ ui_locales_supported: zod_1.z.array(zod_1.z.string()).optional(),
24
+ id_token_signing_alg_values_supported: zod_1.z.array(zod_1.z.string()).optional(),
25
+ display_values_supported: zod_1.z.array(zod_1.z.string()).optional(),
26
+ request_object_signing_alg_values_supported: zod_1.z.array(zod_1.z.string()).optional(),
27
+ authorization_response_iss_parameter_supported: zod_1.z.boolean().optional(),
28
+ authorization_details_types_supported: zod_1.z.array(zod_1.z.string()).optional(),
29
+ request_object_encryption_alg_values_supported: zod_1.z
30
+ .array(zod_1.z.string())
31
+ .optional(),
32
+ request_object_encryption_enc_values_supported: zod_1.z
33
+ .array(zod_1.z.string())
34
+ .optional(),
35
+ jwks_uri: zod_1.z.string().url().optional(),
36
+ authorization_endpoint: zod_1.z.string().url(), // .optional(),
37
+ token_endpoint: zod_1.z.string().url(), // .optional(),
38
+ token_endpoint_auth_methods_supported: zod_1.z.array(zod_1.z.string()).optional(),
39
+ token_endpoint_auth_signing_alg_values_supported: zod_1.z
40
+ .array(zod_1.z.string())
41
+ .optional(),
42
+ revocation_endpoint: zod_1.z.string().url().optional(),
43
+ revocation_endpoint_auth_methods_supported: zod_1.z.array(zod_1.z.string()).optional(),
44
+ revocation_endpoint_auth_signing_alg_values_supported: zod_1.z
45
+ .array(zod_1.z.string())
46
+ .optional(),
47
+ introspection_endpoint: zod_1.z.string().url().optional(),
48
+ introspection_endpoint_auth_methods_supported: zod_1.z.array(zod_1.z.string()).optional(),
49
+ introspection_endpoint_auth_signing_alg_values_supported: zod_1.z
50
+ .array(zod_1.z.string())
51
+ .optional(),
52
+ pushed_authorization_request_endpoint: zod_1.z.string().url().optional(),
53
+ pushed_authorization_request_endpoint_auth_methods_supported: zod_1.z
54
+ .array(zod_1.z.string())
55
+ .optional(),
56
+ pushed_authorization_request_endpoint_auth_signing_alg_values_supported: zod_1.z
57
+ .array(zod_1.z.string())
58
+ .optional(),
59
+ require_pushed_authorization_requests: zod_1.z.boolean().optional(),
60
+ userinfo_endpoint: zod_1.z.string().url().optional(),
61
+ end_session_endpoint: zod_1.z.string().url().optional(),
62
+ registration_endpoint: zod_1.z.string().url().optional(),
63
+ // https://datatracker.ietf.org/doc/html/rfc9449#section-5.1
64
+ dpop_signing_alg_values_supported: zod_1.z.array(zod_1.z.string()).optional(),
65
+ // https://datatracker.ietf.org/doc/html/draft-ietf-oauth-resource-metadata-05#section-4
66
+ protected_resources: zod_1.z.array(zod_1.z.string().url()).optional(),
67
+ });
68
+ exports.oauthAuthorizationServerMetadataValidator = exports.oauthAuthorizationServerMetadataSchema
69
+ .superRefine((data, ctx) => {
70
+ if (data.require_pushed_authorization_requests &&
71
+ !data.pushed_authorization_request_endpoint) {
72
+ ctx.addIssue({
73
+ code: zod_1.z.ZodIssueCode.custom,
74
+ message: '"pushed_authorization_request_endpoint" required when "require_pushed_authorization_requests" is true',
75
+ });
76
+ }
77
+ })
78
+ .superRefine((data, ctx) => {
79
+ if (data.response_types_supported) {
80
+ if (!data.response_types_supported.includes('code')) {
81
+ ctx.addIssue({
82
+ code: zod_1.z.ZodIssueCode.custom,
83
+ message: 'Response type "code" is required',
84
+ });
85
+ }
86
+ }
87
+ });
88
+ //# sourceMappingURL=oauth-authorization-server-metadata.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oauth-authorization-server-metadata.js","sourceRoot":"","sources":["../src/oauth-authorization-server-metadata.ts"],"names":[],"mappings":";;;AAAA,6BAAuB;AAEvB,6EAA0E;AAE1E;;GAEG;AACU,QAAA,sCAAsC,GAAG,OAAC,CAAC,MAAM,CAAC;IAC7D,MAAM,EAAE,wDAA2B;IAEnC,gBAAgB,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IAChD,wBAAwB,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IACxD,0BAA0B,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAClD,2B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B,EAAE,CAAC;QAClC,IAAI,CAAC,IAAI,CAAC,wBAAwB,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;YACpD,GAAG,CAAC,QAAQ,CAAC;gBACX,IAAI,EAAE,OAAC,CAAC,YAAY,CAAC,MAAM;gBAC3B,OAAO,EAAE,kCAAkC;aAC5C,CAAC,CAAA;QACJ,CAAC;IACH,CAAC;AACH,CAAC,CAAC,CAAA"}
@@ -0,0 +1,66 @@
1
+ import { z } from 'zod';
2
+ export declare const oauthClientCredentialsJwtBearerSchema: z.ZodObject<{
3
+ client_id: z.ZodString;
4
+ client_assertion_type: z.ZodLiteral<"urn:ietf:params:oauth:client-assertion-type:jwt-bearer">;
5
+ /**
6
+ * - "sub" the subject MUST be the "client_id" of the OAuth client
7
+ * - "iat" is required and MUST be less than one minute
8
+ * - "aud" must containing a value that identifies the authorization server
9
+ * - The JWT MAY contain a "jti" (JWT ID) claim that provides a unique identifier for the token.
10
+ * - Note that the authorization server may reject JWTs with an "exp" claim value that is unreasonably far in the future.
11
+ *
12
+ * @see {@link https://datatracker.ietf.org/doc/html/draft-ietf-oauth-jwt-bearer-11#section-3}
13
+ */
14
+ client_assertion: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, `${string}.${string}.${string}`, string>;
15
+ }, "strip", z.ZodTypeAny, {
16
+ client_id: string;
17
+ client_assertion_type: "urn:ietf:params:oauth:client-assertion-type:jwt-bearer";
18
+ client_assertion: `${string}.${string}.${string}`;
19
+ }, {
20
+ client_id: string;
21
+ client_assertion_type: "urn:ietf:params:oauth:client-assertion-type:jwt-bearer";
22
+ client_assertion: string;
23
+ }>;
24
+ export declare const oauthClientCredentialsSecretPostSchema: z.ZodObject<{
25
+ client_id: z.ZodString;
26
+ client_secret: z.ZodString;
27
+ }, "strip", z.ZodTypeAny, {
28
+ client_id: string;
29
+ client_secret: string;
30
+ }, {
31
+ client_id: string;
32
+ client_secret: string;
33
+ }>;
34
+ export declare const oauthClientCredentialsSchema: z.ZodUnion<[z.ZodObject<{
35
+ client_id: z.ZodString;
36
+ client_assertion_type: z.ZodLiteral<"urn:ietf:params:oauth:client-assertion-type:jwt-bearer">;
37
+ /**
38
+ * - "sub" the subject MUST be the "client_id" of the OAuth client
39
+ * - "iat" is required and MUST be less than one minute
40
+ * - "aud" must containing a value that identifies the authorization server
41
+ * - The JWT MAY contain a "jti" (JWT ID) claim that provides a unique identifier for the token.
42
+ * - Note that the authorization server may reject JWTs with an "exp" claim value that is unreasonably far in the future.
43
+ *
44
+ * @see {@link https://datatracker.ietf.org/doc/html/draft-ietf-oauth-jwt-bearer-11#section-3}
45
+ */
46
+ client_assertion: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, `${string}.${string}.${string}`, string>;
47
+ }, "strip", z.ZodTypeAny, {
48
+ client_id: string;
49
+ client_assertion_type: "urn:ietf:params:oauth:client-assertion-type:jwt-bearer";
50
+ client_assertion: `${string}.${string}.${string}`;
51
+ }, {
52
+ client_id: string;
53
+ client_assertion_type: "urn:ietf:params:oauth:client-assertion-type:jwt-bearer";
54
+ client_assertion: string;
55
+ }>, z.ZodObject<{
56
+ client_id: z.ZodString;
57
+ client_secret: z.ZodString;
58
+ }, "strip", z.ZodTypeAny, {
59
+ client_id: string;
60
+ client_secret: string;
61
+ }, {
62
+ client_id: string;
63
+ client_secret: string;
64
+ }>]>;
65
+ export type OAuthClientCredentials = z.infer<typeof oauthClientCredentialsSchema>;
66
+ //# sourceMappingURL=oauth-client-credentials.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oauth-client-credentials.d.ts","sourceRoot":"","sources":["../src/oauth-client-credentials.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAMvB,eAAO,MAAM,qCAAqC;;;IAGhD;;;;;;;;OAQG;;;;;;;;;;EAEH,CAAA;AAEF,eAAO,MAAM,sCAAsC;;;;;;;;;EAGjD,CAAA;AAEF,eAAO,MAAM,4BAA4B;;;IAjBvC;;;;;;;;OAQG;;;;;;;;;;;;;;;;;;;IAYH,CAAA;AAEF,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAC1C,OAAO,4BAA4B,CACpC,CAAA"}
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.oauthClientCredentialsSchema = exports.oauthClientCredentialsSecretPostSchema = exports.oauthClientCredentialsJwtBearerSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const jwk_1 = require("@atproto/jwk");
6
+ const oauth_client_id_js_1 = require("./oauth-client-id.js");
7
+ const constants_js_1 = require("./constants.js");
8
+ exports.oauthClientCredentialsJwtBearerSchema = zod_1.z.object({
9
+ client_id: oauth_client_id_js_1.oauthClientIdSchema,
10
+ client_assertion_type: zod_1.z.literal(constants_js_1.CLIENT_ASSERTION_TYPE_JWT_BEARER),
11
+ /**
12
+ * - "sub" the subject MUST be the "client_id" of the OAuth client
13
+ * - "iat" is required and MUST be less than one minute
14
+ * - "aud" must containing a value that identifies the authorization server
15
+ * - The JWT MAY contain a "jti" (JWT ID) claim that provides a unique identifier for the token.
16
+ * - Note that the authorization server may reject JWTs with an "exp" claim value that is unreasonably far in the future.
17
+ *
18
+ * @see {@link https://datatracker.ietf.org/doc/html/draft-ietf-oauth-jwt-bearer-11#section-3}
19
+ */
20
+ client_assertion: jwk_1.signedJwtSchema,
21
+ });
22
+ exports.oauthClientCredentialsSecretPostSchema = zod_1.z.object({
23
+ client_id: oauth_client_id_js_1.oauthClientIdSchema,
24
+ client_secret: zod_1.z.string(),
25
+ });
26
+ exports.oauthClientCredentialsSchema = zod_1.z.union([
27
+ exports.oauthClientCredentialsJwtBearerSchema,
28
+ exports.oauthClientCredentialsSecretPostSchema,
29
+ ]);
30
+ //# sourceMappingURL=oauth-client-credentials.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oauth-client-credentials.js","sourceRoot":"","sources":["../src/oauth-client-credentials.ts"],"names":[],"mappings":";;;AAAA,6BAAuB;AACvB,sCAA8C;AAE9C,6DAA0D;AAC1D,iDAAiE;AAEpD,QAAA,qCAAqC,GAAG,OAAC,CAAC,MAAM,CAAC;IAC5D,SAAS,EAAE,wCAAmB;IAC9B,qBAAqB,EAAE,OAAC,CAAC,OAAO,CAAC,+CAAgC,CAAC;IAClE;;;;;;;;OAQG;IACH,gBAAgB,EAAE,qBAAe;CAClC,CAAC,CAAA;AAEW,QAAA,sCAAsC,GAAG,OAAC,CAAC,MAAM,CAAC;IAC7D,SAAS,EAAE,wCAAmB;IAC9B,aAAa,EAAE,OAAC,CAAC,MAAM,EAAE;CAC1B,CAAC,CAAA;AAEW,QAAA,4BAA4B,GAAG,OAAC,CAAC,KAAK,CAAC;IAClD,6CAAqC;IACrC,8CAAsC;CACvC,CAAC,CAAA"}
@@ -0,0 +1,8 @@
1
+ import { OAuthClientId } from './oauth-client-id.js';
2
+ /**
3
+ * @see {@link https://drafts.aaronpk.com/draft-parecki-oauth-client-id-metadata-document/draft-parecki-oauth-client-id-metadata-document.html}
4
+ */
5
+ export type OAuthClientIdDiscoverable = OAuthClientId & `https://${string}`;
6
+ export declare function isOAuthClientIdDiscoverable<C extends OAuthClientId>(clientId: C): clientId is C & OAuthClientIdDiscoverable;
7
+ export declare function parseOAuthDiscoverableClientId(clientId: OAuthClientId): URL;
8
+ //# sourceMappingURL=oauth-client-id-discoverable.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oauth-client-id-discoverable.d.ts","sourceRoot":"","sources":["../src/oauth-client-id-discoverable.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAGpD;;GAEG;AACH,MAAM,MAAM,yBAAyB,GAAG,aAAa,GAAG,WAAW,MAAM,EAAE,CAAA;AAE3E,wBAAgB,2BAA2B,CAAC,CAAC,SAAS,aAAa,EACjE,QAAQ,EAAE,CAAC,GACV,QAAQ,IAAI,CAAC,GAAG,yBAAyB,CAO3C;AAED,wBAAgB,8BAA8B,CAAC,QAAQ,EAAE,aAAa,GAAG,GAAG,CA6C3E"}