|
1 | 1 | import { z } from "zod";
|
2 | 2 |
|
| 3 | +/** |
| 4 | + * RFC 8414 OAuth 2.0 Authorization Server Metadata |
| 5 | + */ |
| 6 | +export const OAuthProtectedResourceMetadataSchema = z |
| 7 | + .object({ |
| 8 | + resource: z.string(), |
| 9 | + authorization_servers: z.array(z.string()).optional(), |
| 10 | + jwks_uri: z.string().optional(), |
| 11 | + scopes_supported: z.array(z.string()).optional(), |
| 12 | + bearer_methods_supported: z.array(z.string()).optional(), |
| 13 | + resource_signing_alg_values_supported: z.array(z.string()).optional(), |
| 14 | + resource_name: z.string().optional(), |
| 15 | + resource_documentation: z.string().optional(), |
| 16 | + resource_policy_uri: z.string().optional(), |
| 17 | + resource_tos_uri: z.string().optional(), |
| 18 | + tls_client_certificate_bound_access_tokens: z.boolean().optional(), |
| 19 | + authorization_details_types_supported: z.array(z.string()).optional(), |
| 20 | + dpop_signing_alg_values_supported: z.array(z.string()).optional(), |
| 21 | + dpop_bound_access_tokens_required: z.boolean().optional(), |
| 22 | + }) |
| 23 | + .passthrough(); |
| 24 | + |
3 | 25 | /**
|
4 | 26 | * RFC 8414 OAuth 2.0 Authorization Server Metadata
|
5 | 27 | */
|
@@ -109,6 +131,7 @@ export const OAuthTokenRevocationRequestSchema = z.object({
|
109 | 131 | token_type_hint: z.string().optional(),
|
110 | 132 | }).strip();
|
111 | 133 |
|
| 134 | +export type OAuthProtectedResourceMetadata = z.infer<typeof OAuthProtectedResourceMetadataSchema>; |
112 | 135 | export type OAuthMetadata = z.infer<typeof OAuthMetadataSchema>;
|
113 | 136 | export type OAuthTokens = z.infer<typeof OAuthTokensSchema>;
|
114 | 137 | export type OAuthErrorResponse = z.infer<typeof OAuthErrorResponseSchema>;
|
|
0 commit comments