Adds support for SLAS proxy req/res callbacks#3411
Merged
Conversation
Collaborator
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
alexvuong
approved these changes
Oct 20, 2025
shethj
approved these changes
Oct 20, 2025
clavery
added a commit
that referenced
this pull request
Oct 27, 2025
clavery
added a commit
that referenced
this pull request
Oct 27, 2025
slas private proxy test coverage lint lint warnings backporting SLAS proxy callbacks Remove passwordless login 404 masking (not part of PR #3411) Restore error logging from base branch (preserve existing functionality)
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.
Summary
This PR adds extensibility to the SLAS private client proxy by introducing two new optional callback hooks that allow developers to customize proxy request and response handling.
We also added test coverage for this use case and other (uncovered) existing behavior of the proxy.
New Options
onSLASPrivateProxyReqA callback invoked after the built-in proxy request handling. Allows developers to add custom headers or modify the proxy request before it's sent to SLAS.
Signature:
(proxyRequest, incomingRequest, res) => voidExample:
onSLASPrivateProxyResA callback invoked after the built-in proxy response handling. Allows developers to modify response headers or transform the response buffer.
Signature:
(responseBuffer, proxyRes, req, res) => BufferExample:
Use Cases
Cookie Attribute Modification
A common use case is modifying Set-Cookie headers from SLAS
/tokenresponses. For example, ensuring that SLAS cookies have theSameSite=None; Secureattributes set for cross-site and<iframe>scenarios.Example:
Custom Header Injection
Add custom headers to SLAS proxy requests for debugging, tracing, or integration with other systems.
Response Logging and Monitoring
Log response status codes, timing information, or other metrics for monitoring SLAS API interactions.
Response Transformation
Modify response buffers if needed (though this should be done carefully to avoid breaking API contracts).
User Enumeration Protection
Mask SLAS responses for endpoints that might enumerate users if security controls and privacy requirements necessitate this.
Implementation Details
onSLASPrivateProxyRes, returningundefinedwill use the existing bufferDescription
Types of Changes
Changes
How to Test-Drive This PR
Checklists
General
Accessibility Compliance
You must check off all items in one of the follow two lists:
Localization