-
Notifications
You must be signed in to change notification settings - Fork 263
feat(core): add masked_connector_response with per-connector key allowlist #2050
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
Open
shuklatushar226
wants to merge
15
commits into
main
Choose a base branch
from
feat/unmasked-connector-response
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 9 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
6e2166f
feat(core): add unmasked_connector_response with per-connector key al…
shuklatushar226 b4431bc
test(core): remove unmasked_connector_response unit tests
shuklatushar226 cb64e5c
refactor(core): drop the response size cap and seed a single connector
shuklatushar226 d00b920
fix(core): resolve CI failures on unmasked_connector_response
shuklatushar226 0cd38c0
Merge remote-tracking branch 'origin/main' into feat/unmasked-connect…
shuklatushar226 6909fa0
chore: merge main, cover new call sites, trim comments
shuklatushar226 73ee3ff
perf(core): check the allowlist before the denylist in allowed()
shuklatushar226 95ecc2d
fix(core): handle newline-separated and BOM-prefixed connector responses
shuklatushar226 c8ac48f
fix(core): resolve the masking connector by name, not a ConnectorEnum…
shuklatushar226 709b850
refactor(core): rename unmasked_connector_response to masked_connecto…
shuklatushar226 d2eeb6a
fix(core): mask response paths that have no key to gate on
shuklatushar226 52de180
chore(config): default connector response masking off outside develop…
shuklatushar226 e5169b4
build(core): gate connector response masking behind a Cargo feature
shuklatushar226 4452706
fix(core): honour log_to_span across every gRPC-level log sink
shuklatushar226 2a98da5
feat(events): publish masked_connector_response on the connector event
shuklatushar226 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| //! Small helpers over raw byte slices. | ||
|
|
||
| const UTF8_BOM: &[u8] = &[0xEF, 0xBB, 0xBF]; | ||
|
|
||
| /// Strip any leading UTF-8 BOMs from `bytes`. | ||
| /// | ||
| /// Several gateways (Authorize.Net among them) prefix responses with a BOM, which every body | ||
| /// parser rejects. Takes bytes rather than a decoded string so callers can strip before deciding | ||
| /// whether the body is even UTF-8. Repeated BOMs are all removed. | ||
| pub fn strip_utf8_bom(bytes: &[u8]) -> &[u8] { | ||
| let mut rest = bytes; | ||
| while let Some(stripped) = rest.strip_prefix(UTF8_BOM) { | ||
| rest = stripped; | ||
| } | ||
| rest | ||
| } |
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.
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.
enabled = truehere and insandbox.toml, gated independently ofreturn_raw_connector_data, means the masked view reaches callers from the first deploy — which makes the bypasses I've flagged onconnector_response_masking.rslive rather than latent. Can we default itfalseuntil those are closed and covered? The structDefaultis alreadyfalse, so it's config-only.The comment block above also promises PAN/CVV/expiry stay masked regardless — true for keyed fields, not for the unkeyed paths.
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.
Taking it.
enabled = falsein bothsandbox.tomlandproduction.toml,development.tomlstaystrue. Config-only, as you note — the structDefaultwas alreadyfalse.I'd have argued the containment case is weaker now that the bypasses are closed in this same PR, but that's the wrong way round: the reason to ship it off is that turning it on returns connector response bytes to the caller, so a deployment should opt in once it has chosen its key lists — independent of whether any particular bypass is open. Added that as the comment above the flag.
On the comment block — you're right that it was a claim about keyed fields dressed up as an unconditional one. Rewritten to say what naming a key actually grants, and to name the unkeyed case explicitly rather than leave it implied:
Applied to all three config files. Fixed in 52de180.