@contrast/common 1.34.1 → 1.35.0

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,5 +1,6 @@
1
1
  export declare enum Event {
2
2
  RESPONSE_FINISH = "response-finish",
3
+ SERVER_LISTENING = "server-listening",
3
4
  ROUTE_COVERAGE_DISCOVERY_FINISHED = "route-coverage-discovery-finished",
4
5
  ARCHITECTURE_COMPONENT = "architecture-component",
5
6
  ASSESS_DATAFLOW_FINDING = "assess-dataflow-findings",
@@ -188,6 +189,11 @@ export declare enum DataflowTag {
188
189
  COOKIE = "COOKIE",
189
190
  WEAK_URL_ENCODED = "WEAK_URL_ENCODED"
190
191
  }
192
+ export declare enum ServerEnvironment {
193
+ QA = "QA",
194
+ PRODUCTION = "PRODUCTION",
195
+ DEVELOPMENT = "DEVELOPMENT"
196
+ }
191
197
  export declare const BLOCKING_MODES: readonly ["block", "block_at_perimeter"];
192
198
  export declare const FS_METHODS: readonly [{
193
199
  readonly name: "access";
package/lib/constants.js CHANGED
@@ -14,11 +14,12 @@
14
14
  * way not consistent with the End User License Agreement.
15
15
  */
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.URI_REGEXES = exports.symbols = exports.agentLibIDListTypes = exports.FS_METHODS = exports.BLOCKING_MODES = exports.DataflowTag = exports.ExclusionType = exports.InputType = exports.SessionConfigurationRule = exports.ResponseScanningRule = exports.Rule = exports.ProtectRuleMode = exports.Event = void 0;
17
+ exports.URI_REGEXES = exports.symbols = exports.agentLibIDListTypes = exports.FS_METHODS = exports.BLOCKING_MODES = exports.ServerEnvironment = exports.DataflowTag = exports.ExclusionType = exports.InputType = exports.SessionConfigurationRule = exports.ResponseScanningRule = exports.Rule = exports.ProtectRuleMode = exports.Event = void 0;
18
18
  var Event;
19
19
  (function (Event) {
20
20
  // lifecycle
21
21
  Event["RESPONSE_FINISH"] = "response-finish";
22
+ Event["SERVER_LISTENING"] = "server-listening";
22
23
  Event["ROUTE_COVERAGE_DISCOVERY_FINISHED"] = "route-coverage-discovery-finished";
23
24
  // reports
24
25
  Event["ARCHITECTURE_COMPONENT"] = "architecture-component";
@@ -219,6 +220,12 @@ var DataflowTag;
219
220
  DataflowTag["COOKIE"] = "COOKIE";
220
221
  DataflowTag["WEAK_URL_ENCODED"] = "WEAK_URL_ENCODED";
221
222
  })(DataflowTag || (exports.DataflowTag = DataflowTag = {}));
223
+ var ServerEnvironment;
224
+ (function (ServerEnvironment) {
225
+ ServerEnvironment["QA"] = "QA";
226
+ ServerEnvironment["PRODUCTION"] = "PRODUCTION";
227
+ ServerEnvironment["DEVELOPMENT"] = "DEVELOPMENT";
228
+ })(ServerEnvironment || (exports.ServerEnvironment = ServerEnvironment = {}));
222
229
  exports.BLOCKING_MODES = ['block', 'block_at_perimeter'];
223
230
  exports.FS_METHODS = [
224
231
  { name: 'access', promises: true, sync: true, indices: [0] },
package/lib/types.d.ts CHANGED
@@ -207,7 +207,6 @@ export declare class Blocker {
207
207
  block(mode: string, ruleId: string): void;
208
208
  }
209
209
  export interface ProtectMessage {
210
- reqData: ReqData;
211
210
  blocker: Blocker;
212
211
  policy: Partial<Record<Rule, ProtectRuleMode>>;
213
212
  exclusions: any[];
@@ -226,6 +225,13 @@ export interface SourceInfo {
226
225
  port: number;
227
226
  protocol: string;
228
227
  time: number;
228
+ method: string;
229
+ rawHeaders: string[];
230
+ uriPath: string;
231
+ queries: string;
232
+ contentType?: string;
233
+ ip: string;
234
+ httpVersion: string;
229
235
  }
230
236
  /**
231
237
  * this is known as RequestStore even though, in the future, instrumentation
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contrast/common",
3
- "version": "1.34.1",
3
+ "version": "1.35.0",
4
4
  "description": "Shared constants and utilities for all Contrast Agent modules",
5
5
  "license": "UNLICENSED",
6
6
  "author": "Contrast Security <nodejs@contrastsecurity.com> (https://www.contrastsecurity.com)",