quidproquo-webserver 0.0.82 → 0.0.84

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,3 @@
1
1
  export * from './QPQConfig';
2
2
  export * from './settings';
3
+ export * from './types';
@@ -16,3 +16,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./QPQConfig"), exports);
18
18
  __exportStar(require("./settings"), exports);
19
+ __exportStar(require("./types"), exports);
@@ -1,5 +1,6 @@
1
1
  import { QPQConfigSetting, QPQConfigAdvancedSettings } from 'quidproquo-core';
2
2
  import { CacheSettings } from '../QPQConfig';
3
+ import { ResponseSecurityHeaders } from '../types/ResponseSecurityHeaders';
3
4
  export interface WebDomainOptions {
4
5
  subDomainName?: string;
5
6
  onRootDomain: boolean;
@@ -19,6 +20,7 @@ export interface QPQConfigAdvancedWebEntrySettings extends QPQConfigAdvancedSett
19
20
  indexRoot?: string;
20
21
  ignoreCache?: string[];
21
22
  compressFiles?: boolean;
23
+ securityHeaders?: ResponseSecurityHeaders;
22
24
  }
23
25
  export interface WebEntryQPQWebServerConfigSetting extends QPQConfigSetting {
24
26
  name: string;
@@ -30,5 +32,6 @@ export interface WebEntryQPQWebServerConfigSetting extends QPQConfigSetting {
30
32
  seoBuildPath?: string;
31
33
  ignoreCache: string[];
32
34
  compressFiles: boolean;
35
+ securityHeaders?: ResponseSecurityHeaders;
33
36
  }
34
37
  export declare const defineWebEntry: (name: string, options?: QPQConfigAdvancedWebEntrySettings) => WebEntryQPQWebServerConfigSetting;
@@ -25,6 +25,7 @@ const defineWebEntry = (name, options) => {
25
25
  seoBuildPath: options === null || options === void 0 ? void 0 : options.seoBuildPath,
26
26
  ignoreCache: (options === null || options === void 0 ? void 0 : options.ignoreCache) || [],
27
27
  compressFiles: (_c = options === null || options === void 0 ? void 0 : options.compressFiles) !== null && _c !== void 0 ? _c : true,
28
+ securityHeaders: options === null || options === void 0 ? void 0 : options.securityHeaders,
28
29
  });
29
30
  };
30
31
  exports.defineWebEntry = defineWebEntry;
@@ -0,0 +1,215 @@
1
+ export declare enum HeadersFrameOption {
2
+ /**
3
+ * The page can only be displayed in a frame on the same origin as the page itself.
4
+ */
5
+ DENY = "DENY",
6
+ /**
7
+ * The page can only be displayed in a frame on the specified origin.
8
+ */
9
+ SAMEORIGIN = "SAMEORIGIN"
10
+ }
11
+ /**
12
+ * Enum representing possible values of the Referrer-Policy HTTP response header.
13
+ */
14
+ export declare enum HeadersReferrerPolicy {
15
+ /**
16
+ * The referrer policy is not set.
17
+ */
18
+ NO_REFERRER = "no-referrer",
19
+ /**
20
+ * The referrer policy is no-referrer-when-downgrade.
21
+ */
22
+ NO_REFERRER_WHEN_DOWNGRADE = "no-referrer-when-downgrade",
23
+ /**
24
+ * The referrer policy is origin.
25
+ */
26
+ ORIGIN = "origin",
27
+ /**
28
+ * The referrer policy is origin-when-cross-origin.
29
+ */
30
+ ORIGIN_WHEN_CROSS_ORIGIN = "origin-when-cross-origin",
31
+ /**
32
+ * The referrer policy is same-origin.
33
+ */
34
+ SAME_ORIGIN = "same-origin",
35
+ /**
36
+ * The referrer policy is strict-origin.
37
+ */
38
+ STRICT_ORIGIN = "strict-origin",
39
+ /**
40
+ * The referrer policy is strict-origin-when-cross-origin.
41
+ */
42
+ STRICT_ORIGIN_WHEN_CROSS_ORIGIN = "strict-origin-when-cross-origin",
43
+ /**
44
+ * The referrer policy is unsafe-url.
45
+ */
46
+ UNSAFE_URL = "unsafe-url"
47
+ }
48
+ export interface QpqServiceContentSecurityPolicy {
49
+ /**
50
+ * The name of the api subdomain name for the given service
51
+ */
52
+ api: string;
53
+ /**
54
+ * The domain name the service is hosted on, if left undefined, the domain name of this service will be used
55
+ */
56
+ domain?: string;
57
+ /**
58
+ * The service name, as seen in the subdomain
59
+ */
60
+ service?: string;
61
+ }
62
+ /**
63
+ * CSP Entry ~ a string or a complex service type
64
+ */
65
+ export type ContentSecurityPolicyEntry = QpqServiceContentSecurityPolicy | string;
66
+ /**
67
+ * The policy directives and their values that CDN includes as values for the Content-Security-Policy HTTP response header.
68
+ */
69
+ export interface ResponseHeadersContentSecurityPolicy {
70
+ /**
71
+ * The policy directives and their values that CDN includes as values for the Content-Security-Policy HTTP response header.
72
+ */
73
+ readonly contentSecurityPolicy: Record<string, ContentSecurityPolicyEntry[]>;
74
+ /**
75
+ * A Boolean that determines whether CDN overrides the Content-Security-Policy HTTP response header
76
+ * received from the origin with the one specified in this response headers policy.
77
+ */
78
+ readonly override: boolean;
79
+ }
80
+ /**
81
+ * Determines whether CDN includes the X-Content-Type-Options HTTP response header with its value set to nosniff.
82
+ */
83
+ export interface ResponseHeadersContentTypeOptions {
84
+ /**
85
+ * A Boolean that determines whether CDN overrides the X-Content-Type-Options HTTP response header
86
+ * received from the origin with the one specified in this response headers policy.
87
+ */
88
+ readonly override: boolean;
89
+ }
90
+ /**
91
+ * Determines whether CDN includes the X-Frame-Options HTTP response header and the header’s value.
92
+ */
93
+ export interface ResponseHeadersFrameOptions {
94
+ /**
95
+ * The value of the X-Frame-Options HTTP response header.
96
+ */
97
+ readonly frameOption: HeadersFrameOption;
98
+ /**
99
+ * A Boolean that determines whether CDN overrides the X-Frame-Options HTTP response header
100
+ * received from the origin with the one specified in this response headers policy.
101
+ */
102
+ readonly override: boolean;
103
+ }
104
+ /**
105
+ * Determines whether CDN includes the Referrer-Policy HTTP response header and the header’s value.
106
+ */
107
+ export interface ResponseHeadersReferrerPolicy {
108
+ /**
109
+ * The value of the Referrer-Policy HTTP response header.
110
+ */
111
+ readonly referrerPolicy: HeadersReferrerPolicy;
112
+ /**
113
+ * A Boolean that determines whether CDN overrides the Referrer-Policy HTTP response header
114
+ * received from the origin with the one specified in this response headers policy.
115
+ */
116
+ readonly override: boolean;
117
+ }
118
+ /**
119
+ * Determines whether CDN includes the Strict-Transport-Security HTTP response header and the header’s value.
120
+ */
121
+ export interface ResponseHeadersStrictTransportSecurity {
122
+ /**
123
+ * A number that CDN uses as the value for the max-age directive in the Strict-Transport-Security HTTP response header.
124
+ */
125
+ readonly accessControlMaxAgeInSeconds: number;
126
+ /**
127
+ * A Boolean that determines whether CDN includes the includeSubDomains directive in the Strict-Transport-Security HTTP response header.
128
+ *
129
+ * @default false
130
+ */
131
+ readonly includeSubdomains?: boolean;
132
+ /**
133
+ * A Boolean that determines whether CDN overrides the Strict-Transport-Security HTTP response header
134
+ * received from the origin with the one specified in this response headers policy.
135
+ */
136
+ readonly override: boolean;
137
+ /**
138
+ * A Boolean that determines whether CDN includes the preload directive in the Strict-Transport-Security HTTP response header.
139
+ *
140
+ * @default false
141
+ */
142
+ readonly preload?: boolean;
143
+ }
144
+ /**
145
+ * Determines whether CDN includes the X-XSS-Protection HTTP response header and the header’s value.
146
+ */
147
+ export interface ResponseHeadersXSSProtection {
148
+ /**
149
+ * A Boolean that determines whether CDN includes the mode=block directive in the X-XSS-Protection header.
150
+ *
151
+ * @default false
152
+ */
153
+ readonly modeBlock?: boolean;
154
+ /**
155
+ * A Boolean that determines whether CDN overrides the X-XSS-Protection HTTP response header
156
+ * received from the origin with the one specified in this response headers policy.
157
+ */
158
+ readonly override: boolean;
159
+ /**
160
+ * A Boolean that determines the value of the X-XSS-Protection HTTP response header.
161
+ * When this setting is true, the value of the X-XSS-Protection header is 1.
162
+ * When this setting is false, the value of the X-XSS-Protection header is 0.
163
+ */
164
+ readonly protection: boolean;
165
+ /**
166
+ * A reporting URI, which CDN uses as the value of the report directive in the X-XSS-Protection header.
167
+ * You cannot specify a ReportUri when ModeBlock is true.
168
+ *
169
+ * @default - no report uri
170
+ */
171
+ readonly reportUri?: string;
172
+ }
173
+ /**
174
+ * Configuration for a set of security-related HTTP response headers.
175
+ * CDN adds these headers to HTTP responses that it sends for requests that match a cache behavior
176
+ * associated with this response headers policy.
177
+ */
178
+ export interface ResponseSecurityHeaders {
179
+ /**
180
+ * The policy directives and their values that CDN includes as values for the Content-Security-Policy HTTP response header.
181
+ *
182
+ * @default - no content security policy
183
+ */
184
+ readonly contentSecurityPolicy?: ResponseHeadersContentSecurityPolicy;
185
+ /**
186
+ * Determines whether CDN includes the X-Content-Type-Options HTTP response header with its value set to nosniff.
187
+ *
188
+ * @default - no content type options
189
+ */
190
+ readonly contentTypeOptions?: ResponseHeadersContentTypeOptions;
191
+ /**
192
+ * Determines whether CDN includes the X-Frame-Options HTTP response header and the header’s value.
193
+ *
194
+ * @default - no frame options
195
+ */
196
+ readonly frameOptions?: ResponseHeadersFrameOptions;
197
+ /**
198
+ * Determines whether CDN includes the Referrer-Policy HTTP response header and the header’s value.
199
+ *
200
+ * @default - no referrer policy
201
+ */
202
+ readonly referrerPolicy?: ResponseHeadersReferrerPolicy;
203
+ /**
204
+ * Determines whether CDN includes the Strict-Transport-Security HTTP response header and the header’s value.
205
+ *
206
+ * @default - no strict transport security
207
+ */
208
+ readonly strictTransportSecurity?: ResponseHeadersStrictTransportSecurity;
209
+ /**
210
+ * Determines whether CDN includes the X-XSS-Protection HTTP response header and the header’s value.
211
+ *
212
+ * @default - no xss protection
213
+ */
214
+ readonly xssProtection?: ResponseHeadersXSSProtection;
215
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export * from './ResponseSecurityHeaders';
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./ResponseSecurityHeaders"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "quidproquo-webserver",
3
- "version": "0.0.82",
3
+ "version": "0.0.84",
4
4
  "description": "",
5
5
  "main": "./lib/index.js",
6
6
  "types": "./lib/index.d.js",