Repository navigation
egress: a claim credential can require a placeholder before it injects - #307
Merged
Merged
Conversation
An inject entry may name a placeholder: the proxy then sets the header only on intercepted requests whose header already carries exactly that value, and leaves every other request to the same hosts untouched. A tool such as git opts in per request (http.extraHeader with the placeholder), so a browser signed in to the same host never receives the credential.
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.
A claim credential (#302) injects on every intercepted request to its hosts. On a desktop box this also hands the credential to a browser browsing the same host, for example github.com while a user is signed in. This PR adds an optional
placeholdertoinject.git config --global http.https://github.com/.extraHeader "Authorization: Basic @GH_GIT@"placeholder: the proxy replaces the header only when the guest's request carries exactly that value. Every other request to those hosts passes unchanged.GET /env.EqualandInjectsChanged.Hot path: one
Header.Getper placeholder credential on an intercepted request to a matching host. Nothing changes elsewhere.Tests
EqualandInjectsChanged.TestInterceptInjectsAPlaceholderCredentialOnlyWhereTheGuestSentItcovers placeholder sent → replaced, header absent → untouched, a different value → untouched. With the placeholder clause removed it fails on the absent and different-value cases.credsmokegains a placeholder leg.Hardware
Bare-metal testbed, isolated kit cocoon root, template
rt:24.04-90230c0.scripts/credentials-e2e.shwith this branch's sandboxd and credsmoke: PASS, including the new line "a placeholder credential reached the origin only on the request that carried its placeholder", and the restart reattach leg.Gates
0 issues.eachfmt --diffasl -forwarder=false, both GOOSgo testtypes, egress, pool, server-racetypes, egress, pool (golang:1.27.1 linux/arm64, non-root)