(composite catalogs)Try multiple catalogs in order; return the first non-nil user-id.
Try multiple catalogs in order; return the first non-nil user-id.
(edn-file-catalog path)EDN-backed catalog.
File format: a vector of maps [{:hashed "..." :user-id "alice"} ...]. Note: reloads the file on each call; intended for low traffic and small catalogs.
EDN-backed catalog.
File format: a vector of maps [{:hashed "..." :user-id "alice"} ...].
Note: reloads the file on each call; intended for low traffic and small catalogs.(fn-catalog f)Wrap an arbitrary (fn [token] -> user-id|nil).
Wrap an arbitrary (fn [token] -> user-id|nil).
(hashed-map-catalog hashed->user-id)Catalog backed by an in-memory map keyed by hashed tokens.
Provide {<hash> -> <user-id>} where <hash> matches (k/hash-token token). This avoids storing raw tokens in memory.
Tokens must be high-entropy (random), not user-chosen.
Catalog backed by an in-memory map keyed by hashed tokens.
Provide {<hash> -> <user-id>} where <hash> matches (k/hash-token token).
This avoids storing raw tokens in memory.
Tokens must be high-entropy (random), not user-chosen.(plain-map-catalog token->user-id)Catalog backed by an in-memory map keyed by raw tokens (useful in tests).
Provide {<raw-token> -> <user-id>}.
Catalog backed by an in-memory map keyed by raw tokens (useful in tests).
Provide {<raw-token> -> <user-id>}.(lookup-user-id this token)Return user-id (string/keyword) if bearer token is valid, else nil.
Return user-id (string/keyword) if bearer token is valid, else nil.
(valid-token? catalog token)Return true if token is valid in catalog, else false.
Return true if token is valid in catalog, else false.
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 |