Repository navigation
[config]: Add --require-encryption to refuse starting without a key - #227
Merged
Merged
Conversation
A config with no encryption block passes validation, so an upgrade or config edit can ship a proxy that forwards payloads in plaintext. With --require-encryption (or PROXY_REQUIRE_ENCRYPTION=true), the proxy fails at startup unless encryption.default is configured. The check keys on a configured key rather than encryption.enabled, so a decrypt-only proxy (a key with enabled false) still starts. It lives outside the config file so editing the config alone cannot disable it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! 🚀 New features to boost your workflow:
|
2 tasks done
gauravthadani
marked this pull request as draft
October 15, 2026 05:23
pseudomuto
reviewed
Oct 15, 2026
pseudomuto
left a comment
Collaborator
There was a problem hiding this comment.
Love this idea 🔥 Simple and effective.
Replace the named requireEncryption dependency with config.RequireKey, an fx.Invoke that checks the provided *Config. config.Module and ConfigParams return to their original shape, and the check now also works with config.Supply for applications that build their config in code. A missing key still fails app.Err() at startup. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tion # Conflicts: # internal/config/encryption.go
gauravthadani
marked this pull request as ready for review
October 17, 2026 07:07
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.
Summary
Encryption is optional in the proxy config, so an upgrade or config edit can deploy a proxy that forwards payloads unencrypted. This adds an opt-in safety net:
serveflag--require-encryption/ envPROXY_REQUIRE_ENCRYPTION. When set, the proxy fails at startup unless the config hasencryption.default.encryption.enabled. A key withenabled: falseis a valid decrypt-only mode (the vault is built when a key is present,internal/kms/fx.go), so it still starts.The Helm chart change that turns this on by default will be a follow-up PR in
temporalio/helm-charts.Test plan
TestModule_RequireEncryption: no encryption block → rejected; disabled with no key → rejected; decrypt-only with a key → starts; enabled with a key → starts; flag off with no key → starts--require-encryptionand once withPROXY_REQUIRE_ENCRYPTION=true: both exited 1 withencryption: default: a key is required when encryption is requiredgo test ./...,mise run lint🤖 Generated with Claude Code