-
Notifications
You must be signed in to change notification settings - Fork 2
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
add support for syncing Assessments from OneTrust to Transcend #376
base: main
Are you sure you want to change the base?
Conversation
This pull request has been linked to and will mark 3 tasks as "Pending Deploy" when merged:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than the FIXME i think this is honestly ... pretty good and ready to go
hostname, | ||
oneTrustAuth, | ||
transcendAuth, | ||
transcendUrl, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so transcendAuth + transcendUrl are optional? If they don't pass it in we'll just save to disk?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, with a caveat: the criteria for saving to disk is that --dryRun=true
, in which case we the parseCliSyncOtArguments
helper also ensures that transcendAuth
+ transcendUrl
were passed in.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait i thought dryrun=true would mean don't upload to Transcend
/** | ||
* fetch details about each assessment in series and write to transcend or to disk | ||
* (depending on the dryRun argument) right away to avoid running out of memory | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice
* fetch details about each assessment in series and write to transcend or to disk | ||
* (depending on the dryRun argument) right away to avoid running out of memory | ||
*/ | ||
await mapSeries(assessments, async (assessment, index) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wish we could do this with some concurrency.. maybe chunks of 5-10 assessments at a time? IDK what their rate limit is but we'd want to stay under it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think OT would allow for it. My main concern was introducing concurrency bugs (e.g., writing to a file is pretty slow and it's possible to mess up the writing order if doing so concurrently).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps we can do the fetching from OneTrust concurrently but the writing to Disk or Transcend synchronously? I. can try that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
^ yea! that's sort of what i was thinking. Concurrently fire off 5-10 requests but then write it down concurrently
const { risks, ...restQuestion } = question; | ||
const enrichedRisks = (risks ?? []).map((risk) => { | ||
const details = riskDetailsById[risk.riskId]; | ||
// FIXME: missing the risk meta data and links to the assessment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
did you mean to do this FIXME
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is killer, wow!
* @param param - information about the assessment and amount of entries | ||
* @returns a stringified csv entry ready to be appended to a file | ||
*/ | ||
export const oneTrustAssessmentToCsv = ({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: would be nice to have some unit tests for these due to complexity but not a big deal
| file | Path to the file to pull the resource into. Its format must match the fileFormat argument. | string | N/A | false | | ||
| fileFormat | The format of the output file. | string | csv | false | | ||
| resource | The resource to pull from OneTrust. For now, only assessments is supported. | string | assessments | false | | ||
| dryRun | Whether to export the resource to a file rather than sync to Transcend. | boolean | false | false | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it worth trying to convey that some arguments are conditionally required? E.g. I assume if you have --dryRun
then file
is required, and if you don't then transcendAuth
/transcendUrl
are required
I suggest starting the review from the command's entrypoint
cli-sync-ot.ts
.See updated README for instructions of how to test this. Locally, you'd do
yarn ts-node ./src/cli-sync-ot.ts
. instead ofyarn cli-sync-ot
.cli-pull-ot
->cli-sync-ot
.Note that requests to
importOneTrustAssessmentForms
fail because we need to update the endpoint, not because the cli has bugs.Related Issues
Security Implications
[none]
System Availability
[none]