-
Notifications
You must be signed in to change notification settings - Fork 4
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
[#172884867] Automatic user data delete on GDPR right to erasure claim #62
Conversation
Co-authored-by: Danilo Spinelli <gunzip@users.noreply.github.com>
Co-authored-by: Danilo Spinelli <gunzip@users.noreply.github.com>
Co-authored-by: Danilo Spinelli <gunzip@users.noreply.github.com>
Co-authored-by: Danilo Spinelli <gunzip@users.noreply.github.com>
…unctions-admin into 172884826-automatic-download
…ctions-admin into 172884867-automatic-delete
userDataBackup: IBlobServiceInfo; | ||
fiscalCode: FiscalCode; | ||
}) => { | ||
return executeRecursiveBackupAndDelete<RetrievedProfile>( |
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.
Minor style note, remove the curly braces and the return statement
userDataBackup: IBlobServiceInfo; | ||
notification: RetrievedNotification; | ||
}): TaskEither<DataFailure, RetrievedNotification> => { | ||
return sequenceT(taskEitherSeq)< |
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.
In general if you have a single return statement, just avoid the code block
* @param makeBackupBlobName takes an item and construct a name for the backup blob | ||
* @param iterator an iterator of every result from the db | ||
*/ | ||
const executeRecursiveBackupAndDelete = <T>( |
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.
It would be nice to generalize the recoursive logic and separate it from the specific use case (I.e the accumulators)
.mapLeft(toDocumentDeleteFailure) | ||
.chain(_ => fromEither(_).mapLeft(toDocumentDeleteFailure)), | ||
// recursive step | ||
executeRecursiveBackupAndDelete<T>( |
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 this basically a reduce operation on the iteration?
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.
It's basically this, but I didn't get to fit it in at the time of writing
.chain(e => fromEither(fromOption(undefined)(e))) | ||
.foldTaskEither<DataFailure, Option<MessageContent>>( | ||
_ => { | ||
// unfortunately, a document not found is threated like a query error |
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.
Does this mean that the user may get a subset of his data?
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, in case of an error while fetching data. The rationale is: we don't want to impede the operation in case of a missing blob (which is a case of inconsistence of data, and should never happen).
2c212b9
to
d9377f4
Compare
Anything different from |
This PR introduces into this service the ability to autonomously start the job that backup and deletes user data on user's request.
It depends on this to be merged: pagopa/io-backend#691Done
user-data-processing
collectionThings worth looking
Env
Feature flags
Notable Changes
utils/fetch
module with pre-built timeout fetch api.utils/appinsightsEvens
module with Application Insights helpers.XyzDeletableModel
s that extendXyz
s models by adding deleting operations (example:ProfileDeletableModel
extendsProfileModel
). Such modules are located inutils/extensions
.