apps/gateway/src/routes/settings.ts
Metadata
- Purpose: Gateway HTTP route handlers and request/response behavior.
- Domain:
applications - Language:
ts - Bytes: 11221
- Lines: 325
- Content hash (short):
a64d1774 - Source (start): apps/gateway/src/routes/settings.ts:1
- Source (end): apps/gateway/src/routes/settings.ts:325
Indexed Symbols
validateSecretKey(line 26, function) - Implements validate secret key for HTTP request handling.
Markdown Headings (if applicable)
No markdown headings detected.
Source Preview
import type { FastifyPluginAsync } from "fastify";
import {
putPlatformSettingsRequestSchema,
putWorkspaceSettingsRequestSchema,
upsertSecretRequestSchema
} from "@anchor/contracts";
import { getIdempotencyKey, getIdempotencyRouteScope } from "../utils/idempotency.js";
import { ensureRoles } from "../utils/authorization.js";
import { getWorkspaceIdFromHeaders } from "../utils/workspace.js";
import {
getEffectivePlatformSettings,
getEffectiveWorkspaceSettings,
invalidatePlatformSettingsCache
} from "../services/runtime-config.js";
import {
getPlatformSettingsRecord,
listRuntimeSecretKeys,
upsertPlatformSettingsRecord,
upsertRuntimeSecret,
upsertWorkspaceSettingsRecord
} from "../services/settings-repository.js";
const PLATFORM_SCOPE_WORKSPACE = "00000000-0000-0000-0000-000000000000";
const SECRET_KEY_REGEX = /^[A-Z0-9_]{3,64}$/;