Liking cljdoc? Tell your friends :D

io.randomseed.utils.auth.pwd

Random Utilities, authentication, passwords handling.

Random Utilities, authentication, passwords handling.
raw docstring

*default-settings*clj

source

checkclj

(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.
sourceraw docstring

encryptclj

(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.
sourceraw docstring

expand-settingsclj

(expand-settings k config)

Returns prepared settings associated with key k.

Returns prepared settings associated with key `k`.
sourceraw docstring

find-handlerclj

(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).
sourceraw docstring

from-jsonclj

(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.
sourceraw docstring

generate-saltclj

(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`.
sourceraw docstring

human-readableclj

(human-readable pwd)

Converts binary fields in a crypto entry to string representation.

Converts binary fields in a crypto entry to string representation.
sourceraw docstring

human-readable-chainclj

source

human-readable-suiteclj

(human-readable-suite suite)

Converts every entry in suite to human-readable form.

Converts every entry in suite to human-readable form.
sourceraw docstring

initclj

(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.
sourceraw docstring

init-waitclj

(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.
sourceraw docstring

json-translationclj

source

json-write-translationclj

source

merge-suitesclj

(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.
sourceraw docstring

new-checkerclj

(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.
sourceraw docstring

new-encryptorclj

(new-encryptor settings)

Builds encryptor function returning split shared/intrinsic suites.

Builds encryptor function returning split shared/intrinsic suites.
sourceraw docstring

new-json-checkerclj

(new-json-checker settings)

Builds checker function for JSON-encoded shared and intrinsic suites.

Builds checker function for JSON-encoded shared and intrinsic suites.
sourceraw docstring

new-json-encryptorclj

(new-json-encryptor settings)

Builds encryptor function returning SuitesJSON (shared and intrinsic).

Builds encryptor function returning `SuitesJSON` (shared and intrinsic).
sourceraw docstring

post-parse-jsonclj

(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.
sourceraw docstring

pre-generate-jsonclj

(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`.
sourceraw docstring

prepare-settingsclj

(prepare-settings config)

Merges provided settings with defaults and removes empty values.

Merges provided settings with defaults and removes empty values.
sourceraw docstring

printable-suiteclj

(printable-suite suite)

Returns normalized printable handler names from a suite definition.

Returns normalized printable handler names from a suite definition.
sourceraw docstring

salt-bytesclj

(salt-bytes)
(salt-bytes size)

Generates cryptographically strong random salt bytes.

Generates cryptographically strong random salt bytes.
sourceraw docstring

salt-stringclj

(salt-string length possible-chars)

Generates random salt string of length from possible-chars.

Generates random salt string of `length` from `possible-chars`.
sourceraw docstring

sharedclj

(shared crypto-entry)

Extracts shared part of a single crypto entry.

Extracts shared part of a single crypto entry.
sourceraw docstring

shared-chainclj

source

shared-suiteclj

(shared-suite suite)

Extracts shared parts for all entries in suite.

Extracts shared parts for all entries in `suite`.
sourceraw docstring

splitclj

(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.
sourceraw docstring

split-chainclj

source

split-suiteclj

(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.
sourceraw docstring

standard-checkclj

(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.
sourceraw docstring

to-jsonclj

(to-json suite)
(to-json suite tr-map)

Converts the given suite to JSON format.

Converts the given suite to JSON format.
sourceraw docstring

waitclj

(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`.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close