-
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
Merged
Merged
Changes from all commits
Commits
Show all changes
102 commits
Select commit
Hold shift + click to select a range
1dfa3c3
create flattenOneTrustAssessment helper
abrantesarthur de282db
flatten questionReponses
abrantesarthur 10c1998
create helper getOneTrustRisk
abrantesarthur f68e17c
update return type of getOneTrustRIsk
abrantesarthur 9333325
convert OneTrust interfaces to codecs
abrantesarthur 559ab87
fix codecs
abrantesarthur 35bab06
fix codecs
abrantesarthur 5d9def9
create flattenOneTrustSectionHeaders helper
abrantesarthur 4822fba
improve codecs and create flattenOneTrustQuestions helper
abrantesarthur 5636c78
improve variable names
abrantesarthur 2ca1f64
create extractProperties helper
abrantesarthur 531a240
implement flattenOneTrustNestedQuestionsOptions
abrantesarthur ab072df
improve flattenList
abrantesarthur edd5c70
improve flattenList
abrantesarthur 22ae8b1
update flattenOneTrustNestedQuestionsOptions to use aggregateObjects
abrantesarthur 460f25c
more changes
abrantesarthur ccd64ae
update const flattenOneTrustSectionHeaders = (
abrantesarthur f90fcd5
update const flattenOneTrustSectionHeaders = (
abrantesarthur 3b08994
commit
abrantesarthur e80c95e
commit
abrantesarthur ec8e77c
create more helpers and add tests
abrantesarthur 35d5fd7
create enrichRiskStatisticsWithDefault
abrantesarthur c0e9d26
fix bug
abrantesarthur 930a1ba
remove extra test
abrantesarthur 6538e41
create more codecs
abrantesarthur bb8dd28
flatten risks
abrantesarthur e104337
flatten approvers, respondents, and primaryEntityDetails
abrantesarthur ee8b072
update flattenOneTrustAssessment type
abrantesarthur d6052b1
create DEFAULT_ONE_TRUST_COMBINED_ASSESSMENT
abrantesarthur b1c5f6b
add comments
abrantesarthur ae91ee2
update
abrantesarthur 80c3f72
improve createDefatulCodec
abrantesarthur 2c12a0e
add missing fields to codec
abrantesarthur 24841f1
fix codecs
abrantesarthur 8480eaf
undo changes to cli-pull-ot
abrantesarthur bd5842c
improve codecs
abrantesarthur b26cb56
done
abrantesarthur 3ac69be
update writeOneTrustAssessment to write in csv format
abrantesarthur f9be7b6
import assessment types from privacy types
abrantesarthur ad32c0a
update type-utils
abrantesarthur 2b05b5d
remove enrich helpers
abrantesarthur 74666c2
import createDefaultCodec from type-utils
abrantesarthur da299c3
rename cli-pull-ot -> cli-sync-ot
abrantesarthur 799e41c
add dryRun argument
abrantesarthur 30f3a4c
add dryRun argument
abrantesarthur 239a72d
move some logic from writeOneTrustAssessment to cli-sync-ot
abrantesarthur ae5522f
ship more improvements to writeOneTrustAssessment
abrantesarthur 4b428dc
reorganize folder structure
abrantesarthur 13e80e9
create syncOneTrustAssessments and enrichOneTrustAssessment helpers
abrantesarthur d11609e
call syncOneTrustAssessments from cli-sync-ot
abrantesarthur 7647c02
create oneTrustAssessmentToJson helper
abrantesarthur 5dae37d
create oneTrustAssessmentToCsv helper
abrantesarthur 4256788
create oneTrustAssessmentToCsvRecord helper
abrantesarthur 6ec35ba
update readme
abrantesarthur 5f94a17
move constants to heleprs
abrantesarthur df76064
add transcendUrl to the list of arguments
abrantesarthur b424c03
add ability to sync to Transcend
abrantesarthur 414e84e
update error messages
abrantesarthur 70956b6
update extractProperties documentation
abrantesarthur a8500c6
add fixme comment
abrantesarthur ae821ae
write docs for aggregateObjects
abrantesarthur ca7f66b
document flattenObject
abrantesarthur 7692cd4
remove some TODOs
abrantesarthur eda427b
add TODOs
abrantesarthur f8ef92e
remove TODOs
abrantesarthur e4176be
add a fixme
abrantesarthur 4409674
fix merge conflicts
abrantesarthur 66bfc71
simplify flattenOneTrustAssessment
abrantesarthur b34e3f9
improve flattenOneTrustSections
abrantesarthur b65036b
improve flattenOneTrustSectionHeaders
abrantesarthur bd5e882
simplify flatten functions
abrantesarthur 7b4ee5b
import aggregateObjects and flattenObject from @transcend/type-utils
abrantesarthur dedf1b8
use transposeObjectArray from @transcend/type-utils
abrantesarthur 7a83891
improve flattenOneTrustAssessment
abrantesarthur 148b0e4
update Readme
abrantesarthur de53f5e
update cli-sync-ot docs
abrantesarthur 34de61b
update package.version
abrantesarthur 4deaa2d
update commments
abrantesarthur cf23df8
remove potential bugs from flattenOneTrustAssessment
abrantesarthur fa17027
add fixmes
abrantesarthur 4f7619e
fix flattenOneTrustQuestionResponses
abrantesarthur 26b3121
fix flattenOneTrustNestedQuestionsOptions and add tests
abrantesarthur 475c5ee
correctly flatten risks and add tests
abrantesarthur 36691fc
make progress in risk categories
abrantesarthur 4a91142
write more tests
abrantesarthur 6194c5b
test flattenOneTrustSectionHeaders
abrantesarthur a4b6ea7
add flattenOneTrustSections tests
abrantesarthur 8ab3780
default for pushing to transcend is json
abrantesarthur 6a1d610
update enrichOneTrustAssessment to enrich creator
abrantesarthur 42116b7
create getOneTrustUser and cache fetched users
abrantesarthur eea8129
remove FIXME
abrantesarthur bb87789
enrich assessment with approver details
abrantesarthur 13e60f7
enrich assessments with respondents information
abrantesarthur 0c7030f
use privacy-types 4.105.3
abrantesarthur b60400d
fix bugs and import codecs from privacy-types
abrantesarthur 8b9075c
update version
abrantesarthur 0ad390c
fix bug in syncONeTrustASsessmentToDisk
abrantesarthur 2cfb1c3
rewrite syncOneTrustAssessments to run in parallel and series
abrantesarthur 6bb845f
fix some bugs
abrantesarthur 75415dc
nits
abrantesarthur 050fd21
fix pre-commit
abrantesarthur 7509853
fix tests
abrantesarthur File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Binary file removed
BIN
-370 KB
.yarn/cache/@transcend-io-privacy-types-npm-4.103.0-b8d1864632-4661368b34.zip
Binary file not shown.
Binary file removed
BIN
-76.8 KB
.yarn/cache/@transcend-io-type-utils-npm-1.5.0-125f1a01fb-0d7d85e794.zip
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
#!/usr/bin/env node | ||
import { logger } from './logger'; | ||
|
||
import colors from 'colors'; | ||
import { parseCliSyncOtArguments, createOneTrustGotInstance } from './oneTrust'; | ||
import { OneTrustPullResource } from './enums'; | ||
import { syncOneTrustAssessments } from './oneTrust/helpers/syncOneTrustAssessments'; | ||
import { buildTranscendGraphQLClient } from './graphql'; | ||
|
||
/** | ||
* Pull configuration from OneTrust down locally to disk | ||
* | ||
* Dev Usage: | ||
* yarn ts-node ./src/cli-sync-ot.ts --hostname=customer.my.onetrust.com --oneTrustAuth=$ONE_TRUST_OAUTH_TOKEN --transcendAuth=$TRANSCEND_API_KEY | ||
* | ||
* Standard usage | ||
* yarn cli-sync-ot --hostname=customer.my.onetrust.com --oneTrustAuth=$ONE_TRUST_OAUTH_TOKEN --transcendAuth=$TRANSCEND_API_KEY | ||
*/ | ||
async function main(): Promise<void> { | ||
const { | ||
file, | ||
fileFormat, | ||
hostname, | ||
oneTrustAuth, | ||
transcendAuth, | ||
transcendUrl, | ||
abrantesarthur marked this conversation as resolved.
Show resolved
Hide resolved
|
||
resource, | ||
// debug, | ||
dryRun, | ||
} = parseCliSyncOtArguments(); | ||
|
||
// use the hostname and auth token to instantiate a client to talk to OneTrust | ||
const oneTrust = createOneTrustGotInstance({ hostname, auth: oneTrustAuth }); | ||
|
||
// try { | ||
if (resource === OneTrustPullResource.Assessments) { | ||
await syncOneTrustAssessments({ | ||
oneTrust, | ||
file, | ||
fileFormat, | ||
dryRun, | ||
...(transcendAuth && transcendUrl | ||
? { | ||
transcend: buildTranscendGraphQLClient(transcendUrl, transcendAuth), | ||
} | ||
: {}), | ||
}); | ||
} | ||
// } catch (err) { | ||
// logger.error( | ||
// colors.red( | ||
// `An error occurred syncing the resource ${resource} from OneTrust: ${ | ||
// debug ? err.stack : err.message | ||
// }`, | ||
// ), | ||
// ); | ||
// process.exit(1); | ||
// } | ||
|
||
// Indicate success | ||
logger.info( | ||
colors.green( | ||
`Successfully synced OneTrust ${resource} to ${ | ||
dryRun ? `disk at "${file}"` : 'Transcend' | ||
}!`, | ||
), | ||
); | ||
} | ||
|
||
main(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
thenfile
is required, and if you don't thentranscendAuth
/transcendUrl
are required