MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / validateEndpointUrl

Function validateEndpointUrl

packages/core/sdk/src/oauth-discovery.ts:151–163  ·  view source on GitHub ↗
(
  value: string,
  label: string,
  policy: OAuthEndpointUrlPolicy = {},
)

Source from the content-addressed store, hash-verified

149const MCP_PROTOCOL_VERSION_HEADER = "mcp-protocol-version";
150
151const validateEndpointUrl = (
152 value: string,
153 label: string,
154 policy: OAuthEndpointUrlPolicy = {},
155): Effect.Effect<string, OAuthDiscoveryError> =>
156 Effect.try({
157 try: () => assertSupportedOAuthEndpointUrl(value, label, policy),
158 catch: (cause) =>
159 new OAuthDiscoveryError({
160 message: `${label} must use https: or loopback http:`,
161 cause,
162 }),
163 });
164
165const validateAuthorizationServerMetadata = (
166 metadata: OAuthAuthorizationServerMetadata,

Calls 1

Tested by

no test coverage detected