A licence gate as a plain function of a mount spec.
Returns nil to permit and a DenyReason keyword to refuse, which is the contract hive-addon's mounter consumes. Neither library depends on the other: the gate is an ordinary fn, so the coupling is a calling convention rather than a classpath edge.
A licence gate as a plain function of a mount spec. Returns nil to permit and a DenyReason keyword to refuse, which is the contract hive-addon's mounter consumes. Neither library depends on the other: the gate is an ordinary fn, so the coupling is a calling convention rather than a classpath edge.
(gate {:keys [signed now-fn node-id unit-fn]
:or {now-fn now-iso unit-fn :addon/entitlement}})Build (fn [spec] -> nil | DenyReason) from a licence source.
opts: :signed a SignedLicense, or a 0-arg fn returning one. A fn is read on every call, so a renewed licence takes effect without a restart. :now-fn (fn [] -> ISO instant string) default: this host's clock :node-id this host's identity, or nil default: nil :unit-fn (fn [spec] -> entitlement unit) default: :addon/entitlement
A licence source that throws is a refusal (:deny/malformed), so a missing or unreadable licence file cannot mount an addon by accident.
Build (fn [spec] -> nil | DenyReason) from a licence source.
opts:
:signed a SignedLicense, or a 0-arg fn returning one. A fn is read on
every call, so a renewed licence takes effect without a restart.
:now-fn (fn [] -> ISO instant string) default: this host's clock
:node-id this host's identity, or nil default: nil
:unit-fn (fn [spec] -> entitlement unit) default: :addon/entitlement
A licence source that throws is a refusal (:deny/malformed), so a missing
or unreadable licence file cannot mount an addon by accident.(now-iso)This host's clock as an ISO-8601 instant string.
This host's clock as an ISO-8601 instant string.
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 |