( organizationSelector: string | null, toolkitSlug: string | null = null, )
| 94 | |
| 95 | /** The protected-resource-metadata URL for an org selector, or the bare one. */ |
| 96 | export const protectedResourceMetadataUrlFor = ( |
| 97 | organizationSelector: string | null, |
| 98 | toolkitSlug: string | null = null, |
| 99 | ): string => { |
| 100 | const toolkitSuffix = toolkitSlug ? `/toolkits/${toolkitSlug}` : ""; |
| 101 | return organizationSelector |
| 102 | ? `${RESOURCE_ORIGIN}/.well-known/oauth-protected-resource/${organizationSelector}/mcp${toolkitSuffix}` |
| 103 | : `${PROTECTED_RESOURCE_METADATA_URL}${toolkitSuffix}`; |
| 104 | }; |
| 105 | |
| 106 | type McpUnauthorizedReason = "missing_bearer" | "invalid_token"; |
| 107 |
no outgoing calls
no test coverage detected