Skip to content

Attach the incoming namespace to the request context - #268

Open
pseudomuto wants to merge 1 commit into
encryption-interceptorfrom
namespace-context
Open

Attach the incoming namespace to the request context#268
pseudomuto wants to merge 1 commit into
encryption-interceptorfrom
namespace-context

Conversation

@pseudomuto

Copy link
Copy Markdown
Contributor

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.

@pseudomuto
pseudomuto requested a review from a team as a code owner August 31, 2026 15:48
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant