Attach the incoming namespace to the request context - #268
Open
pseudomuto wants to merge 1 commit into
Open
Conversation
pseudomuto
force-pushed
the
namespace-context
branch
from
August 31, 2026 15:51
35a3ec4 to
eb8c61c
Compare
The encryptor knows how to seal payloads for a namespace but had no way to learn which one, so it took a context key it could never be handed a value for. StampNamespace supplies it. A server interceptor that reads the namespace a request names and leaves it on the context for the client interceptor further down to seal under. It runs before the translators, so what it records is the name the caller sent rather than the one the peer cluster uses. That is the name the encryption config is keyed by. Requests that name no namespace seal under the default key policy rather than being refused. Admin replication requests carry a namespace ID and no name, and nothing maps one to the other, so refusing would drop traffic the proxy exists to carry without making the payload any safer. Encryption config requires a Default precisely so this case is covered. NB: This isn't wired to a client yet. The encryptor still has to be installed on the outbound client before any of this seals anything.
pseudomuto
force-pushed
the
namespace-context
branch
from
September 1, 2026 14:10
eb8c61c to
2c1c76b
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.
The encryptor knows how to seal payloads for a namespace but has no way to learn which one, so it takes a context key it can never be handed a value for. StampNamespace supplies it. A server interceptor that reads the namespace a request names and leaves it on the context for the client interceptor further down to seal under.
It runs before the translators, so what it records is the name the caller sent rather than the one the peer cluster uses. That is the name the encryption config is keyed by.
Requests that name no namespace seal under the default key policy rather than being refused. Admin replication requests carry a namespace ID and no name, and nothing maps one to the other, so refusing would drop traffic the proxy exists to carry without making the payload any safer. Encryption config requires a Default precisely so this case is covered.
NB: This isn't wired to a client yet. The encryptor still has to be installed on the outbound client before any of this seals anything.