44 lines
1.2 KiB
TypeScript
44 lines
1.2 KiB
TypeScript
declare namespace Session {
|
|
type CspValue = '*' | "'none'" | "'self'" | "'unsafe-inline'" | "'unsafe-eval'" | string;
|
|
|
|
/**
|
|
* This interface represents a content security policy.
|
|
*
|
|
* @see https://www.w3.org/TR/CSP/
|
|
* @see https://content-security-policy.com/
|
|
*/
|
|
type ContentSecurityPolicy = {
|
|
'child-src'?: CspValue[];
|
|
'connect-src'?: CspValue[];
|
|
'default-src'?: CspValue[];
|
|
'font-src'?: CspValue[];
|
|
'frame-src'?: CspValue[];
|
|
'img-src'?: CspValue[];
|
|
'media-src'?: CspValue[];
|
|
'script-src'?: CspValue[];
|
|
'script-src-elem'?: CspValue[];
|
|
'script-src-attr'?: CspValue[];
|
|
'style-src'?: CspValue[];
|
|
'worker-src'?: CspValue[];
|
|
};
|
|
|
|
/**
|
|
* meant for usages where the browser shouldn't unexpectedly fall back to default-src
|
|
*/
|
|
type CompleteContentSecurityPolicy = {
|
|
'child-src': CspValue[];
|
|
'connect-src': CspValue[];
|
|
'default-src': CspValue[];
|
|
'font-src': CspValue[];
|
|
'frame-src': CspValue[];
|
|
'img-src': CspValue[];
|
|
'media-src': CspValue[];
|
|
'object-src': ["'none'"];
|
|
'script-src': CspValue[];
|
|
'script-src-elem': CspValue[];
|
|
'script-src-attr': CspValue[];
|
|
'style-src': CspValue[];
|
|
'worker-src': CspValue[];
|
|
};
|
|
}
|