Something went wrong. Try again.
This repository has no description
Something went wrong. Try again.
JavaScript
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667import { DEPLOYMENT_CAPABILITIES } from "../../configuration/oauth-capabilities.ts";import release from "../../package.json" with { type: "json" };// Synthetic capability mapping solely for local tests. This is NOT a certified// live Cloudflare deployment scope set or a publisher configuration example.export function oauthConfig(origin, method = "none") { const scopeIds = ["openid", "account.read", "workers-platform.write"]; const redirectUri = `${origin}/auth/callback`; return { schemaVersion: 1, publicOrigin: origin, oauthClientId: "fixture-flarebot-client", oauthRedirectUri: redirectUri, oauthScopes: scopeIds, oauthTokenAuthMethod: method, oauthCapabilities: { schemaVersion: 1, artifactVersion: release.version, reviewedAt: "2026-09-06", registeredClient: { clientId: "fixture-flarebot-client", redirectUri, tokenAuthMethod: method, scopeIds, userinfoVerified: true, }, scopes: [ { id: "openid", name: "Fixture identity", resourceScopes: [], capabilities: ["identity"], }, { id: "account.read", name: "Fixture Account Read", resourceScopes: ["com.cloudflare.api.account"], capabilities: ["account-selection"], }, { id: "workers-platform.write", name: "Synthetic full deployment mapping, not live certified", resourceScopes: ["fixture-resource"], capabilities: DEPLOYMENT_CAPABILITIES.filter( (c) => !["identity", "account-selection"].includes(c), ), }, ], }, };}export function oauthBindings(origin, method = "none") { return { FLAREBOT_MODE: "control-plane", FLAREBOT_ENV: "development", FLAREBOT_CONTROL_PLANE: JSON.stringify(oauthConfig(origin, method)), FLAREBOT_SESSION_SECRET: "test-only-independent-control-session-secret", FLAREBOT_CREDENTIAL_ENCRYPTION_KEY: Buffer.alloc(32, 19).toString( "base64url", ), ...(method === "none" ? {} : { FLAREBOT_OAUTH_CLIENT_SECRET: "confidential-client-secret-sentinel", }), };}