Skip to content

bench: present the account access token instead of exchanging for a jurisdiction token - #16

Merged
toothbrush merged 22 commits into
mainfrom
paul/present-account-access-token
Oct 1, 2026
Merged

toothbrush merged 22 commits into
mainfrom
paul/present-account-access-token

Conversation

@toothbrush

@toothbrush toothbrush commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

https://entire.io/gh/entireio/forgemark/trails/5

Why

entire-core stops issuing jurisdiction tokens in https://github.com/entirehq/entiredb/pull/4313 (ADR 20260729). ForgeMark's Entire path still exchanged the subject token for one, so every Entire run would fail with invalid_target once that deploys.

What

  • The subject token passed as -token-file/ACCESS_TOKEN is the account access token; entiredb authorizes each push live on it, so it is presented as-is. The RFC 8693 exchange, its refresh goroutine and the singleflight dependency are gone.
  • -token-url, -jurisdiction and -client-id are still accepted: their presence selects the Entire path, so existing invocations (infra bootstrap, compare-local.sh, the GUI suggest endpoint) keep working. None of them is dialed.

Note: the run is now bounded by the subject token's own lifetime (45m for a federated service-account session, 8h for a login). A sweep whose remaining levels outlast the token's exp is refused after discovery and again before each measured window. Gate findings added replica pinning (scheme, parent domain, port, bare origin, case-folded). Discovery follows Entire's ALB 307 one hop, only to a pinned replica, with its own credential; pushes and cleanup refuse redirects.

Verification

go build ./..., go vet ./..., go test ./... pass.

🤖 Generated with Claude Code


Note

Medium Risk
Changes authentication for Entire benchmarks (credential shape and lifetime); behavior is simpler but long runs are bounded by the access token TTL instead of exchanged jurisdiction tokens.

Overview
Aligns ForgeMark’s Entire target with ADR 20260729 (entiredb no longer issues jurisdiction tokens): -token-file / ACCESS_TOKEN is now sent as HTTP basic-auth as the account access token, with live authorization on each push, instead of exchanging it via RFC 8693.

The jurisdictionCreds implementation is removed—no OAuth POST to -token-url, no refresh goroutine, no singleflight—and setupEntiredb wires staticCreds like other forges. -token-url, -jurisdiction, and -client-id still select the Entire path for backward compatibility (scripts, GUI suggest); docs and flag help note they are not dialed. golang.org/x/sync drops from direct go.mod requires.

README and server audience-validation comments are updated to match the new model; long Entire credential tests are replaced with a staticCreds unit test.

Reviewed by Cursor Bugbot for commit 109aeee. Configure here.

toothbrush and others added 11 commits September 28, 2026 18:13
…urisdiction token

entire-core no longer issues jurisdiction tokens (ADR 20260729,
entirehq/entiredb#4313). entiredb authorizes each push live on the
account access token's subject, so the subject token ForgeMark already
holds is the credential. Delete the RFC 8693 exchange and its refresh
machinery; -token-url, -jurisdiction and -client-id stay as the Entire
path selector so existing invocations keep working.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The account access token goes to every node, so an unvalidated
X-Entire-Replicas header could redirect it to an arbitrary host.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Entire answers info/refs via the ALB with a 307 to a hosting replica, so
refusing every redirect broke setup against the cluster entry URL. The
probe now follows one hop, only to a node in the pinned X-Entire-Replicas
set, with its own credential. Pushes still refuse redirects.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Entire-Checkpoint: 5e54d50c1fc4
The preflight ran before discovery and counted only warmup+duration, so
discovery, agent setup, the barrier and between-level cleanup could burn
the token past expiry. Check after discovery, then again at each window
for every level not yet started.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Entire-Checkpoint: 5670e87ece59
Stripping the first label treated 127.0.0.1 as under 0.0.1, admitting
10.0.0.1, and tenant.github.io as under github.io. Use the public suffix
list's eTLD+1 instead; IPs and bare names like localhost match only
themselves.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Entire-Checkpoint: df13dc9bb713
toothbrush and others added 10 commits September 30, 2026 10:49
The expiry check read exp from any JWT-shaped secret, so a generic
forge credential could be refused on semantics that are Entire's alone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Entire-Checkpoint: 45b8dea16c2c
Discovery errors quote server-controlled replica and Location URLs, so a
server reflecting the credential could land it in the GUI, SSE and saved
results; scrub every form of it at the endpoint boundary. Match the
redirect by hostname and effective port so an explicit :443 is the same
origin.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Entire-Checkpoint: d4029c3b2c49
net/http reads proxy env once per process, so any earlier test that
sent a request through newHTTPClient pinned an empty proxy config and
failed TestNewHTTPClientUsesHTTPSProxy. Check the transport uses
http.ProxyFromEnvironment instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Entire-Checkpoint: d345c84469b6
A session level whose window ends exactly at exp still runs its ref
deletes afterwards, which would authenticate past expiry and leak refs.
Reserve the 30s delete timeout per session level, plus 30s for clock
skew.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Entire-Checkpoint: 1bab49136deb
eTLD+1 alone widened node.cluster.customer.example.com to every host
under example.com. Admit the entry host's parent domain, but never
wider than its registrable domain.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Entire-Checkpoint: f9eab10d4158
A token refused after discovery, or a failed discovery, returned without
closing the probe's idle connection.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Entire-Checkpoint: 1266a01fad12
aws-us-east-2.entire.io admitted https://entire.io, a different service.
Admit the entry host and siblings under its parent only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Entire-Checkpoint: c1665769b243
@toothbrush

Copy link
Copy Markdown
Contributor Author

Live smoke test at e50e1ce

Against the au cluster after entiredb 18b8a5ee2e (jurisdiction token removed) was deployed. Remote is the cluster URL, so discovery took the ALB 307 hop to a pinned replica (3 nodes reported). Repo et/paul/forgemark-target, 10s windows, 2s warmup.

forgemark -remote https://aws-ap-southeast-2.entire.io \
  -token-url https://au.auth.entire.io/oauth/token -jurisdiction https://au.entire.io \
  -token-file - -repos et/paul/forgemark-target -concurrency 1,2 -duration 10s -warmup 2s
strategy c ok ops/s p50 ms p95 ms errors
push 1 65 6.5 149 158 0
push 2 127 12.7 150 200 0
clone 1 49 4.9 200 201 0
clone 2 96 9.6 205 210 0
  • Direct-to-node run (-remote https://cobar.aws-ap-southeast-2.entire.io) gave the same numbers, so the redirect hop costs nothing measurable.
  • stderr and stdout of every run scanned for the raw token: absent. Relevant because the ALB 307 embeds the caller's credential in Location (server-side, tracked in COR-1992, present since May 2026, not a regression).
  • go test ./... green on this tip.

bench: pin replicas to the registrable domain
@toothbrush
toothbrush merged commit d4853db into main Oct 1, 2026
3 checks passed
@toothbrush
toothbrush deleted the paul/present-account-access-token branch October 1, 2026 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant