Repository navigation
Conversation
A plugin started by the graphical session inherits the user manager's environment and never an interactive shell's exports, so a key exported in ~/.bashrc never reaches an adapter. The OpenRouter, GLM / Z.ai and OpenCode Go adapters can now read the key from the keyring at the moment of use. The environment carries only a lookup spec, AIOC_VAULT_OPENROUTER and its siblings, which names the secret-tool attributes. The spec is not a secret, so it can live in a display manager or user-service environment file, and the key never enters a process environment, a child process, a cache or a log. An exported key still wins, and AIOC_VAULT_TIMEOUT bounds the lookup so a locked keyring cannot stall a refresh. Readiness accepts a spec without performing a lookup, so the settings page cannot raise a prompt. The test covers the key reaching curl, exported-key precedence, the bound, a missing secret-tool, and readiness without a lookup. Signed-off-by: Álvaro Tejero Cantero <[email protected]>
alvorithm
force-pushed
the
feat/keyring-credentials
branch
from
November 8, 2026 11:17
80ce0ff to
61ed714
Compare
bernardopg
marked this pull request as ready for review
November 8, 2026 18:17
7 of 10 tasks
Owner
|
Thank you @alvorithm, the keyring route is a real fix for systemd-started shells, and the opt-in spec design (no secret in the environment, readiness without a lookup) was already right. I carried it forward as #105 (stacked on #104). Your commit is kept with you as its author, and one follow-up commit addresses what came up in review:
I checked it against a real Secret Service with a throwaway entry. The CHANGELOG |
Owner
|
Merged as part of #105 with your commit and authorship intact, plus the follow-up described above. Thank you again @alvorithm! |
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.
Dux Shell runs as a systemd user service, so it inherits the user manager's environment and never an interactive shell's exports. A key exported in
~/.bashrctherefore never reaches an adapter, and the settings page already says so: "a key exported only by an interactive shell is invisible when Dux Shell was started by the graphical session". The documented workaround issystemctl --user import-environment, which puts the key in every unit of the session rather than one process.The adapters already read a credential from a keyring where one exists:
providers/native/antigravity.bashcallssecret-tool, and docs/security.md already lists the keyring as a credential source. This PR extends that route to the API-key providers.This PR:
providers/vault-common, which reads a key from the freedesktop keyring at the moment of use from an opt-in lookup spec,AIOC_VAULT_OPENROUTERand its siblings (feat(providers): read provider keys)auth.jsonthat holds no key fall through to the keyring (feat(providers): read provider keys)Verifications
scripts/check-metadata,scripts/check-changelog --base origin/main,scripts/check-dco origin/main,bash -nover every provider file, and the offline fixture suites pass, including the newtests/test-vault-keys.shand the existingtest-openrouter.sh,test-secret-argv.sh,test-native-adapters.sh,test-opencode.shand thetest-cov-c2-*adapter suites. The new test covers the keyring key reachingcurl, exported-key precedence, a readableauth.jsonwith no key falling through to the keyring, the bounded lookup, a missingsecret-tool, and readiness without a lookup.Shell lint ran with shellcheck 0.10.0. It reports no new findings on the changed files; it reports four pre-existing
SC2034findings inproviders/get-provider-usagethat an unmodifiedmainproduces at the same version.Not verified: statement coverage, because
kcovis not installed in this checkout. No QML changed, soqmllintwas not run.How to use
Store the key in the keyring and put the lookup spec in the environment the shell sees, for example
~/.config/environment.d/90-dms.conf, then restart the shell:The words are the attribute/value pairs
secret-tool lookuptakes, matching however the entry was stored, for examplesecret-tool store --label=OpenRouter service openrouter username quota. The spec is not a secret, so it can live in any environment file. A setup that exports the key is unchanged: the environment wins and no lookup runs.AIOC_VAULT_TIMEOUT(default 3 s) bounds the lookup, so a locked keyring delays one refresh instead of blocking it.Out of scope
glm,deepseek,mistraland the rest). The helper is provider-agnostic, so each is a one-line fallback.Authorizationheaders fromcurl's command line to--config, which docs/security.md already lists on the roadmap.