Repository navigation
feat: accept OPR_EXECUTOR_SECRET_PREVIOUS during secret rotation - #267
Conversation
The executor compared the bearer against one secret, so rotating it meant every caller and the executor had to switch at the same instant. It now also accepts an optional previous secret, and compares with hash_equals. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
🔵 Tier A · Mergeable after minor fixes
The executor auth hook now accepts either the primary secret or an optional previous secret, using
Fix with agent prompt### Issue 1
README.md:210
**Forward the new variable in the README compose example**
The Getting Started `docker-compose.yml` example at lines 50–64 explicitly forwards environment variables but omits `OPR_EXECUTOR_SECRET_PREVIOUS`. Setting this documented option in the example's `.env` therefore won't reach the executor, so the second key is not accepted for users following that setup.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.📂 Walkthrough · 5
Reviewed |
| | OPR_EXECUTOR_MAINTENANCE_INTERVAL| Interval (in seconds) at which the Executor performs maintenance tasks, ex: `60` | | ||
| | OPR_EXECUTOR_NETWORK | Network used by the executor for runtimes, ex: `openruntimes-runtimes` | | ||
| | OPR_EXECUTOR_SECRET | Secret key used by the executor for authentication | | ||
| | OPR_EXECUTOR_SECRET_PREVIOUS | Optional second key the executor also accepts, so callers can move to a new `OPR_EXECUTOR_SECRET` without downtime | |
There was a problem hiding this comment.
Forward the new variable in the README compose example
The Getting Started docker-compose.yml example at lines 50–64 explicitly forwards environment variables but omits OPR_EXECUTOR_SECRET_PREVIOUS. Setting this documented option in the example's .env therefore won't reach the executor, so the second key is not accepted for users following that setup.
Prompt To Fix With AI
This is a comment left during a code review.
Path: README.md
Line: 210
Comment:
**Forward the new variable in the README compose example**
The Getting Started `docker-compose.yml` example at lines 50–64 explicitly forwards environment variables but omits `OPR_EXECUTOR_SECRET_PREVIOUS`. Setting this documented option in the example's `.env` therefore won't reach the executor, so the second key is not accepted for users following that setup.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.🟡 Minor · documentation · Reply if this doesn't apply.
What
The
/v1/*auth hook compared the bearer againstOPR_EXECUTOR_SECRETalone. Rotating that secret meant the executor and every caller had to switch at the same moment, or calls failed in between.The executor now also accepts an optional
OPR_EXECUTOR_SECRET_PREVIOUS. A rotation becomes three steps:OPR_EXECUTOR_SECRET_PREVIOUSto the new value, so the executor accepts both.OPR_EXECUTOR_SECRETbecomes the new value, and_PREVIOUSholds the old one until every caller has moved._PREVIOUS.The comparison uses
hash_equalsinstead of!==. Empty and"0"secrets are still refused.Tests
testPreviousSecretAuthorizes(e2e) checks that a request with the previous secret gets 200 on/v1/runtimes, and that an unknown secret gets 401.docker-compose.ymland.envsetOPR_EXECUTOR_SECRET_PREVIOUSfor it.testGetRuntimesUnauthorizedandtestCommandsUnauthorized: 3 tests, 7 assertions, OK.🤖 Generated with Claude Code