Download src/types/mcp-auth.ts from SaylorTwift/openhands: direct link, hf CLI and curl.
- Browser
- Download file 928 Bytes
-
https://huggingface.co/SaylorTwift/openhands/resolve/main/src/types/mcp-auth.ts
- Command line
-
hf download hf://SaylorTwift/openhands/src/types/mcp-auth.ts
-
curl -L -o mcp-auth.ts https://huggingface.co/SaylorTwift/openhands/resolve/main/src/types/mcp-auth.ts
928 Bytes
| import type { | |
| MCPAuthCredential, | |
| MCPOAuthAuthentication, | |
| } from "@openhands/typescript-client"; | |
| export type { | |
| MCPAuthCredential, | |
| MCPOAuthAuthentication, | |
| MCPOAuthState, | |
| } from "@openhands/typescript-client"; | |
| export type MCPAuthenticationConfig = MCPOAuthAuthentication; | |
| export type MCPOAuthAuthenticationConfig = MCPOAuthAuthentication; | |
| export type MCPOAuthClientAuthMethod = NonNullable< | |
| MCPOAuthAuthentication["client_auth_method"] | |
| >; | |
| export const MCP_AUTH_STRATEGIES = [ | |
| "none", | |
| "api_key", | |
| "bearer", | |
| "basic", | |
| "header", | |
| "oauth2", | |
| ] as const; | |
| const isRecord = (value: unknown): value is Record<string, unknown> => | |
| !!value && typeof value === "object" && !Array.isArray(value); | |
| export const isMcpAuthCredential = ( | |
| value: unknown, | |
| ): value is MCPAuthCredential => | |
| isRecord(value) && | |
| typeof value.strategy === "string" && | |
| (MCP_AUTH_STRATEGIES as readonly string[]).includes(value.strategy); | |