🔐 feat: Add token export/import for ephemeral environments

- Add token CLI subcommand with export/import operations
- Enable OAuth2 token persistence across clean environments
- Support for containers, CI/CD, and ephemeral compute workflows
- Compress tokens with gzip and encode as base64 for env vars
- Automatic token restoration from CULL_GMAIL_TOKEN_CACHE
- Secure file permissions (600) on restored tokens
- Add comprehensive error handling for token operations
- Update dependencies: base64, flate2, serde_json

This feature enables cull-gmail to run in ephemeral environments
like Docker containers and CI/CD pipelines without re-authentication
by exporting tokens once and restoring them via environment variables.
This commit is contained in:
Jeremiah Russell
2025-10-21 07:31:45 +01:00
committed by Jeremiah Russell
parent 6334ba6c13
commit 2bee42d7ba
5 changed files with 606 additions and 0 deletions

View File

@@ -37,6 +37,8 @@ serde_json = "1.0.145"
thiserror = "2.0.17"
tokio = { version = "1.47.1", features = ["macros", "rt-multi-thread", "process"] }
toml = "0.9.7"
base64 = "0.22"
flate2 = "1.0"
[dev-dependencies]
httpmock = "0.8"