diff options
| author | Craig Jennings <c@cjennings.net> | 2026-05-22 19:32:32 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-05-22 19:32:32 -0500 |
| commit | 7278111f29d961c3c1378a7159240cb1704e1543 (patch) | |
| tree | 15c403680dfd00aa4af552b30d8edb245ff21786 /modules/selection-framework.el | |
| parent | 3371d763b674a8c7b303c4f5192a421cc66fb18c (diff) | |
| download | dotemacs-7278111f29d961c3c1378a7159240cb1704e1543.tar.gz dotemacs-7278111f29d961c3c1378a7159240cb1704e1543.zip | |
refactor(auth): consolidate the auth-source secret lookup into one helper
The auth-source-search + funcall-the-secret block was copied four times: calendar-sync--calendar-url, cj/auth-source-secret (ai-config), cj/--auth-source-password (transcription), and cj/slack--get-credential. Each searched authinfo, pulled :secret, and called it when the netrc backend returned a function.
I pulled that into cj/auth-source-secret-value in system-lib (a leaf, so calendar-sync doesn't have to depend on ai-config and drag in the gptel stack). It takes an optional user and returns the secret or nil. The four callers now delegate to it: ai-config layers its required-secret error on top, and the others keep their nil-on-miss behavior. With the direct auth-source-search calls gone, I dropped the now-unused (require 'auth-source) from transcription, slack, and calendar-sync. The helper's autoload covers it.
The transcription tests that exercise the delegated path stay green, and the primitive and the error wrapper get their own tests.
Diffstat (limited to 'modules/selection-framework.el')
0 files changed, 0 insertions, 0 deletions
