Comparing version 2.6.25 to 2.6.26
@@ -11,2 +11,4 @@ import { ControlStatus, HDFControl, HDFControlSegment, SegmentStatus, Severity } from '../compat_wrappers'; | ||
readonly waived: boolean; | ||
readonly attested: boolean; | ||
readonly attestationStatus?: 'passed' | 'failed'; | ||
readonly descriptions: { | ||
@@ -17,3 +19,3 @@ [key: string]: string; | ||
wraps: ResultControl_1_0 | ProfileControl_1_0; | ||
constructor(forControl: ResultControl_1_0 | ProfileControl_1_0, isProfile: boolean, waived: boolean); | ||
constructor(forControl: ResultControl_1_0 | ProfileControl_1_0, isProfile: boolean, waived: boolean, attested: boolean, attestationStatus?: 'passed' | 'failed'); | ||
abstract get message(): string; | ||
@@ -20,0 +22,0 @@ abstract get segments(): HDFControlSegment[] | undefined; |
@@ -7,6 +7,8 @@ "use strict"; | ||
class HDFControl10 { | ||
constructor(forControl, isProfile, waived) { | ||
constructor(forControl, isProfile, waived, attested, attestationStatus) { | ||
this.descriptions = {}; | ||
this.wraps = forControl; | ||
this.waived = waived; | ||
this.attested = attested; | ||
this.attestationStatus = attestationStatus; | ||
this.isProfile = isProfile; | ||
@@ -117,3 +119,4 @@ const tempNistTags = HDFControl10.compute_raw_nist_tags(this.wraps); | ||
constructor(control) { | ||
super(control, false, !!(control.waiver_data && control.waiver_data.skipped_due_to_waiver)); | ||
var _a; | ||
super(control, false, Boolean((_a = control.waiver_data) === null || _a === void 0 ? void 0 : _a.skipped_due_to_waiver), Boolean(control.attestation_data)); | ||
if (control.descriptions) { | ||
@@ -156,2 +159,13 @@ control.descriptions.forEach((x) => (this.descriptions[x.label] = x.data)); | ||
} | ||
else if (this.attested) { | ||
if (this.attestationStatus === 'failed') { | ||
return 'Failed'; | ||
} | ||
else if (this.attestationStatus === 'passed') { | ||
return 'Passed'; | ||
} | ||
else { | ||
throw new Error(`Attestation for control ${this.wraps.id} exists with invalid status: ${this.attestationStatus}`); | ||
} | ||
} | ||
else if (this.status_list.includes('skipped')) { | ||
@@ -200,3 +214,3 @@ return 'Not Reviewed'; | ||
constructor(control) { | ||
super(control, true, false); | ||
super(control, true, false, false); | ||
this.segments = undefined; | ||
@@ -203,0 +217,0 @@ this.status = 'From Profile'; |
@@ -37,2 +37,3 @@ export interface ExecJSON { | ||
export interface ExecJSONControl { | ||
attestation_data?: null | AttestationData; | ||
code?: null | string; | ||
@@ -52,2 +53,14 @@ desc?: null | string; | ||
} | ||
export interface AttestationData { | ||
control_id: string; | ||
explanation: string; | ||
frequency: string; | ||
status: ControlAttestationStatus; | ||
updated: string; | ||
updated_by: string; | ||
} | ||
export declare enum ControlAttestationStatus { | ||
Failed = "failed", | ||
Passed = "passed" | ||
} | ||
export interface ControlDescription { | ||
@@ -54,0 +67,0 @@ data: string; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Convert = exports.ControlResultStatus = void 0; | ||
exports.Convert = exports.ControlResultStatus = exports.ControlAttestationStatus = void 0; | ||
var ControlAttestationStatus; | ||
(function (ControlAttestationStatus) { | ||
ControlAttestationStatus["Failed"] = "failed"; | ||
ControlAttestationStatus["Passed"] = "passed"; | ||
})(ControlAttestationStatus = exports.ControlAttestationStatus || (exports.ControlAttestationStatus = {})); | ||
var ControlResultStatus; | ||
@@ -176,2 +181,3 @@ (function (ControlResultStatus) { | ||
"ExecJSONControl": o([ | ||
{ json: "attestation_data", js: "attestation_data", typ: u(undefined, u(null, r("AttestationData"))) }, | ||
{ json: "code", js: "code", typ: u(undefined, u(null, "")) }, | ||
@@ -189,2 +195,10 @@ { json: "desc", js: "desc", typ: u(undefined, u(null, "")) }, | ||
], "any"), | ||
"AttestationData": o([ | ||
{ json: "control_id", js: "control_id", typ: "" }, | ||
{ json: "explanation", js: "explanation", typ: "" }, | ||
{ json: "frequency", js: "frequency", typ: "" }, | ||
{ json: "status", js: "status", typ: r("ControlAttestationStatus") }, | ||
{ json: "updated", js: "updated", typ: "" }, | ||
{ json: "updated_by", js: "updated_by", typ: "" }, | ||
], "any"), | ||
"ControlDescription": o([ | ||
@@ -258,2 +272,6 @@ { json: "data", js: "data", typ: "" }, | ||
], "any"), | ||
"ControlAttestationStatus": [ | ||
"failed", | ||
"passed", | ||
], | ||
"ControlResultStatus": [ | ||
@@ -260,0 +278,0 @@ "error", |
{ | ||
"name": "inspecjs", | ||
"version": "2.6.25", | ||
"version": "2.6.26", | ||
"description": "© 2018 The MITRE Corporation.", | ||
@@ -33,3 +33,3 @@ "files": [ | ||
"validate-types": "git diff --quiet HEAD -- schemas/ src/generated_parsers/", | ||
"lint": "eslint --fix", | ||
"lint": "eslint \"**/*.ts\" --fix", | ||
"lint:ci": "eslint \"**/*.ts\" --max-warnings 0", | ||
@@ -36,0 +36,0 @@ "test": "jest --silent" |
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
174228
3674