Random Utilities, authentication, passwords handling.
Random Utilities, authentication, passwords handling.
(check plain user-suite user-settings)(check plain settings shared-suite intrinsic-suite & other-suites)Checks if the given plain text password is correct by comparing it with the result of calling all checkers in the given encryption suite with memorized options applied.
Checks if the given plain text password is correct by comparing it with the result of calling all checkers in the given encryption suite with memorized options applied.
(encrypt plain local-settings)Encrypts the given plain text password using all encryption functions in the given encryption suite.
Encrypts the given plain text password using all encryption functions in the given encryption suite.
(expand-settings k config)Returns prepared settings associated with key k.
Returns prepared settings associated with key `k`.
(find-handler password-or-cipher)Tries to get an encryption handler from an entry map by accessing :handler key or using :handler-id as fallback (and dereferencing it).
Tries to get an encryption handler from an entry map by accessing :handler key or using :handler-id as fallback (and dereferencing it).
(from-json suite)(from-json suite tr-map)Converts JSON data to suite by applying transformations to keys described by tr-map. If no map is given the json-translation is used.
Converts JSON data to suite by applying transformations to keys described by tr-map. If no map is given the json-translation is used.
(generate-salt length possible-chars prefix suffix)Builds salt bytes from random core with optional prefix and suffix.
Builds salt bytes from random core with optional `prefix` and `suffix`.
(human-readable pwd)Converts binary fields in a crypto entry to string representation.
Converts binary fields in a crypto entry to string representation.
(human-readable-suite suite)Converts every entry in suite to human-readable form.
Converts every entry in suite to human-readable form.
(init k config)(init k config log-fn)Initializes password settings from auth config and optional logger.
Initializes password settings from auth config and optional logger.
(init-wait
{:keys [wait-nouser] pwait :wait [wmin wmax] :wait-random :as config})Initializes wait function and derived wait configuration values.
Initializes wait function and derived wait configuration values.
(merge-suites crypto-suites-dual)(merge-suites defaults-crypto-suite user-crypto-suite & more)Merges shared and intrinsic suite chains entry-wise.
Accepts either a Suites value or explicit suite chains.
Merges shared and intrinsic suite chains entry-wise. Accepts either a `Suites` value or explicit suite chains.
(new-checker settings)Builds checker function for split suites or separate shared/intrinsic chains.
Builds checker function for split suites or separate shared/intrinsic chains.
(new-encryptor settings)Builds encryptor function returning split shared/intrinsic suites.
Builds encryptor function returning split shared/intrinsic suites.
(new-json-checker settings)Builds checker function for JSON-encoded shared and intrinsic suites.
Builds checker function for JSON-encoded shared and intrinsic suites.
(new-json-encryptor settings)Builds encryptor function returning SuitesJSON (shared and intrinsic).
Builds encryptor function returning `SuitesJSON` (shared and intrinsic).
(post-parse-json tr-map m)Post-parses JSON data by transforming certain values with the given translation map.
Post-parses JSON data by transforming certain values with the given translation map.
(pre-generate-json tr-map m)Prepares suite entry for JSON serialization using translation map tr-map.
Prepares suite entry for JSON serialization using translation map `tr-map`.
(prepare-settings config)Merges provided settings with defaults and removes empty values.
Merges provided settings with defaults and removes empty values.
(printable-suite suite)Returns normalized printable handler names from a suite definition.
Returns normalized printable handler names from a suite definition.
(salt-bytes)(salt-bytes size)Generates cryptographically strong random salt bytes.
Generates cryptographically strong random salt bytes.
(salt-string length possible-chars)Generates random salt string of length from possible-chars.
Generates random salt string of `length` from `possible-chars`.
(shared crypto-entry)Extracts shared part of a single crypto entry.
Extracts shared part of a single crypto entry.
(shared-suite suite)Extracts shared parts for all entries in suite.
Extracts shared parts for all entries in `suite`.
(split crypto-entry)Splits a cipher entry or a password into two parts and returns a Suite record with
two fields :shared and :intrinsic with these parts.
Splits a cipher entry or a password into two parts and returns a Suite record with two fields `:shared` and `:intrinsic` with these parts.
(split-suite suite)Splits all entries in suite into Suites with shared/intrinsic chains.
Splits all entries in suite into `Suites` with shared/intrinsic chains.
(standard-check encrypt-fn plain opts-or-enc settings)(standard-check encrypt-fn plain encrypted salt settings)(standard-check encrypt-fn plain opts encrypted salt settings)Performs a standard authentication check based on the provided plain text password given as the second argument). The first argument should be an encryption function used to perform the encryption operation on the provided password and compare the result with the encrypted password that should be provided as third argument or as a value associated with the :password key if this argument is a map. The last argument should be settings map that will be passed to the encryption function.
This is a low-level function that is intended to be used by different authentication modules which are implementing pretty standard way of checking the password.
Performs a standard authentication check based on the provided plain text password given as the second argument). The first argument should be an encryption function used to perform the encryption operation on the provided password and compare the result with the encrypted password that should be provided as third argument or as a value associated with the :password key if this argument is a map. The last argument should be settings map that will be passed to the encryption function. This is a low-level function that is intended to be used by different authentication modules which are implementing pretty standard way of checking the password.
(to-json suite)(to-json suite tr-map)Converts the given suite to JSON format.
Converts the given suite to JSON format.
(wait wait-start wait-randmax)Sleeps for wait-start seconds plus random delay up to wait-randmax.
Sleeps for `wait-start` seconds plus random delay up to `wait-randmax`.
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 |