-
Notifications
You must be signed in to change notification settings - Fork 103
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
[PW-2059] Mask encrypted/sensitive data in the logs #164
Merged
Conversation
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
Walk through recursively in an associative array containing all the key path combinations for the sensitive values in the request or response parameters array Masking is only effective in live environment Add maskParameter() to only keep the first 10 characters of the parameter's value and append 3 asterisks in case the value is not empty
Add parameter list that needs to be masked Add environment as a required parameter to the logRequest() to determine if masking needs to be done or not Masking only needs to be done in live environment Adjust the existing usage of the logRequest to the new parameters list
Replace the current response object logging with logResponse()
Json decode response before logging because the logResponse expects and array Add paymentData into the list of $paramsToMask for both request and response logging
cyattilakiss
requested review from
acampos1916,
Aleffio,
AlexandrosMor,
msilvagarcia and
rikterbeek
as code owners
February 4, 2020 08:58
msilvagarcia
suggested changes
Feb 4, 2020
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.
Request some changes to the curl client.
It's also missing test cases for situations when a field should be masked.
cyattilakiss
changed the title
[PW-2059] Mask encrypted/sensitive data in the logs
[WIP][PW-2059] Mask encrypted/sensitive data in the logs
Feb 4, 2020
To be able to mock not just test but live configurations as well
By default in test environment the library will not mask the parameters only in live environment
In live environment the parameters will be masked
Make $paramsToMask in response and $paramsToMask in request to a private static property
cyattilakiss
changed the title
[WIP][PW-2059] Mask encrypted/sensitive data in the logs
[PW-2059] Mask encrypted/sensitive data in the logs
Feb 4, 2020
msilvagarcia
previously approved these changes
Feb 4, 2020
Comment on lines
+397
to
+399
if (empty($parameter)) { | ||
return $parameter; | ||
} |
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 like the early return :)
acampos1916
previously approved these changes
Feb 5, 2020
cyattilakiss
dismissed stale reviews from acampos1916 and msilvagarcia
via
February 6, 2020 10:24
99c1b75
Aleffio
approved these changes
Feb 6, 2020
acampos1916
approved these changes
Feb 6, 2020
msilvagarcia
approved these changes
Feb 6, 2020
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Mask the encrypted card details and other sensitive data from the logs of the payments requests and responses if the environment is live