Zum Inhalt springen
Deutsch

CsrfOptionsValidator

Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.

Defined in: src/http/middleware/CsrfOptions.ts:76

Validates resolved CsrfOptionsType settings. All rules are bespoke: secret is a string | Uint8Array union (byte length must be

= 16), and the cookie attributes are nested. A secret that is simply absent is a REQUIRED-field error enforced by csrfProtection, not here — the validator only checks the validity of a PRESENT secret.

new CsrfOptionsValidator(): CsrfOptionsValidator

Defined in: src/http/middleware/CsrfOptions.ts:77

CsrfOptionsValidator

OptionsValidator<CsrfOptionsType>.constructor

validate(settings): void

Defined in: src/util/OptionsValidator.ts:75

Check the (merged) settings; throws OptionsError on the first violation. Unset (undefined) fields always pass.

Partial<T>

void

OptionsValidator.validate