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

fix tr-pull-ot cli #383

Merged
merged 8 commits into from
Jan 31, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions src/oneTrust/helpers/enrichOneTrustAssessment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export const enrichOneTrustAssessment = ({
return {
...risk,
...details,
level: risk.level,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does ...risk not set level already? Or is it getting clobbered by ...details?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was getting clobbered.

impactLevel: risk.impactLevel ?? 0,
};
});
Expand Down
2 changes: 1 addition & 1 deletion src/oneTrust/helpers/oneTrustAssessmentToJson.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const oneTrustAssessmentToJson = ({
let jsonEntry = '';
// start with an opening bracket
if (index === 0 || wrap) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see the comment for wrap says Whether to wrap every entry in brackets, and it looks like we want to do that only when importing to transcend (mimicking a CSV)... but what is the syncOneTrustAssessmentToDisk option?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When using syncOneTrustAssessmentToDisk, the output is [{},{},{}...] (i.e., the first item starts with [ and the last ends with `]). Does that answer your question?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I actually meant what is the difference between sync to transcend and sync to disk.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, sync to disk just means writing the pulled data to a json file.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are they both steps in the import process or are they two unique import options?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pulled data to a json file.

Because this is distinct from the risk files that get uploaded to s3, right? Would we ever want an imported assessment in JSON and not in Transcend? If it is in Transcend, why do we need it in JSON? Just for a historical record?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We, as Transcend, would always want to sync to Transcend. However, the cli is also available for customer use, and they may find value in keeping the records in Json as well.

jsonEntry = '[\n';
jsonEntry = '[';
}

const stringifiedAssessment = JSON.stringify(assessment);
Expand Down
3 changes: 2 additions & 1 deletion src/oneTrust/helpers/syncOneTrustAssessmentToDisk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ export const syncOneTrustAssessmentToDisk = ({
assessment,
index,
total,
wrap: false, }),
wrap: false,
}),
);
}
} else if (fileFormat === OneTrustFileFormat.Csv) {
Expand Down