apps/gateway/src/routes/edge-agent.ts
Metadata
- Purpose: Gateway HTTP route handlers and request/response behavior.
- Domain:
applications - Language:
ts - Bytes: 7329
- Lines: 207
- Content hash (short):
d5d305ea - Source (start): apps/gateway/src/routes/edge-agent.ts:1
- Source (end): apps/gateway/src/routes/edge-agent.ts:207
Indexed Symbols
No indexed functions/methods detected in this file.
Markdown Headings (if applicable)
No markdown headings detected.
Source Preview
import type { FastifyPluginAsync } from "fastify";
import { randomUUID } from "node:crypto";
import { SignJWT } from "jose";
import { getEffectiveWorkspaceSettings } from "../services/runtime-config.js";
import { query } from "../services/postgres.js";
import { getWorkspaceIdFromHeaders } from "../utils/workspace.js";
import { ensureRoles } from "../utils/authorization.js";
import { env } from "../config/env.js";
import { getIdempotencyKey, getIdempotencyRouteScope } from "../utils/idempotency.js";
const defaultPolicy = {
version: 1,
collection: {
heartbeat: { enabled: true, intervalSeconds: 60 },
patchCompliance: { enabled: true, intervalSeconds: 1800 },
backupStatus: { enabled: true, intervalSeconds: 900 }
},
remediation: {
autoApplyCriticalPatches: false,
requireApprovalForScripts: true
}
};
export const edgeAgentRoutes: FastifyPluginAsync = async (app) => {
app.get("/api/v1/edge-agent/policy", async (request, reply) => {