Skip to content

feat(repeater): send request attribution ids to the target proxy - #821

Draft
derevnjuk wants to merge 12 commits into
nextfrom
feat/proxy-target-attribution
Draft

derevnjuk wants to merge 12 commits into
nextfrom
feat/proxy-target-attribution

Conversation

@derevnjuk

@derevnjuk derevnjuk commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

Lets the --proxy-target traffic sidecar attribute each target request to its entrypoint, scan and discovery, without the ids ever reaching the target.

The traffic sidecar placed in front of the target via --proxy-target needs to know which
entry point, scan and discovery each request belongs to, to log and later isolate a failing
endpoint. The ids arrive as event fields like traceId and, only with the opt-in
--proxy-target-attribution flag and only for proxied requests, go out as curl proxy
headers with HEADEROPT separate, so the target never gets them and for https they appear
only on CONNECT. Ids that are not 1 to 128 characters of letters, digits, dot, underscore
or dash are dropped.
A request script rebuilt the request from its own result, so it could drop or forge the
attribution ids; the rebuilt request now takes them from the original and the script never
sees them. The ids are opaque, so any non-empty value is sent, and the entrypoint id is
renamed to entrypointId and X-Bright-Entrypoint-Id to match the platform's naming.
Checking single headers hid unexpected extra or changed ones, so each spec now compares the
full headers the proxy and the target received, and the whole rebuilt request, at once.
Bright ids are 22-character base58 short UUIDs, so the specs now use ids of that shape.
A request script could read and rewrite every request option, including TLS material and
the attribution ids, so it could leak or forge them. Scripts now get only what they are
meant to change, and the rebuilt request keeps every other option from the original.

BREAKING CHANGE: request scripts no longer receive or can change protocol, ca, pfx,
passphrase, timeout, correlationIdRegex, maxContentSize, decompress or keepAlive.
Folding independent results into one synthetic object made failures harder to read, so each
result the proxy, the target or the response produced is now compared whole on its own.
The file groups tests by method without nested suites, so the attribution specs now sit with
the other execute tests.
Scripts now exchange only url, method, headers and body, so an encoding a script returned
is no longer read: an untouched body keeps the original body and encoding, and a changed
body is sent as the script wrote it.

BREAKING CHANGE: a request script can no longer return an encoding to have its own body
decoded; a body it changes is sent as is.
@derevnjuk derevnjuk self-assigned this Nov 11, 2026
@derevnjuk derevnjuk added the Type: enhancement New feature or request. label Nov 11, 2026
A repeater error tagged only with the trace id points at one request.
Tagging it with the entrypoint, scan and discovery ids as well lets Sentry
group errors by the scan or endpoint that causes them.
Narrowing what a request script sees and returns is its own change and moves
to a separate pull request. This one keeps only carrying the attribution ids
across the script rebuild.
Every other spec in the file starts with "should", so these follow suit.
@derevnjuk
derevnjuk marked this pull request as ready for review November 11, 2026 13:17
@derevnjuk
derevnjuk requested a review from aborovsky November 11, 2026 13:25
@derevnjuk
derevnjuk enabled auto-merge (squash) November 11, 2026 13:25
Comment thread src/Commands/RunRepeater.ts Resolved
@derevnjuk
derevnjuk marked this pull request as draft November 13, 2026 08:52
auto-merge was automatically disabled November 13, 2026 08:52

Pull request was converted to draft

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type: enhancement New feature or request.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants