Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update README and packages #36

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Add cloud to lineitemSchema
  • Loading branch information
binarymist committed Mar 17, 2022
commit 116860431b10ba8e8706ce6eb5ac86fa9094d242
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@ const processSchema = Joi.object().keys({
});

const lineitemSchema = Joi.object().keys({
type: Joi.string().required().valid("sast", "sca", "secret", "dast"),
type: Joi.string().required().valid("sast", "secret", "cloud", "sca", "dast"),
ruleId: Joi.string().required(),

location: Joi.alternatives().conditional("type", {
@@ -162,6 +162,6 @@ console.log(envelopeSchema.validate(reportData).error ?? "envelope ✅");
/* validating the line items */
reportData.output.forEach((lineItem) => {
console.log(lineitemSchema.validate(lineItem).error ?? lineItem.type + " ✅");
const metadataSchema = { sast: metadataSchemaSAST, secret: metadataSchemaSAST, sca: metadataSchemaSCA, dast: metadataSchemaDAST }[lineItem.type];
const metadataSchema = { sast: metadataSchemaSAST, secret: metadataSchemaSAST, cloud: metadataSchemaSAST, sca: metadataSchemaSCA, dast: metadataSchemaDAST }[lineItem.type];
console.log(metadataSchema.validate(lineItem.metadata).error ?? lineItem.type + " metadata ✅");
});