Files
Aether/frontend/src/features/providers/components/endpoint-secret-markers.ts
T
elky 579f2c7cc1 feat(security): harden gateway boundaries and usage policies
Consolidate subscription usage policy enforcement, privacy-safe persistence, and gateway security hardening into one reviewable change.

Includes bounded HTTP and execution envelopes, header and protocol guards, DNS and relay validation, authentication and secret projection hardening, secure backup/install paths, and regression coverage.
2026-09-04 03:45:52 +08:00

21 lines
552 B
TypeScript

export const REDACTED_SECRET_PLACEHOLDER = '***'
export type EndpointSecretMarker = 'has_value' | 'has_pattern' | 'has_replacement'
export function retainsEndpointSecret(
value: unknown,
marker: unknown,
): boolean {
return marker === true && value === REDACTED_SECRET_PLACEHOLDER
}
export function endpointSecretMarkerPayload(
marker: EndpointSecretMarker,
retained: boolean,
value: unknown,
): Partial<Record<EndpointSecretMarker, true>> {
return retained && value === REDACTED_SECRET_PLACEHOLDER
? { [marker]: true }
: {}
}