From 76b7a15d7eaeaff81874d922d5ce2b0090eb7c98 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Wed, 5 Nov 2025 00:53:52 -0600 Subject: fix: Resolve Google Calendar password prompts every 10 minutes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Problem: oauth2-auto.plist passphrase requested every ~10 minutes during gcal-sync auto-sync, interrupting workflow despite 400-day gpg-agent cache. Root cause: auth-config.el was setting GPG_AGENT_INFO to nil, telling Emacs to ignore gpg-agent entirely. Additionally, plstore caching was loading too late in org-gcal-config. Solution: - Disabled GPG_AGENT_INFO override to allow gpg-agent usage - Added auth-source-cache-expiry (24-hour cache for credentials) - Moved plstore configuration from org-gcal-config to auth-config - Enabled plstore-cache-passphrase-for-symmetric-encryption globally - Set plstore-encrypt-to nil for symmetric encryption Files modified: - modules/auth-config.el: Added plstore config, removed agent bypass - modules/org-gcal-config.el: Removed duplicate plstore config - docs/NOTES.org: Session notes documenting fix Testing: Restart Emacs and verify no password prompts for 30+ minutes. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- modules/auth-config.el | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'modules/auth-config.el') diff --git a/modules/auth-config.el b/modules/auth-config.el index 6b8a8ddb..8376a2c0 100644 --- a/modules/auth-config.el +++ b/modules/auth-config.el @@ -24,9 +24,11 @@ :ensure nil ;; built in :demand t ;; load this package immediately :config - (setenv "GPG_AGENT_INFO" nil) ;; disassociate with external gpg agent - (setq auth-sources `(,authinfo-file)) ;; use authinfo.gpg (see user-constants.el) - (setq auth-source-debug t)) ;; echo debug info to Messages + ;; USE gpg-agent for passphrase caching (400-day cache from gpg-agent.conf) + ;; (setenv "GPG_AGENT_INFO" nil) ;; DISABLED: was preventing gpg-agent cache + (setq auth-sources `(,authinfo-file)) ;; use authinfo.gpg (see user-constants.el) + (setq auth-source-debug t) ;; echo debug info to Messages + (setq auth-source-cache-expiry 86400)) ;; cache decrypted credentials for 24 hours ;; ----------------------------- Easy PG Assistant ----------------------------- ;; Key management, cryptographic operations on regions and files, dired @@ -40,5 +42,18 @@ ;; (setq epa-pinentry-mode 'loopback) ;; emacs request passwords in minibuffer (setq epg-gpg-program "gpg2")) ;; force use gpg2 (not gpg v.1) +;; ---------------------------------- Plstore ---------------------------------- +;; Encrypted storage used by oauth2-auto for Google Calendar tokens. +;; CRITICAL: Enable passphrase caching to prevent password prompts every 10 min. + +(use-package plstore + :ensure nil ;; built-in + :demand t + :config + ;; Cache passphrase indefinitely (relies on gpg-agent for actual caching) + (setq plstore-cache-passphrase-for-symmetric-encryption t) + ;; Allow gpg-agent to cache the passphrase (400 days per gpg-agent.conf) + (setq plstore-encrypt-to nil)) ;; Use symmetric encryption, not key-based + (provide 'auth-config) ;;; auth-config.el ends here. -- cgit v1.2.3