Centralize deployment.secrets through DeploymentState#152
Merged
jonathonbyrdziak merged 3 commits intomasterfrom Mar 24, 2026
Merged
Centralize deployment.secrets through DeploymentState#152jonathonbyrdziak merged 3 commits intomasterfrom
jonathonbyrdziak merged 3 commits intomasterfrom
Conversation
Production nodes now read secrets mode from NodeConfig (~/.protocol/.node/nodes/<project>.json) instead of protocol.json in the release directory. Dev/staging falls back to repo-level protocol.json. This fixes AWS secrets not being injected on production deployments where protocol.json had "encrypted" baked into the release tag. Also moves aws-secrets.log to /var/log/protocol/. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ets mode If a NodeConfig exists (production), return its deployment.secrets value or default to "file" — never read from the release directory's protocol.json. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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
secretsMode()andsetSecretsMode()toDeploymentState, making it the single source of truth for reading/writingdeployment.secrets~/.protocol/.node/nodes/<project>.json— never falling back to the repo-levelprotocol.jsonprotocol.jsonas beforeJson::read('deployment.secrets')calls and all 9Json::write('deployment.secrets')calls across the codebaseaws-secrets.logto/var/log/protocol/Root cause: On production,
SecretsProviderwas readingdeployment.secretsfromprotocol.jsoninside the release directory (e.g./home/ec2-user/enterprise-gateway-releases/v1.0.9/protocol.json), which had"encrypted"baked into the release tag. The node-level config at~/.protocol/.node/nodes/enterprise-gateway.jsonhad the correct"aws"value but was never consulted.Files changed
DeploymentState.php— newsecretsMode()/setSecretsMode()methodsSecretsProvider.php,Soc2Check.php,ProtocolStatus.php,ConfigSave.php,Migrate.php— replaced direct readsAwsSecretsInit.php,ConfigInit.php,Migrate.php,ProtocolInit.php— replaced direct writesAwsSecretsHelper.php— log path moved to/var/log/protocol/Test plan
protocol restarton gateway production — verifyprotocol exec envshows AWS secrets/var/log/protocol/secrets-provider.logshowsmode=aws(notencrypted)protocol config:initon a dev machine — verifyprotocol.jsonstill getsdeployment.secretswrittenprotocol aws:initon a dev machine — verify bothprotocol.jsonand NodeConfig are updated🤖 Generated with Claude Code