@contrast/common
Advanced tools
Comparing version 1.0.2 to 1.0.3
"use strict"; | ||
/* | ||
* Copyright: 2022 Contrast Security, Inc | ||
* Contact: support@contrastsecurity.com | ||
* License: Commercial | ||
* NOTICE: This Software and the patented inventions embodied within may only be | ||
* used as part of Contrast Security’s commercial offerings. Even though it is | ||
* made available through public repositories, use of this Software is subject to | ||
* the applicable End User Licensing Agreement found at | ||
* https://www.contrastsecurity.com/enduser-terms-0317a or as otherwise agreed | ||
* between Contrast Security and the End User. The Software may not be reverse | ||
* engineered, modified, repackaged, sold, redistributed or otherwise used in a | ||
* way not consistent with the End User License Agreement. | ||
*/ | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -3,0 +17,0 @@ exports.Rule = exports.Event = void 0; |
"use strict"; | ||
/* | ||
* Copyright: 2022 Contrast Security, Inc | ||
* Contact: support@contrastsecurity.com | ||
* License: Commercial | ||
* NOTICE: This Software and the patented inventions embodied within may only be | ||
* used as part of Contrast Security’s commercial offerings. Even though it is | ||
* made available through public repositories, use of this Software is subject to | ||
* the applicable End User Licensing Agreement found at | ||
* https://www.contrastsecurity.com/enduser-terms-0317a or as otherwise agreed | ||
* between Contrast Security and the End User. The Software may not be reverse | ||
* engineered, modified, repackaged, sold, redistributed or otherwise used in a | ||
* way not consistent with the End User License Agreement. | ||
*/ | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
@@ -3,0 +17,0 @@ if (k2 === undefined) k2 = k; |
@@ -10,2 +10,3 @@ /// <reference types="node" /> | ||
export interface Result { | ||
blocked: boolean; | ||
ruleId: Rule; | ||
@@ -18,27 +19,35 @@ inputType: string; | ||
} | ||
export interface ReqData { | ||
method: string; | ||
headers: string[]; | ||
uriPath: string; | ||
queries: string; | ||
contentType?: string; | ||
standardUrlParsing: boolean; | ||
ip: string; | ||
httpVersion: string; | ||
headers2: { | ||
[key: string]: Array<string>; | ||
}; | ||
} | ||
export interface Findings { | ||
trackRequest: boolean; | ||
securityException?: [mode: string, ruleId: string]; | ||
bodyType?: 'json' | 'urlencoded'; | ||
resultsMap: Record<Rule, Result[]>; | ||
} | ||
export interface RequestStore { | ||
protect?: { | ||
reqData: { | ||
method: string; | ||
headers: string[]; | ||
uriPath: string; | ||
queries: string; | ||
contentType?: string; | ||
standardUrlParsing: boolean; | ||
}; | ||
block: (mode: string, ruleId: string) => void; | ||
rules: { | ||
agentLibRules: RulesConfig; | ||
agentLibRulesMask: number; | ||
agentRules: RulesConfig; | ||
}; | ||
exclusions: any[]; | ||
virtualPatches: any[]; | ||
findings: { | ||
trackRequest: boolean; | ||
securityException?: [mode: string, ruleId: string]; | ||
bodyType?: 'json' | 'urlencoded'; | ||
resultsMap: Record<Rule, Result[]>; | ||
}; | ||
protect?: ProtectMessage; | ||
} | ||
export interface ProtectMessage { | ||
reqData: ReqData; | ||
block: (mode: string, ruleId: string) => void; | ||
rules: { | ||
agentLibRules: RulesConfig; | ||
agentLibRulesMask: number; | ||
agentRules: RulesConfig; | ||
}; | ||
exclusions: any[]; | ||
virtualPatches: any[]; | ||
findings: Findings; | ||
} | ||
@@ -45,0 +54,0 @@ export interface Messages extends EventEmitter { |
"use strict"; | ||
/* | ||
* Copyright: 2022 Contrast Security, Inc | ||
* Contact: support@contrastsecurity.com | ||
* License: Commercial | ||
* NOTICE: This Software and the patented inventions embodied within may only be | ||
* used as part of Contrast Security’s commercial offerings. Even though it is | ||
* made available through public repositories, use of this Software is subject to | ||
* the applicable End User Licensing Agreement found at | ||
* https://www.contrastsecurity.com/enduser-terms-0317a or as otherwise agreed | ||
* between Contrast Security and the End User. The Software may not be reverse | ||
* engineered, modified, repackaged, sold, redistributed or otherwise used in a | ||
* way not consistent with the End User License Agreement. | ||
*/ | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@contrast/common", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "Shared constants and utilities for all Contrast Agent modules", | ||
@@ -5,0 +5,0 @@ "license": "UNLICENSED", |
@@ -0,1 +1,16 @@ | ||
/* | ||
* Copyright: 2022 Contrast Security, Inc | ||
* Contact: support@contrastsecurity.com | ||
* License: Commercial | ||
* NOTICE: This Software and the patented inventions embodied within may only be | ||
* used as part of Contrast Security’s commercial offerings. Even though it is | ||
* made available through public repositories, use of this Software is subject to | ||
* the applicable End User Licensing Agreement found at | ||
* https://www.contrastsecurity.com/enduser-terms-0317a or as otherwise agreed | ||
* between Contrast Security and the End User. The Software may not be reverse | ||
* engineered, modified, repackaged, sold, redistributed or otherwise used in a | ||
* way not consistent with the End User License Agreement. | ||
*/ | ||
export enum Event { | ||
@@ -2,0 +17,0 @@ ASSESS = 'assess', |
@@ -0,1 +1,16 @@ | ||
/* | ||
* Copyright: 2022 Contrast Security, Inc | ||
* Contact: support@contrastsecurity.com | ||
* License: Commercial | ||
* NOTICE: This Software and the patented inventions embodied within may only be | ||
* used as part of Contrast Security’s commercial offerings. Even though it is | ||
* made available through public repositories, use of this Software is subject to | ||
* the applicable End User Licensing Agreement found at | ||
* https://www.contrastsecurity.com/enduser-terms-0317a or as otherwise agreed | ||
* between Contrast Security and the End User. The Software may not be reverse | ||
* engineered, modified, repackaged, sold, redistributed or otherwise used in a | ||
* way not consistent with the End User License Agreement. | ||
*/ | ||
export * from './constants'; | ||
@@ -2,0 +17,0 @@ export * from './types'; |
@@ -0,1 +1,16 @@ | ||
/* | ||
* Copyright: 2022 Contrast Security, Inc | ||
* Contact: support@contrastsecurity.com | ||
* License: Commercial | ||
* NOTICE: This Software and the patented inventions embodied within may only be | ||
* used as part of Contrast Security’s commercial offerings. Even though it is | ||
* made available through public repositories, use of this Software is subject to | ||
* the applicable End User Licensing Agreement found at | ||
* https://www.contrastsecurity.com/enduser-terms-0317a or as otherwise agreed | ||
* between Contrast Security and the End User. The Software may not be reverse | ||
* engineered, modified, repackaged, sold, redistributed or otherwise used in a | ||
* way not consistent with the End User License Agreement. | ||
*/ | ||
import { Event, Rule } from '../constants'; | ||
@@ -11,2 +26,3 @@ import { EventEmitter } from 'events'; | ||
export interface Result { | ||
blocked: boolean; | ||
ruleId: Rule, | ||
@@ -17,5 +33,24 @@ inputType: string, // TODO | ||
value: string, | ||
details?: any[], | ||
details?: any[], // TODO | ||
} | ||
export interface ReqData { | ||
method: string; | ||
headers: string[]; | ||
uriPath: string; | ||
queries: string; | ||
contentType?: string; | ||
standardUrlParsing: boolean; | ||
ip: string; | ||
httpVersion: string, | ||
headers2: { [key: string]: Array<string> }; | ||
} | ||
export interface Findings { | ||
trackRequest: boolean; | ||
securityException?: [mode: string, ruleId: string]; | ||
bodyType?: 'json' | 'urlencoded'; | ||
resultsMap: Record<Rule, Result[]> | ||
} | ||
// | ||
@@ -33,26 +68,16 @@ // this is known as RequestStore even though, in the future, instrumentation | ||
// TODO: from protect/lib/make-source-context | ||
protect?: { | ||
reqData: { | ||
method: string; | ||
headers: string[]; | ||
uriPath: string; | ||
queries: string; | ||
contentType?: string; | ||
standardUrlParsing: boolean; | ||
}; | ||
block: (mode: string, ruleId: string) => void; | ||
rules: { | ||
agentLibRules: RulesConfig; | ||
agentLibRulesMask: number; | ||
agentRules: RulesConfig; | ||
}; | ||
exclusions: any[]; // TODO | ||
virtualPatches: any[]; // TODO | ||
findings: { | ||
trackRequest: boolean; | ||
securityException?: [mode: string, ruleId: string]; | ||
bodyType?: 'json' | 'urlencoded'; | ||
resultsMap: Record<Rule, Result[]> | ||
}; | ||
protect?: ProtectMessage; | ||
} | ||
export interface ProtectMessage { | ||
reqData: ReqData; | ||
block: (mode: string, ruleId: string) => void; | ||
rules: { | ||
agentLibRules: RulesConfig; | ||
agentLibRulesMask: number; | ||
agentRules: RulesConfig; | ||
}; | ||
exclusions: any[]; // TODO | ||
virtualPatches: any[]; // TODO | ||
findings: Findings; | ||
} | ||
@@ -59,0 +84,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15376
332