You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(agent): read the token on each request instead of keeping it in memory (#000) - #239
The agent now reads its token through a SecretStore on each request, instead of keeping a copy in each thread for the whole run. First step towards storing the token in the OS secret store (#245 and #240 build on it).
flowchart LR
T[Ping / jobs thread] --> C["Client.post / delete"]
C --> S["SecretStore.get(token)"]
S --> F[(config file)]
S -. unreadable .-> E["Safe error, logged once<br/>no request sent"]
C --> H["Bearer header<br/>wiped after the request"]
Loading
Changes
SecretStore trait and ConfigStore, which reads the token from the config on each call.
Client holds the store; post and delete return Result and send nothing if the token cannot be read.
The Authorization header owns a Zeroizing buffer, wiped after the request, and is marked sensitive.
OpenAEV.token is Zeroizing, and printing the settings shows <redacted>.
SettingsSource (the config location only) is shared by start-up and ConfigStore. Config errors are logged once, with a reason that never quotes the token.
Impact
Nothing changes on disk or in the installers.
A token changed in the config is used at the next request, without a restart.
Build the branch and install the agent in one mode per OS. On Windows, run the NSIS installer directly, since branch builds aren't release-signed. Then check each row:
Automated: cargo test --locked
Manual (Windows Sandbox, build this branch, then run the NSIS installer directly):
Install the agent (service mode) → it shows online and an inject works.
Search openaev-agent.log for the token → not found.
While the agent runs, set a wrong token in the config → calls fail. Put the right one back → the agent is online again without restart.
Swap the exe of an agent installed from the current release → still online.
I added/update the relevant documentation (either on github or on notion)
Where necessary I refactored code to improve the overall quality
For bug fix -> I implemented a test that covers the bug
Further comments
Impact for users: none. Same files, same installers, same behaviour. A changed token in the config is now used without a restart.
Limit: the HTTP/TLS libraries and the config loader keep their own copies of the token, which the agent can't wipe. The token is still in clear text on disk;
❌ Patch coverage is 63.91753% with 35 lines in your changes missing coverage. Please review.
✅ Project coverage is 39.51%. Comparing base (d01065f) to head (5239fd8).
❌ Your patch check has failed because the patch coverage (63.91%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.
Add isolated file-backed ConfigStore reload and recovery tests
src/secrets/config_store.rs:18
The only ConfigStore test requests refresh_token, returning before this loading path. The rotation and recovery tests use MemoryStore, so they do not verify the production behavior promised by this PR. Please add isolated file-backed tests that read a token, edit it and observe the new value through the same ConfigStore, then verify an unreadable or invalid configuration returns an error and succeeds after repair. Avoid changing shared configuration files or process-wide environment variables in parallel tests.
Guillaume (guillaumejparis)
changed the title
feat(agent): read the token through a secret store (#1)
feat(agent): read the token through a secret store(#1)
Oct 16, 2026
The reason will be displayed to describe this comment to others. Learn more.
FIne, some cleanup and small consistency fixes. I just realised that we force-reload the settings only for the one hardcoded secret, to note for later when storing multiple kinds of secrets
Stephanya Casanova (savacano28)
changed the title
feat(agent): read the token on each request instead of keeping it in memory (#1)
feat(agent): read the token on each request instead of keeping it in memory (#000)
Nov 10, 2026
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
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.
Proposed changes
The agent now reads its token through a
SecretStoreon each request, instead of keeping a copy in each thread for the whole run. First step towards storing the token in the OS secret store (#245 and #240 build on it).Changes
SecretStoretrait andConfigStore, which reads the token from the config on each call.Clientholds the store;postanddeletereturnResultand send nothing if the token cannot be read.Authorizationheader owns aZeroizingbuffer, wiped after the request, and is marked sensitive.OpenAEV.tokenisZeroizing, and printing the settings shows<redacted>.SettingsSource(the config location only) is shared by start-up andConfigStore. Config errors are logged once, with a reason that never quotes the token.Impact
bytes,zeroize.Limitations
Testing Instructions
Build the branch and install the agent in one mode per OS. On Windows, run the NSIS installer directly, since branch builds aren't release-signed. Then check each row:
Automated:
cargo test --lockedManual (Windows Sandbox, build this branch, then run the NSIS installer directly):
openaev-agent.logfor the token → not found.Related issues
Checklist
Further comments