Repository navigation
tier1: read trusted headers per response, not once per stream - #979
Open
matthewdarwin wants to merge 1 commit into
Open
matthewdarwin wants to merge 1 commit into
matthewdarwin wants to merge 1 commit into
Conversation
matthewdarwin
force-pushed
the
tier1-read-auth-per-response
branch
from
October 7, 2026 12:49
e162b43 to
dc42998
Compare
matthewdarwin
marked this pull request as ready for review
October 7, 2026 12:54
The Blocks response handler copied organization id, api key id, meta and ip from the trusted headers when the stream started. Reading them on every response lets metering pick up headers refreshed by continuous authentication during the stream. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
matthewdarwin
force-pushed
the
tier1-read-auth-per-response
branch
from
October 9, 2026 22:03
dc42998 to
a8570ef
Compare
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.
Minimal option; #980 is the alternative that removes the duplicated identity handling instead. Only one of the two is needed.
tier1's Blocks response handler copies organization id, api key id, meta and ip out ofdauth.FromContext(ctx)once, when the stream starts, and reuses those values for every metering event of the stream.streamingfast/dauth#19 lets continuous authentication refresh a stream's trusted headers mid-stream, for example when the first
Authenticatereturned an empty success. With the values copied up front, tier1 would keep metering the stream with the original, possibly empty, identity. This reads the headers on each response instead, asfirehose/server/server.goalready does.FromContextis a context lookup plus an atomic load per response. Behaviour is unchanged until dauth#19 is in.Tested:
go build ./...andgo test ./service/ ./metering/, both against current dauth and with areplacepointing at the dauth#19 branch.🤖 Generated with Claude Code