Reorganize repo structure and standards references
This commit is contained in:
1 parent
3cb93a81be
commit
be2054274d
5885 files changed
+2588
-195
No files matched your search
@@ -0,0 +1,349 @@
|
||||
export const routeAccessClasses = [
|
||||
"public-health",
|
||||
"public-docs",
|
||||
"service-token",
|
||||
"service-or-tenant-api-key",
|
||||
"optional-api-key-validation",
|
||||
"tenant-api-key",
|
||||
"webhook-signature",
|
||||
"jwt-auth",
|
||||
"auth-credential-exchange",
|
||||
"public-analytics-token",
|
||||
"canonical-redirect",
|
||||
] as const;
|
||||
|
||||
export type RouteAccessClass = (typeof routeAccessClasses)[number];
|
||||
|
||||
export type RouteMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "OPTIONS" | "ALL";
|
||||
|
||||
export type RouteAccessKey = `${RouteMethod} ${string}`;
|
||||
|
||||
export type RouteAccessInventoryEntry = {
|
||||
method: RouteMethod;
|
||||
path: string;
|
||||
accessClass: RouteAccessClass;
|
||||
rationale: string;
|
||||
sensitiveData: boolean | string;
|
||||
};
|
||||
|
||||
export function routeAccessKey(route: Pick<RouteAccessInventoryEntry, "method" | "path">): RouteAccessKey {
|
||||
return `${route.method} ${route.path}`;
|
||||
}
|
||||
|
||||
export const routeAccessInventory = [
|
||||
{
|
||||
method: "GET",
|
||||
path: "/healthz",
|
||||
accessClass: "public-health",
|
||||
rationale: "Unauthenticated liveness probe returns only service status and request correlation metadata.",
|
||||
sensitiveData: false,
|
||||
},
|
||||
{
|
||||
method: "GET",
|
||||
path: "/v1/health",
|
||||
accessClass: "public-health",
|
||||
rationale: "Unauthenticated versioned liveness probe returns only service status and request correlation metadata.",
|
||||
sensitiveData: false,
|
||||
},
|
||||
{
|
||||
method: "GET",
|
||||
path: "/readyz",
|
||||
accessClass: "public-health",
|
||||
rationale: "Unauthenticated readiness probe returns redacted dependency status for infrastructure checks.",
|
||||
sensitiveData: "Dependency health state is exposed without implementation details.",
|
||||
},
|
||||
{
|
||||
method: "GET",
|
||||
path: "/status",
|
||||
accessClass: "public-health",
|
||||
rationale: "Unauthenticated status probe for external uptime monitors. Returns boolean-only health, revision, region, uptime.",
|
||||
sensitiveData: "Boolean health state and deployment region tag only — no connection strings, hostnames or stack traces.",
|
||||
},
|
||||
{
|
||||
method: "GET",
|
||||
path: "/metrics",
|
||||
accessClass: "service-token",
|
||||
rationale: "Prometheus scrape endpoint requires bearer METRICS_TOKEN. Returns 404 when METRICS_ENABLED is false.",
|
||||
sensitiveData: "Prom text-format counters and gauges — includes business KPIs (AI tokens, mail, webhook, queue depth). Token-protected.",
|
||||
},
|
||||
{
|
||||
method: "GET",
|
||||
path: "/v1/openapi.json",
|
||||
accessClass: "public-docs",
|
||||
rationale: "OpenAPI discovery is intentionally public for client integration and contains schema metadata only.",
|
||||
sensitiveData: false,
|
||||
},
|
||||
{
|
||||
method: "GET",
|
||||
path: "/v1/docs",
|
||||
accessClass: "public-docs",
|
||||
rationale: "Documentation shell is intentionally public and renders the OpenAPI document without runtime data.",
|
||||
sensitiveData: false,
|
||||
},
|
||||
{
|
||||
method: "GET",
|
||||
path: "/v1/session/current-user",
|
||||
accessClass: "service-token",
|
||||
rationale: "Current service principal endpoint requires a bearer service token before returning authentication state.",
|
||||
sensitiveData: "Returns authenticated principal type metadata only.",
|
||||
},
|
||||
{
|
||||
method: "POST",
|
||||
path: "/v1/auth/login",
|
||||
accessClass: "auth-credential-exchange",
|
||||
rationale: "Login exchanges submitted email and password credentials for a short-lived JWT after password verification.",
|
||||
sensitiveData: "Consumes credentials and returns a JWT plus basic user identity.",
|
||||
},
|
||||
{
|
||||
method: "POST",
|
||||
path: "/v1/auth/refresh-token",
|
||||
accessClass: "jwt-auth",
|
||||
rationale: "Refresh requires an existing bearer JWT before issuing a replacement token for the same user.",
|
||||
sensitiveData: "Returns a JWT plus basic user identity.",
|
||||
},
|
||||
{
|
||||
method: "POST",
|
||||
path: "/v1/auth/logout",
|
||||
accessClass: "jwt-auth",
|
||||
rationale: "Logout requires an existing bearer JWT before revoking the active API session and clearing the API cookie.",
|
||||
sensitiveData: "Consumes JWT credential material but returns only a success envelope and expired cookie attributes.",
|
||||
},
|
||||
{
|
||||
method: "POST",
|
||||
path: "/v1/api-keys/validate",
|
||||
accessClass: "optional-api-key-validation",
|
||||
rationale: "API-key validation optionally accepts a presented stored API key or service token and reports redacted validation status without requiring a prior credential.",
|
||||
sensitiveData: "Returns redacted stored API-key metadata but never plaintext key material.",
|
||||
},
|
||||
{
|
||||
method: "POST",
|
||||
path: "/v1/ai/upload",
|
||||
accessClass: "service-token",
|
||||
rationale: "AI upload writes request content through configured S3-compatible service storage credentials and depends on server-side upload configuration.",
|
||||
sensitiveData: "Consumes uploaded file content and may return a public storage URL.",
|
||||
},
|
||||
{
|
||||
method: "POST",
|
||||
path: "/v1/support/inbound-email",
|
||||
accessClass: "webhook-signature",
|
||||
rationale: "Inbound support email verifies Mailjet webhook Basic-Auth credentials before resolving tenant inbound addresses and creating tickets.",
|
||||
sensitiveData: "Consumes signed email metadata and message body while omitting provider payloads and signing material from responses.",
|
||||
},
|
||||
{
|
||||
method: "POST",
|
||||
path: "/v1/analytics/events",
|
||||
accessClass: "public-analytics-token",
|
||||
rationale: "Analytics event ingestion is public-facing and scoped by analytics payload identifiers rather than browser session state.",
|
||||
sensitiveData: "Consumes analytics identifiers, URLs, routes, and event labels.",
|
||||
},
|
||||
{
|
||||
method: "POST",
|
||||
path: "/v1/analytics/page-views",
|
||||
accessClass: "public-analytics-token",
|
||||
rationale: "Analytics page-view ingestion is public-facing and scoped by analytics payload identifiers plus ignore-page settings.",
|
||||
sensitiveData: "Consumes analytics identifiers, URLs, and route names.",
|
||||
},
|
||||
{
|
||||
method: "GET",
|
||||
path: "/v1/analytics/public",
|
||||
accessClass: "public-analytics-token",
|
||||
rationale: "Public analytics overview requires the analytics token header before returning aggregate metrics.",
|
||||
sensitiveData: "Returns aggregate analytics counts and top-level chart data.",
|
||||
},
|
||||
{
|
||||
method: "GET",
|
||||
path: "/v1/analytics/admin",
|
||||
accessClass: "service-token",
|
||||
rationale: "Admin analytics overview requires service credentials before returning tenant or portal scoped metrics.",
|
||||
sensitiveData: "Returns aggregate analytics metrics that may be scoped to a portal identifier.",
|
||||
},
|
||||
{
|
||||
method: "GET",
|
||||
path: "/v1/notifications/stream",
|
||||
accessClass: "service-token",
|
||||
rationale: "Notification stream requires service credentials before returning tenant and user scoped in-app delivery diagnostics over SSE.",
|
||||
sensitiveData: "Returns bounded, sanitized notification delivery snapshots and cursors without provider payloads, metadata, or raw delivery secrets.",
|
||||
},
|
||||
{
|
||||
method: "GET",
|
||||
path: "/v1/accounts",
|
||||
accessClass: "service-token",
|
||||
rationale: "Account listing requires service credentials before returning tenant account metadata and subscription summaries.",
|
||||
sensitiveData: "Returns tenant identifiers, names, slugs, icons, and subscription summary fields without plaintext secrets.",
|
||||
},
|
||||
{
|
||||
method: "GET",
|
||||
path: "/v1/accounts/:id",
|
||||
accessClass: "service-token",
|
||||
rationale: "Account lookup requires service credentials before returning one tenant account metadata and subscription summary.",
|
||||
sensitiveData: "Returns tenant identifiers, names, slugs, icons, and subscription summary fields without plaintext secrets.",
|
||||
},
|
||||
{
|
||||
method: "GET",
|
||||
path: "/v1/usage",
|
||||
accessClass: "tenant-api-key",
|
||||
rationale: "Usage lookups enter through the canonical API host and validate tenant API-key credentials in the API runtime.",
|
||||
sensitiveData: "Returns plan and remaining API usage metadata for the credential-scoped tenant.",
|
||||
},
|
||||
{
|
||||
method: "POST",
|
||||
path: "/v1/billing/stripe/webhooks",
|
||||
accessClass: "webhook-signature",
|
||||
rationale: "Stripe billing webhook ingress enters through the canonical API host and verifies the raw signed payload in the API runtime.",
|
||||
sensitiveData: "Consumes signed billing lifecycle webhook payloads without returning signing material or plaintext credentials.",
|
||||
},
|
||||
{
|
||||
method: "POST",
|
||||
path: "/v1/email-sequences/mailjet/webhooks",
|
||||
accessClass: "webhook-signature",
|
||||
rationale: "Email-sequence provider webhooks verify Mailjet Basic-Auth credentials before correlating bounce events to provider message ids.",
|
||||
sensitiveData: "Consumes delivery event metadata while responses omit provider payloads, recipient data, and credentials.",
|
||||
},
|
||||
{
|
||||
method: "GET",
|
||||
path: "/v1/workspaces/:tenantId/auth/providers",
|
||||
accessClass: "service-token",
|
||||
rationale: "Workspace auth-provider discovery requires a service token before returning tenant-scoped SSO metadata.",
|
||||
sensitiveData: "Returns redacted OIDC/SAML provider metadata only; client secrets, SAML certificate bodies, private keys, token hashes, invite tokens, and raw metadata documents are omitted.",
|
||||
},
|
||||
{
|
||||
method: "POST",
|
||||
path: "/v1/workspaces/:tenantId/context/revalidate",
|
||||
accessClass: "service-token",
|
||||
rationale: "Workspace context revalidation requires a service token before confirming tenant/user membership for a context switch.",
|
||||
sensitiveData: "Consumes tenant and user identifiers and returns a redacted validity envelope without provider secrets, invite tokens, token hashes, or SSO secret material.",
|
||||
},
|
||||
{
|
||||
method: "GET",
|
||||
path: "/v1/workspaces/:tenantId/invites",
|
||||
accessClass: "service-token",
|
||||
rationale: "Workspace invite listing requires a service token before returning tenant-scoped invite lifecycle state.",
|
||||
sensitiveData: "Returns invite email, lifecycle timestamps, audit user ids, and tokenPrefix only; plaintext tokens and token hashes are omitted.",
|
||||
},
|
||||
{
|
||||
method: "POST",
|
||||
path: "/v1/workspaces/:tenantId/invites",
|
||||
accessClass: "service-token",
|
||||
rationale: "Workspace invite creation requires a service token before issuing a tenant-scoped invite token.",
|
||||
sensitiveData: "Consumes invite recipient details and returns the one-time plaintext invite token only in the create response.",
|
||||
},
|
||||
{
|
||||
method: "POST",
|
||||
path: "/v1/workspaces/:tenantId/invites/:inviteId/accept",
|
||||
accessClass: "service-token",
|
||||
rationale: "Workspace invite acceptance requires a service token and a one-time invite token before finalizing tenant membership invitation state.",
|
||||
sensitiveData: "Consumes plaintext invite token and returns redacted invite lifecycle metadata without echoing the token.",
|
||||
},
|
||||
{
|
||||
method: "POST",
|
||||
path: "/v1/workspaces/:tenantId/invites/:inviteId/revoke",
|
||||
accessClass: "service-token",
|
||||
rationale: "Workspace invite revocation requires a service token before finalizing the tenant-scoped invite as revoked.",
|
||||
sensitiveData: "Consumes revoke audit metadata and returns redacted invite lifecycle metadata without token material.",
|
||||
},
|
||||
{
|
||||
method: "POST",
|
||||
path: "/v1/events/webhooks/attempts/:id",
|
||||
accessClass: "webhook-signature",
|
||||
rationale: "Webhook retry verifies Mailjet webhook Basic-Auth credentials before looking up or queueing a known delivery attempt.",
|
||||
sensitiveData: "Consumes signed webhook delivery metadata and an attempt id while omitting provider payloads and signing material from responses.",
|
||||
},
|
||||
{
|
||||
method: "POST",
|
||||
path: "/v1/maintenance/export-retention/enqueue",
|
||||
accessClass: "service-token",
|
||||
rationale: "Export artifact retention cleanup is an operator maintenance action and requires service credentials before enqueueing work.",
|
||||
sensitiveData: "Consumes an optional bounded batch size and returns only queue task metadata plus request correlation.",
|
||||
},
|
||||
{
|
||||
method: "GET",
|
||||
path: "/v1/entities/:entity/rows",
|
||||
accessClass: "service-or-tenant-api-key",
|
||||
rationale: "Entity row listing requires a service token or scoped stored API key with read permission for the resolved entity.",
|
||||
sensitiveData: "Returns tenant-scoped legacy entity row data.",
|
||||
},
|
||||
{
|
||||
method: "POST",
|
||||
path: "/v1/entities/:entity/rows",
|
||||
accessClass: "service-or-tenant-api-key",
|
||||
rationale: "Entity row creation requires a service token or scoped stored API key with create permission for the resolved entity.",
|
||||
sensitiveData: "Consumes and stores tenant-scoped legacy entity row data.",
|
||||
},
|
||||
{
|
||||
method: "GET",
|
||||
path: "/v1/entities/:entity/rows/:rowId",
|
||||
accessClass: "service-or-tenant-api-key",
|
||||
rationale: "Entity row lookup requires a service token or scoped stored API key with read permission for the resolved entity.",
|
||||
sensitiveData: "Returns tenant-scoped legacy entity row data.",
|
||||
},
|
||||
{
|
||||
method: "PATCH",
|
||||
path: "/v1/entities/:entity/rows/:rowId",
|
||||
accessClass: "service-or-tenant-api-key",
|
||||
rationale: "Entity row update requires a service token or scoped stored API key with update permission for the resolved entity.",
|
||||
sensitiveData: "Consumes and returns tenant-scoped legacy entity row data.",
|
||||
},
|
||||
{
|
||||
method: "DELETE",
|
||||
path: "/v1/entities/:entity/rows/:rowId",
|
||||
accessClass: "service-or-tenant-api-key",
|
||||
rationale: "Entity row deletion requires a service token or scoped stored API key with delete permission for the resolved entity.",
|
||||
sensitiveData: "Deletes tenant-scoped legacy entity row data and returns the deleted row id.",
|
||||
},
|
||||
{
|
||||
method: "POST",
|
||||
path: "/v1/relationships",
|
||||
accessClass: "service-or-tenant-api-key",
|
||||
rationale: "Relationship creation requires a service token or scoped stored API key with create permission for both related entities.",
|
||||
sensitiveData: "Consumes row identifiers and returns relationship metadata.",
|
||||
},
|
||||
{
|
||||
method: "GET",
|
||||
path: "/v1/relationships/:id",
|
||||
accessClass: "service-or-tenant-api-key",
|
||||
rationale: "Relationship lookup requires a service token or scoped stored API key with read permission for both related entities.",
|
||||
sensitiveData: "Returns relationship metadata with parent and child row envelopes.",
|
||||
},
|
||||
{
|
||||
method: "DELETE",
|
||||
path: "/v1/relationships/:id",
|
||||
accessClass: "service-or-tenant-api-key",
|
||||
rationale: "Relationship deletion requires a service token or scoped stored API key with delete permission for both related entities.",
|
||||
sensitiveData: "Deletes and returns relationship metadata with parent and child row envelopes.",
|
||||
},
|
||||
{
|
||||
method: "GET",
|
||||
path: "/v1/exports/:exportJobId/download-url",
|
||||
accessClass: "service-or-tenant-api-key",
|
||||
rationale: "Export download URL creation requires service credentials or a tenant-bound stored API key and blocks compliance-paused exports before returning a short-lived signed artifact URL envelope.",
|
||||
sensitiveData: "Returns a signed artifact URL envelope without artifact bucket/key values, storage credentials, pause reason internals, filters, or object bodies.",
|
||||
},
|
||||
{
|
||||
method: "GET",
|
||||
path: "/v1/entities/:entity",
|
||||
accessClass: "service-token",
|
||||
rationale: "Legacy entity lookup requires service credentials before returning the named entity detail graph.",
|
||||
sensitiveData: "Returns legacy entity schema and relationship details.",
|
||||
},
|
||||
{
|
||||
method: "GET",
|
||||
path: "/v1/exports/:exportJobId/progress",
|
||||
accessClass: "service-or-tenant-api-key",
|
||||
rationale: "Export progress polling requires service credentials or a tenant-bound stored API key; the handler scopes lookups to the caller's tenant and never leaks artifact bucket/key details.",
|
||||
sensitiveData: "Returns export progress envelope (status, percent, rowCount) — no artifact URLs, no compliance-pause internals, no filters.",
|
||||
},
|
||||
{
|
||||
method: "POST",
|
||||
path: "/v1/devices/register",
|
||||
accessClass: "service-token",
|
||||
rationale: "Mobile push-token registration requires a service credential (bearer/API-key) carrying user identity; the body's userId + tenantId are reconciled against the authenticated principal downstream.",
|
||||
sensitiveData: "Persists device-bound push token. Stored token is hashed at rest; response contains only the registration id + masked token preview.",
|
||||
},
|
||||
{
|
||||
method: "POST",
|
||||
path: "/v1/devices/revoke",
|
||||
accessClass: "service-token",
|
||||
rationale: "Mobile push-token revocation requires a service credential; the handler revokes by token hash and never echoes the raw token.",
|
||||
sensitiveData: "Returns revocation confirmation without echoing the device token or push provider internals.",
|
||||
},
|
||||
] as const satisfies readonly RouteAccessInventoryEntry[];
|
||||
Reference in new issue
Block a user