Skip to main content

Function: omitSecrets()

function omitSecrets<S>(schema): ZodObject<Omit<S["shape"], SecretKeys<S["shape"]>>>;

Defined in: packages/overcast-core/src/config-schema.ts:358

schema without its ConfigMeta.secret fields — the key material and tokens — for a host whose config ends up somewhere it can be read: a browser bundle, generated documentation of real values, a log.

Read off each field's own metadata, so a secret added to a layer schema later is dropped here automatically rather than leaking until someone extends a hand-kept list of keys. The returned type omits the same keys.

Type Parameters​

Type Parameter
S extends ConfigSchema

Parameters​

ParameterType
schemaS

Returns​

ZodObject<Omit<S["shape"], SecretKeys<S["shape"]>>>