Skip to content

feat: retrieve WiFi/VPN secrets from D-Bus Secret Service with unlock support - #2402

Merged
bbedward merged 2 commits into
duxlabs-dev:masterfrom
Mikilio:master
May 13, 2026
Merged

bbedward merged 2 commits into
duxlabs-dev:masterfrom
Mikilio:master

Conversation

@Mikilio

@Mikilio Mikilio commented May 12, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Saved WiFi/VPN passwords in the keyring were never consulted — the app always prompted the user to re-enter them, even when GNOME Keyring had the correct secret.

Changes

  • Secret Service client (secret_service.go): connects to org.freedesktop.Secret, searches items by connection UUID, and if locked triggers the system unlock dialog via Prompt.Prompt() before retrieving the secret
  • Agent integration (agent_networkmanager.go): Phase 4 tries the keyring before showing the app's password prompt, skips cached VPN creds when REQUEST_NEW is set, guards cancellation against deleting pre-existing connection profiles
  • QR code fallback (backend_networkmanager_wifi.go): reads PSK from secret service when conn.GetSecrets returns access-denied

Current state

Working. Keyring unlock dialog appears when needed, secrets are retrieved afterward, and the app prompt is bypassed.

Testing

Manual with locked/unlocked GNOME Keyring. Unit tests for ONLY_SYSTEM/NO_INTERACTION flags. Build & vet clean.

Review

Should more Unit tests be required to secure the correct behavior of this? Should the Architecture be improved by generalizing the Secret Service helper?

This may fix #899 #1520

I ask for a thorough review to deal with the above questions.

…vation

When a pre-existing WiFi connection activation is cancelled, do not
remove the connection profile — only remove profiles for newly created
connections.
Wireless, 802.1x, VPN, and WireGuard secrets are now looked up from
org.freedesktop.Secret before prompting the user. If the keyring is
locked, the unlock prompt is triggered via Prompt.Prompt() and the
lookup retried after the vault is unlocked.
@Mikilio

Mikilio commented May 12, 2026

Copy link
Copy Markdown
Contributor Author

I restructured the function. Sorry if the code style is weird. I am new to go and don't have much of an own opinion on stuff yet when it comes to language features. But I think that is a cleaner way to do it.

@Mikilio
Mikilio requested a review from bbedward May 12, 2026 15:11
@domenkozar

Copy link
Copy Markdown
Contributor

I've checked and it doesn't fix #2358, because it never reached the point of asking for credentials in the first place.

@Mikilio

Mikilio commented May 13, 2026

Copy link
Copy Markdown
Contributor Author

@domenkozar That's unfortunate. It seems it was unrelated. The good news is that I already have a fix locally that I am going to submit once this gets merged. It also includes some mocked tests, but I don't actually have a eap network to connect to for a real integration test. I'd appreciate it if you could test that one.

@bbedward

Copy link
Copy Markdown
Member

802.11x I haven't been able to figure out the workflow since I dont have a way to run an 802.11x AP, but the GUI and things are mostly there once it does get figured out.

@bbedward
bbedward merged commit 0dfa95f into duxlabs-dev:master May 13, 2026
2 checks passed
@domenkozar

Copy link
Copy Markdown
Contributor

802.11x I haven't been able to figure out the workflow since I dont have a way to run an 802.11x AP, but the GUI and things are mostly there once it does get figured out.

I'll give it a shot using claude code

fishman pushed a commit to fishman/DankMaterialShell that referenced this pull request Jul 15, 2026
… support (duxlabs-dev#2402)

* fix: preserve pre-existing connection profiles on cancelled WiFi activation

When a pre-existing WiFi connection activation is cancelled, do not
remove the connection profile — only remove profiles for newly created
connections.

* feat: retrieve WiFi/VPN secrets from D-Bus secret service with unlock

Wireless, 802.1x, VPN, and WireGuard secrets are now looked up from
org.freedesktop.Secret before prompting the user. If the keyring is
locked, the unlock prompt is triggered via Prompt.Prompt() and the
lookup retried after the vault is unlocked.
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.

wifi not reconnecting on boot

3 participants