Download src/agents/cli-runner/cli-backend-auth-policy.ts from SaylorTwift/openclaw: direct link, hf CLI and curl.
- Browser
- Download file 1.26 kB
-
https://huggingface.co/SaylorTwift/openclaw/resolve/main/src/agents/cli-runner/cli-backend-auth-policy.ts
- Command line
-
hf download hf://SaylorTwift/openclaw/src/agents/cli-runner/cli-backend-auth-policy.ts
-
curl -L -o cli-backend-auth-policy.ts https://huggingface.co/SaylorTwift/openclaw/resolve/main/src/agents/cli-runner/cli-backend-auth-policy.ts
1.26 kB
| /** | |
| * Core-internal auth policy for bundled auth-owning CLI backends. Membership controls | |
| * selected-profile resolution and raw credential forwarding during prepareExecution; | |
| * third-party plugins cannot declare this trust decision through Plugin SDK metadata. | |
| */ | |
| export type BundledCliBackendAuthPolicy = { | |
| /** Disable profile fallback and fail closed when the selected profile cannot materialize. */ | |
| strictSelectedProfile: boolean; | |
| /** Owner responsible for refreshing selected OAuth credentials before execution. */ | |
| oauthRefreshOwner: "core" | "cli"; | |
| /** Retired OAuth profile identities that the native runtime owns instead. */ | |
| nativeAuthProfileIds?: readonly string[]; | |
| }; | |
| const BUNDLED_CLI_BACKEND_AUTH_POLICIES = { | |
| "claude-cli": { | |
| strictSelectedProfile: true, | |
| oauthRefreshOwner: "core", | |
| nativeAuthProfileIds: ["anthropic:claude-cli"], | |
| }, | |
| "google-gemini-cli": { | |
| strictSelectedProfile: false, | |
| oauthRefreshOwner: "cli", | |
| }, | |
| } satisfies Record<string, BundledCliBackendAuthPolicy>; | |
| export function resolveBundledCliBackendAuthPolicy( | |
| backendId: string, | |
| ): BundledCliBackendAuthPolicy | undefined { | |
| return BUNDLED_CLI_BACKEND_AUTH_POLICIES[ | |
| backendId as keyof typeof BUNDLED_CLI_BACKEND_AUTH_POLICIES | |
| ]; | |
| } | |