Repository navigation
feat: the Discord bot token can live in the secrets proxy - #254
Merged
Merged
Conversation
It stayed in Prax because REST wants 'Authorization: Bot <token>' and the gateway carries the token inside IDENTIFY/RESUME. The forward proxy now does both (header prefix + WebSocket message rewrite, prax-secrets-proxy #8). The registry marks the credential exclusive: the forward map includes it only with the one proxy caller allowed to run the bot (--exclusive-callers DISCORD_BOT_TOKEN=prax-prod), so a dev instance can never become the bot too. Verified with real discord.py through the real proxy against a fake Discord.
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 Discord bot token was the one credential that couldn't move to the secrets proxy. Proxy side: praxagent/prax-secrets-proxy#8.
What was missed in July
The 2026-07-22 verdict (LOCAL: a
401, "no header to inject") came from header-only injection. The MITM forward proxy can do both remaining parts:Authorization: Bot <token>using a header prefix.d.token. discord.py sends them as plain JSON text: the gateway usescompress=0, and zlib-stream compresses only the server's side.Changes
credential_registry:DISCORD_BOT_TOKENis nowPROXY_FORWARD,inject="discord-bot",exclusive=True.--exclusive-callers DISCORD_BOT_TOKEN=prax-prod.secrets-proxy.mdgets a section with the rollout (the proxy holds the token, its ownprax-prodcaller, regenerate the map, Prax gets a placeholder plusDISCORD_USE_PROXY=true, then rotate the token);credentials.mdanddeployment-topology.mdare updated;Verified
LoginFailure.make cigreen: 4013 passed. No secrets-proxy requests during the run beyond my own.invalidprobe.Rollout
This needs the proxy's #5, #6 and #8 merged and deployed, and production
.envchanges, which are yours to make. Steps are in the doc.