[]previous and next page

DuskSecurityConfig

Security settings of the file.

Security settings of the file. Secrets are not among them.

Import#

ts
import type { DuskSecurityConfig } from "@shadow-js/dusk/vite";

Signature#

ts
interface DuskSecurityConfig {
  readonly allowedHosts?: readonly string[];
  /** With `allowedHosts: []` in production: accept any Host on purpose. */
  readonly acknowledgeNoHostCheck?: boolean;
  readonly headers?: false | SecureHeadersOptions;
  readonly csp?: false | CspOptions;
  readonly csrf?: false | CsrfOptions;
  readonly limits?: LimitsOptions;
  readonly trustProxy?: false | TrustProxyOptions;
  readonly nonce?: boolean;
  /** Origins that may send state-changing requests and absolute redirects. */
  readonly trustedOrigins?: readonly string[];
  /** Cross-origin access to API routes, for the listed origins only. */
  readonly cors?: CorsOptions;
  readonly rpc?: {
    readonly maxGetPayloadChars?: number;
    readonly maxResponseBytes?: number;
    readonly maxBatchSize?: number;
  };
  readonly maxPayloadBytes?: number;
  /** The `cache-control` of a response that sets none: a value, or `false` for none. Default `private, no-store`. */
  readonly defaultCacheControl?: string | false;
}

Members#

Name Type Description
allowedHosts? readonly allowedHosts?: readonly string[]
acknowledgeNoHostCheck? readonly acknowledgeNoHostCheck?: boolean With allowedHosts: [] in production: accept any Host on purpose.
headers? readonly headers?: false | SecureHeadersOptions
csp? readonly csp?: false | CspOptions
csrf? readonly csrf?: false | CsrfOptions
limits? readonly limits?: LimitsOptions
trustProxy? readonly trustProxy?: false | TrustProxyOptions
nonce? readonly nonce?: boolean
trustedOrigins? readonly trustedOrigins?: readonly string[] Origins that may send state-changing requests and absolute redirects.
cors? readonly cors?: CorsOptions Cross-origin access to API routes, for the listed origins only.
rpc? readonly rpc?: { readonly maxGetPayloadChars?: number; readonly maxResponseBytes?: number; readonly maxBatchSize?: number; }
maxPayloadBytes? readonly maxPayloadBytes?: number
defaultCacheControl? readonly defaultCacheControl?: string | false The cache-control of a response that sets none: a value, or false for none. Default private, no-store.