03.
— Section 3
Credentials
macOS Keychain
आपका पासवर्ड कभी डिस्क को नहीं छूता।
jmapcli कोई भी रहस्य डिस्क पर नहीं रखता। आपका पासवर्ड (या bearer token) macOS लॉगिन Keychain में रहता है; account फ़ाइल — ~/.config/jmapcli/config.json, mode 0600 — केवल सर्वर URL, आपका username और एक default flag रखती है। terminal से Keychain पर नए हैं? पूरा workflow तीन built-in security commands से होता है।
1 · एक secret store करें — और उसे वापस पढ़ें। macOS value के लिए prompt करता है, इसलिए secret कभी command line पर type नहीं होता, स्क्रीन पर नहीं दिखता, और न ही आपकी shell history में लिखा जाता है।
# store it — you’re prompted for the secret, nothing echoes
$ security add-generic-password -U -s jmap-password -a you@example.com -l "Boogie JMAP password" -w
# read it back at any time
$ security find-generic-password -s jmap-password -a you@example.com -w
# remove it
$ security delete-generic-password -s jmap-password -a you@example.com
- -s
- service — वह नाम जिसे jmapcli देखता है: पासवर्ड के लिए jmap-password, या bearer token के लिए jmap-token (जैसे Fastmail); केवल वही set करें जो आप उपयोग करते हैं।
- -a
- account — आपका email पता (वही username जो आप jmapcli को देते हैं)।
- -l
- label — जो आप Keychain Access app में देखेंगे; -U किसी मौजूदा item को उसी स्थान पर update करता है।
- -w
- बिना किसी value के — secret के लिए prompt करें। यही वह हिस्सा है जो इसे ~/.zsh_history और process list से दूर रखता है।
2 · jmapcli को अपने सर्वर की ओर इंगित करें। account को एक बार register करें; secret सीधे उस Keychain item से लिया जाता है जो आपने अभी store की, इसलिए यह कभी command line पर नहीं आता।
$ jmapcli login --url https://mail.example.com --username you@example.com \
--password "$(security find-generic-password -s jmap-password -a you@example.com -w)"
# token auth: swap --password for --token (and store under jmap-token above)
$ jmapcli list # from here on, every command reads the Keychain for you
3.1
आपकी history, logs — या किसी AI’s context में कुछ नहीं
एक बार secret Keychain में आ जाए, तो रोज़मर्रा के commands (list, send, draft, sync) कभी पासवर्ड नहीं ले जाते, इसलिए इसे ~/.zsh_history, process listing या CI logs में capture नहीं किया जा सकता। यही jmapcli को terminal-AI tools से चलाने के लिए सुरक्षित बनाता है — एक agent को JMAP client मिलता है, आपका secret कभी नहीं।
— zsh
CI · agents
3.2
Rotate करें या साइन आउट करें
पासवर्ड बदल दिया? security add-generic-password … -w line फिर से चलाएं — -U इसे उसी स्थान पर overwrite करता है। किसी account को हटाने के लिए, jmapcli logout एक ही step में config entry और Keychain secret दोनों को delete करता है (--all हर account को clear करता है)।
— rotate
logout
3.3
डिज़ाइन के अनुसार प्रत्येक Mac के लिए अलग
लॉगिन Keychain iCloud के ज़रिए sync नहीं होता — यह एक जानबूझकर की गई सीमा है, ताकि आपका पासवर्ड उस Mac को कभी न छोड़े जिस पर आपने इसे type किया। security step को प्रत्येक Mac पर एक बार दोहराएं; config.json एक synced home folder पर रह सकता है क्योंकि इसमें कोई secret नहीं होता।
— per
machine