Skip to content

fix: support desktop-selected Secret Service providers - #6

Open
UglyEgg wants to merge 1 commit into
ProtonVPN:stablefrom
UglyEgg:contrib/provider-agnostic-secret-service
Open

UglyEgg wants to merge 1 commit into
ProtonVPN:stablefrom
UglyEgg:contrib/provider-agnostic-secret-service

Conversation

@UglyEgg

@UglyEgg UglyEgg commented Sep 13, 2026

Copy link
Copy Markdown

Problem

The package requires GNOME Keyring even though its runtime interface is the Freedesktop Secret Service API. That prevents desktop-selected providers from being treated as first-class implementations.

The current availability check also performs a real keyring operation. This can require a usable default collection, create one as a side effect, or prompt before the client actually needs a secret. Python Keyring opens a fresh Secret Service connection for each operation, so providers that authorize clients by D-Bus identity may prompt repeatedly.

Change

  • Make GNOME Keyring a packaging suggestion rather than a hard Debian or RPM dependency.
  • Validate Secret Service availability without reading or creating a secret.
  • Prefer the Freedesktop default alias; if it is missing or stale, use the sole advertised collection, create a default only when no collection exists, and reject ambiguous multi-collection fallback.
  • Reuse one serialized D-Bus connection for the backend lifetime so provider authorization can persist across operations. The backend does not cache plaintext and closes the connection explicitly or through a finalizer.

GNOME Keyring, KeePassXC, KWallet, and other conforming Secret Service implementations use the same code path. No provider-specific logic or secret-storage schema change is introduced.

Verification

  • 10 focused tests cover non-invasive validation, default/sole/empty/ambiguous collection selection, connection reuse, explicit close/reopen, credential reads, writes, and deletion.
  • Complete upstream suite: 31 passed.
  • ruff check, Python bytecode compilation, and git diff --check pass.
  • The equivalent downstream overlay has been exercised on Fedora 44 Plasma with KeePassXC as org.freedesktop.secrets, including cold start, login, sign-out/sign-in, reconnect, and one authorization prompt per client start.

Closes #3.

Development disclosure: I developed this patch with material assistance from OpenAI Codex under my direction, then reviewed, tested, and signed the final change.

Treat org.freedesktop.secrets as the runtime contract instead of requiring GNOME Keyring. Avoid validation-time secret access, resolve a missing default alias conservatively, and reuse one serialized D-Bus connection so provider authorization can persist across operations.

Keep GNOME Keyring as a packaging suggestion and cover validation, collection selection, and connection lifetime with focused tests.

Development disclosure: I developed this patch with material assistance from OpenAI Codex under my direction, then reviewed, tested, and signed the final change.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deb packaging: please don't require gnome-keyring package

1 participant