Implements (mostly happy path) EGA permission reconciliation flow. Error handling needs to be improved in main job function and service calls - in most cases errors encountered should not stop the script from running, but would be useful to report/collect somehow, for debugging/possible retry scenarios.
Note: The logger setup is becoming a PITA, might be useful to replace with more robust logger that implements what buildMessage is doing automatically
EgaClient
adds error cases for 400 errors in axios interceptor
adds error handling for 400 - Permission does not exist to revokePermissions - this was caught while debugging ega api pagination issue
Job
adds main function for reconciliation flow, using functions found in /services
Utils
adds createPermissionApprovalRequest func for creating permission approval request objects
Types
adds nullable() to some of the response type fields. These values are not used in the recon flow
updates RevokePermissionsFailure type to include PERMISSION_DOES_NOT_EXIST
adds type for combined EGA - DACO user type for creating a map to check existing permissions when iterating over user list
moves errors.ts to types dir, adds custom errors for BadRequest and ServerError
Code cleanup/readability
creates a services/ folder for service functions related to users and permissions need in the main reconciliation job
Work for #454
Implements (mostly happy path) EGA permission reconciliation flow. Error handling needs to be improved in main job function and service calls - in most cases errors encountered should not stop the script from running, but would be useful to report/collect somehow, for debugging/possible retry scenarios.
Note: The logger setup is becoming a PITA, might be useful to replace with more robust logger that implements what
buildMessage
is doing automaticallyEgaClient
400 - Permission does not exist
torevokePermissions
- this was caught while debugging ega api pagination issueJob
/services
Utils
createPermissionApprovalRequest
func for creating permission approval request objectsTypes
nullable()
to some of the response type fields. These values are not used in the recon flowPERMISSION_DOES_NOT_EXIST
errors.ts
to types dir, adds custom errors forBadRequest
andServerError
Code cleanup/readability
services/
folder for service functions related to users and permissions need in the main reconciliation job