Skip to content

feat(auth): add D-Bus Secret Service support for Linux keyring#627

Merged
platinummonkey merged 2 commits into
DataDog:mainfrom
bharris-devoted:feat/dbus-secret-service-keyring
Jul 1, 2026
Merged

feat(auth): add D-Bus Secret Service support for Linux keyring#627
platinummonkey merged 2 commits into
DataDog:mainfrom
bharris-devoted:feat/dbus-secret-service-keyring

Conversation

@bharris-devoted

@bharris-devoted bharris-devoted commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Enables the async-secret-service feature on the keyring crate so that on Linux, pup stores OAuth tokens via the org.freedesktop.secrets D-Bus API instead of relying solely on the kernel keyutils backend.

Motivation

The D-Bus Secret Service API (org.freedesktop.secrets) provides persistent, encrypted credential storage backed by providers like GNOME Keyring, KeePassXC, or any compliant daemon. Tokens stored this way survive reboots and system updates.

With both backends enabled, the keyring crate automatically prefers Secret Service when a provider is available and falls back to kernel keyutils otherwise — no behavior change on systems without a Secret Service daemon.

Additional Notes

Three features were added to the keyring dependency:

Feature Purpose
async-secret-service Enables the D-Bus Secret Service backend
crypto-rust Uses pure-Rust crypto for D-Bus session encryption (avoids requiring OpenSSL just for the keyring transport)
vendored Statically links libdbus-sys so the binary works on systems without libdbus-1-dev installed

Binary size impact: ~2-3 MB increase from statically linked libdbus + zbus dependencies.

Tested on: Ubuntu 24.04 with a org.freedesktop.secrets daemon. Confirmed via strace that pup connects to the D-Bus session bus (/run/user/$UID/bus) and performs OpenSession + SearchItems calls. Falls back cleanly on systems without a Secret Service provider.

Checklist

  • The code change follows the project conventions (see CONTRIBUTING.md)
  • Tests have been added/updated (if applicable)
  • Documentation has been updated (if applicable)
  • All CI checks pass
  • Code coverage is maintained or improved

Related Issues

N/A — no existing issue for this. Happy to open one if preferred.

Enable the `sync-secret-service` feature on the `keyring` crate so that
on Linux, pup stores OAuth tokens via the org.freedesktop.secrets D-Bus
API (e.g. GNOME Keyring, KeePassXC, or any Secret Service provider)
instead of the kernel keyutils backend (`linux-native`).

Both backends are now enabled: the keyring crate prefers Secret Service
when a provider is available and falls back to kernel keyutils otherwise.
@bharris-devoted bharris-devoted requested a review from a team as a code owner June 30, 2026 20:43
@platinummonkey platinummonkey added enhancement New feature or request usability labels Jun 30, 2026
@datadog-datadog-prod-us1

This comment has been minimized.

@platinummonkey platinummonkey merged commit b3f918d into DataDog:main Jul 1, 2026
11 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants