mirror of
https://github.com/antonioribeiro/google2fa.git
synced 2026-04-25 08:05:49 +03:00
[PR #187] [MERGED] Add \SensitiveParameter attribute to params with any secret or key material #667
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/google2fa#667
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/antonioribeiro/google2fa/pull/187
Author: @spaze
Created: 2/7/2023
Status: ✅ Merged
Merged: 3/1/2023
Merged by: @antonioribeiro
Base:
8.x← Head:spaze/sensitive-parameters📝 Commits (1)
9c498ffAdd \SensitiveParameter attribute to params with any secret or key material📊 Changes
3 files changed (+82 additions, -34 deletions)
View changed files
📝
src/Google2FA.php(+34 -12)📝
src/Support/Base32.php(+42 -20)📝
src/Support/QRCode.php(+6 -2)📄 Description
Hi, this attribute is used to mark a parameter that is sensitive and should have its value redacted if present in a stack trace. (verbatim copy from the PHP manual)
The redaction will be performed only on PHP 8.2 and newer but the attribute itself and the syntax is backwards compatible so using the class with let's say PHP 7.4 will still work as it did before.
I have added the attribute to all params that hold the secret, or the 2FA code, or strings that will contain parts of either of them.
Compare the call stacks, before:


and after the attribute has been added:
Thanks.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.