Skip to content

fix: Linux Chrome cookie extraction (libsecret default keyring) - #40

Draft
MabezDev wants to merge 1 commit into
drogers0:mainfrom
MabezDev:fix/linux-chrome-cookie-keyring
Draft

fix: Linux Chrome cookie extraction (libsecret default keyring)#40
MabezDev wants to merge 1 commit into
drogers0:mainfrom
MabezDev:fix/linux-chrome-cookie-keyring

Conversation

@MabezDev

Copy link
Copy Markdown

Summary

Linux Chrome cookie extraction was broken on non-KDE desktops (e.g. Hyprland + gnome-keyring): kooky only searched the Secret Service login collection, while Chrome Safe Storage lives in the default keyring. That produced kwallet: password not found even when secret-tool could read the secret, so gh image required GH_SESSION_TOKEN.

Changes

  1. Temporary replace of github.com/browserutils/kookyMabezDev/kooky@3e00ef3 from browserutils/kooky#116. Drop the replace and bump to a released kooky version once that PR merges.
  2. Clearer error hints when keyring lookup fails (keyring password retrieval failed / secret not found in keyring).
  3. README note: prefer native keyring-backed browser cookies for interactive use; do not hand user_session / GH_SESSION_TOKEN to unattended agents.

Verified on this machine (2026-07-28)

  • Chrome cookies at ~/.config/google-chrome/Default/Cookies (meta v24, v11 ciphertext)
  • secret-tool lookup xdg:schema chrome_libsecret_os_crypt_password_v2 works
  • After this change (no GH_SESSION_TOKEN):
    • gh image check-tokenToken is valid (source: browser cookies) / username
    • gh image --repo <writable-repo> test.png![...](https://github.com/user-attachments/assets/...)

Test plan

  • go test ./...
  • Local Linux+Chrome: check-token and image upload without env token
  • CI on this PR
  • After kooky#116 merges: drop replace, bump require, re-verify

Point kooky at a temporary replace of browserutils/kooky#116 so Linux
Chrome can read Chrome Safe Storage from the default libsecret keyring
(not only the login collection). That unblocks extract-token/check-token
and uploads without GH_SESSION_TOKEN when the user is logged into GitHub
in Chrome.

Also add clear error hints when keyring lookup fails, and a short README
note that interactive Linux use should prefer the native keyring path
over injecting session cookies into agent environments.

Drop the replace and bump to a released kooky version once
browserutils/kooky#116 lands.
Copilot AI review requested due to automatic review settings July 28, 2026 12:51

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@MabezDev
MabezDev marked this pull request as draft July 28, 2026 12:52
@drogers0 drogers0 added the upstream Caused by a limitation in an upstream dependency (kooky, sqlite3) label Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

upstream Caused by a limitation in an upstream dependency (kooky, sqlite3)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants