Skip to content

Add token_command support for Gmail targets

Dmitry Torokhov tools 1 version Applied

Status from this message: Applied, thanks!

Get series with b4
b4 am [email protected] change-id 20261104-token-command-2e22bf5ba436

Versions newest first

  1. v1 Latest2 patches 1 replyApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/2Decouple GmailTarget from OAuth file credential managementsrc/korgalore/cli.py src/korgalore/gmail_target.py src/korgalore/google_creds.py +2 more+610 -2370 replies
2/2Add token_command support for Gmail targetsdocs/configuration.rst korgalore-example.toml man/korgalore.toml.5 +6 more+404 -220 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH kgl 0/2] Add token_command support for Gmail targets

This series adds support for obtaining Gmail OAuth2 bearer tokens from an external command via a new token_command setting on Gmail targets (similar to passwordeval in msmtp or PassCmd in mbsync). This lets korgalore share an encrypted credential store or OAuth2 token helper (such as oama, git-credential helpers, or custom keyring/GPG scripts) with other mail tools without managing separate Google OAuth client secrets, running another browser login flow, or keeping an unencrypted token JSON file on disk.

Patch 1 extracts file-based OAuth credential management out of GmailTarget into a dedicated google_creds module so GmailTarget accepts any google.auth Credentials provider. Patch 2 adds the command-backed credential provider, wires up token_command, verifies Gmail access during kgl auth, and documents the new option.

---
Dmitry Torokhov (2):
Decouple GmailTarget from OAuth file credential management Add token_command support for Gmail targets

 docs/configuration.rst        |  10 +-
 korgalore-example.toml        |   2 +
 man/korgalore.toml.5          |  12 +-
 src/korgalore/cli.py          |  35 +++--
 src/korgalore/gmail_target.py | 225 ++++++++++++++--------------
 src/korgalore/google_creds.py | 336 ++++++++++++++++++++++++++++++++++++++++++
 tests/test_cli_misc.py        | 103 ++++++++++++-
 tests/test_gmail_target.py    | 254 +++++++++++++++++--------------
 tests/test_google_creds.py    | 262 ++++++++++++++++++++++++++++++++
 9 files changed, 997 insertions(+), 242 deletions(-)

---
base-commit: ea22e7c8701e566328f197c748718cd689f9ea28
change-id: 20261104-token-command-2e22bf5ba436

Thanks.

Signature · 1 line
Dmitry