import imap: Gmail as a Workspace service account (--google-key) #45

Merged
jcoffey-dev merged 1 commits from feat/google-service-account into main 2026-10-30 21:43:13 +00:00
1 Commits
Author SHA1 Message Date
jcoffey-dev b6dfeb21e0 import imap: Gmail as a Workspace service account (--google-key)
ci / test (pull_request) Skipped
github/ci (branch) GitHub Actions
ci / github (pull_request) Successful in 3m52s
ci / announce (pull_request) Skipped
A Google Workspace service account with domain-wide delegation acts for
the user --auth-user names: a JWT naming the user, signed RS256 with the
account's key through rustls' aws-lc-rs signer, is exchanged for an
access token (RFC 7523), which signs in with XOAUTH2. Each connection
takes the cached token, or a new one when it has under five minutes
left, so long runs renew on reconnect. A whole domain moves in a plan
with one key file and --auth-user {email}.

The mock test makes an RSA key, checks the assertion's signature and
claims at a fake token endpoint, and the XOAUTH2 payload at a fake IMAP
server. aws-lc-rs is a dev-dependency only, already in the tree for
rustls.
2026-10-30 14:38:56 -07:00