fix: mask sensitive connection credentials in toArray()#38
Open
LukasZemanNiceCZ wants to merge 2 commits intoopensearchfrom
Open
fix: mask sensitive connection credentials in toArray()#38LukasZemanNiceCZ wants to merge 2 commits intoopensearchfrom
LukasZemanNiceCZ wants to merge 2 commits intoopensearchfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR aims to prevent credential leakage by redacting username and password from the connection parameters when a Request is serialized via Request::toArray() (commonly used for logging/debug output).
Changes:
- Redacts
usernameandpasswordin the connection params returned byRequest::toArray(). - Ensures request array serialization is safe to log without leaking credentials.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Masks username and password in connection params with *** in Request::toArray() - Prevents credentials from leaking into logs or debug output - Adds unit test covering the masking behaviour
6003b54 to
3b2912e
Compare
- Masks username and password in connection params with *** in Request::toArray() - Prevents credentials from leaking into logs or debug output - Extends existing testToString to verify credentials are masked
This file contains hidden or 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
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 username and password in connection params when serializing request to array
Possible impact: Logging, debugging output, request serialization
Port of #37 to the
opensearchbranch.Summary
usernameandpasswordfields in$_connection->getParams()with***inRequest::toArray()🤖 Generated with Claude Code