import { config } from './config' ; const DEFAULT_CONFIG = Object . freeze ( config . schema . validate ( { } ) ) ; public export interface ICspConfig { /**
     * The CSP rules used for OpenSearch Dashboards.
     */ readonly rules : string [ ] ; /**
     * Specify whether browsers that do not support CSP should be
     * able to use OpenSearch Dashboards. Use `true` to block and `false` to allow.
     */ readonly strict : boolean ; /**
     * Specify whether users with legacy browsers should be warned
     * about their lack of OpenSearch Dashboards security compliance.
     */ readonly warnLegacyBrowsers : boolean ; /**
     * The CSP rules in a formatted directives string for use
     * in a `Content-Security-Policy` header.
     */ readonly header : string ; } public export class CspConfig implements ICspConfig { static readonly DEFAULT = new CspConfig ( ) ; public readonly rules : string [ ] ; public readonly strict : boolean ; public readonly warnLegacyBrowsers : boolean ; public readonly header : string ; internal constructor ( rawCspConfig = { } ) { const source = { ... DEFAULT_CONFIG , ... rawCspConfig } ; this . rules = source . rules ; this . strict = source . strict ; this . warnLegacyBrowsers = source . warnLegacyBrowsers ; this . header = source . rules . join ( '; ' ) ; } }