Repository navigation
Keep runtime-proof API refresh credentials in root custody - #985
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
Code Review
This pull request refactors the fixed API bearer provisioning flow to store the API refresh profile as a root-owned, encrypted blob at /etc/credstore.encrypted/codex-runtime-proof-api-refresh using the systemd-creds utility, replacing the previous implementation that stored it in the invoking user's OS keyring. This eliminates the need for spawning an unprivileged child process and the associated seqpacket IPC handoff. Feedback on the changes points out an issue in the pre_exec closure for systemd-creds where std::io::Error::last_os_error() is incorrectly returned on a geteuid check failure, and suggests returning an explicit EPERM error instead.
f1e16e4 to
72ffc85
Compare
The HTTP credential provisioner currently stores its refresh profile in the invoking user's keyring and transfers the access token back to the root launcher over a private descriptor. This moves the fixed OAuth transaction into the non-dumpable root provisioner and keeps the existing refresh rotation, bearer publication, and logout under one root credential lock.
The profile is stored only as a fixed host-encrypted systemd credential, using the existing host key and an explicit credential name. The provisioner atomically persists refresh-token rotation before returning a bearer and fails closed on persistence errors. The browser helper receives only the authorization URL and drops to the invoking desktop UID/GID. The MCP credential path and claim service's loaded bearer cleanup remain unchanged.
Validation:
rustfmt --edition 2024andgit diff --checkpassed. Local build/test execution is prohibited for this assignment; hosted validation should use the existing Codex branch CI and Linux x86_64 package/install smoke. The exact candidate isb0a5e0c3a46f04d80ec11e44fb458475777582a6.