Skip to content

Never stop coding. Free MIT AI gateway: one endpoint, 375 providers (150+ free), 1,400+ models Kimi, Claude, GPT, Gemini, GLM, DeepSeek, MiniMax. Works with Claude Code, Codex, Cursor, OpenCode, Cline & Copilot. Quota-aware auto-fallback, RTK+Caveman compression saves 15-95% tokens, MCP/A2A, Desktop/PWA. Built by 900+ contributors

1.1 KB
Raw Blame
/**
 * Stub for `src/lib/cloudSync.ts` activated by
 * `OMNIROUTE_BUILD_PROFILE=minimal`. All Cloud Sync code paths
 * (signature verification, remote-credential merge, fetch with timeout) are
 * physically absent from the built bundle. See SECURITY.md and
 * docs/security/SOCKET_DEV_FINDINGS.md.
 */
import { featureDisabledError } from "@/lib/build-profile/featureDisabled";

const FEATURE = "cloud-sync";

export const CLOUD_URL = "";
export const CLOUD_SYNC_TIMEOUT_MS = 0;
export const CLOUD_SYNC_SECRETS_ENABLED = false;

export function verifyCloudSignature(_rawBody: string, _sigHeader: string | null): boolean {
  return false;
}

export async function fetchWithTimeout(): Promise<never> {
  throw featureDisabledError(FEATURE);
}

export async function syncToCloud(
  _machineId: string,
  _createdKey: string | null = null,
  _options: { explicitEnable?: boolean } = {}
): Promise<{ error: string }> {
  // Soft-fail instead of throwing so the caller (api/keys/[id]/route.ts) can
  // continue serving the rest of the request — Cloud sync is best-effort.
  return { error: "Cloud Sync is disabled in this build (minimal profile)" };
}