|
| 1 | +import type { OAuthMetadata } from '@modelcontextprotocol/server'; |
1 | 2 | import type { ProxyConfig } from './proxyConfig.ts'; |
2 | 3 |
|
3 | | -export interface AsMetadataDoc { |
4 | | - issuer: string; |
5 | | - authorization_endpoint: string; |
6 | | - token_endpoint: string; |
7 | | - registration_endpoint: string; |
8 | | - response_types_supported: string[]; |
9 | | - grant_types_supported: string[]; |
10 | | - code_challenge_methods_supported: string[]; |
11 | | - token_endpoint_auth_methods_supported: string[]; |
12 | | - authorization_response_iss_parameter_supported: boolean; |
13 | | - client_id_metadata_document_supported: boolean; |
14 | | - scopes_supported?: string[]; |
15 | | -} |
| 4 | +// The SDK's RFC 8414 document type, narrowed to the fields this proxy always |
| 5 | +// emits: the spec and its registry extensions make them optional, but clients |
| 6 | +// pick a compatible flow from these advertisements (grant types, auth |
| 7 | +// methods, PKCE, DCR, iss, CIMD). |
| 8 | +export type AsMetadataDoc = OAuthMetadata & |
| 9 | + Required< |
| 10 | + Pick< |
| 11 | + OAuthMetadata, |
| 12 | + | 'registration_endpoint' |
| 13 | + | 'grant_types_supported' |
| 14 | + | 'code_challenge_methods_supported' |
| 15 | + | 'token_endpoint_auth_methods_supported' |
| 16 | + | 'authorization_response_iss_parameter_supported' |
| 17 | + | 'client_id_metadata_document_supported' |
| 18 | + > |
| 19 | + >; |
16 | 20 |
|
17 | 21 | /** |
18 | 22 | * Builds the RFC 8414 authorization-server metadata document advertising this |
|
0 commit comments