The ONE reader of a push credential out of the macOS login keychain.
Both push transports keep their signing secret there rather than in a file on
disk: APNs its ES256 .p8 (service vis-apns), FCM its Google service-account
JSON (service vis-fcm). The secret never sits in a world-readable file.
Each answer is held in memory for CACHE_TTL_MS before security is asked
again. It used to be read on demand and never cached, so locking the keychain
revoked access immediately - but push/config asks for five secrets, and it
runs inside capabilities, a request every connected client makes: a JFR
profile of a live gateway caught the daemon forking security at a steady
rate, ~21 ms of wall and ~10 ms of CPU a fork, to re-read five values that
change only when a human edits the keychain. Locking the keychain now revokes
access within the TTL rather than instantly; an unlocked-again keychain is
likewise noticed within it.
nil anywhere but macOS, and nil while vis.push.home is set: a redirected push
home means a test fixture, and the developer's real keychain must never leak
into it.
The ONE reader of a push credential out of the macOS login keychain. Both push transports keep their signing secret there rather than in a file on disk: APNs its ES256 `.p8` (service `vis-apns`), FCM its Google service-account JSON (service `vis-fcm`). The secret never sits in a world-readable file. Each answer is held in memory for `CACHE_TTL_MS` before `security` is asked again. It used to be read on demand and never cached, so locking the keychain revoked access immediately - but `push/config` asks for five secrets, and it runs inside `capabilities`, a request every connected client makes: a JFR profile of a live gateway caught the daemon forking `security` at a steady rate, ~21 ms of wall and ~10 ms of CPU a fork, to re-read five values that change only when a human edits the keychain. Locking the keychain now revokes access within the TTL rather than instantly; an unlocked-again keychain is likewise noticed within it. nil anywhere but macOS, and nil while `vis.push.home` is set: a redirected push home means a test fixture, and the developer's real keychain must never leak into it.
(reset-cache!)Forget every cached answer, so the next read asks security again. For tests
and for the moment a credential is written.
Forget every cached answer, so the next read asks `security` again. For tests and for the moment a credential is written.
(secret service account)The generic password stored under service / account, or nil when there is
none to read here. One security fork per CACHE_TTL_MS per key.
The generic password stored under `service` / `account`, or nil when there is none to read here. One `security` fork per `CACHE_TTL_MS` per key.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |