Skip to content

fix: mask sensitive connection credentials in toArray()#38

Open
LukasZemanNiceCZ wants to merge 2 commits intoopensearchfrom
fix/mask-connection-credentials-opensearch
Open

fix: mask sensitive connection credentials in toArray()#38
LukasZemanNiceCZ wants to merge 2 commits intoopensearchfrom
fix/mask-connection-credentials-opensearch

Conversation

@LukasZemanNiceCZ
Copy link
Copy Markdown

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 opensearch branch.

Summary

  • Masks username and password fields in $_connection->getParams() with *** in Request::toArray()
  • Prevents credentials from leaking into logs or debug output

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings April 9, 2026 15:29
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 username and password in the connection params returned by Request::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.

Comment thread src/Request.php Outdated
Comment thread src/Request.php Outdated
- 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
@LukasZemanNiceCZ LukasZemanNiceCZ force-pushed the fix/mask-connection-credentials-opensearch branch from 6003b54 to 3b2912e Compare April 10, 2026 07:48
- 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants