amelinium.auth

added in 1.0.0

amelinium service, authentication.

check-password

(check-password password pwd-suites auth-config)(check-password password pwd-shared-suite pwd-user-suite auth-config)

Checks password for a user against an encrypted password given in password suites. Specific authentication configuration map must be given.

check-password-json

(check-password-json password json-pwd-suites auth-config)(check-password-json password json-pwd-shared-suite json-pwd-user-suite auth-config)

Checks password for a user against a JSON-encoded password suites. Specific authentication configuration map must be given.

config

(config src)(config src account-type)

Returns an authentication configuration for the given account type account-type using authentication settings source src. If the second argument is not given it will use a default account type.

config-by-type

(config-by-type settings-src account-type)

Returns authentication configuration for the given account type using an authentication configuration map.

config-by-type-with-var

(config-by-type-with-var var-name account-type)

Returns authentication configuration for the given account-type using an authentication settings map stored in a Var of the given (fully-qualified) name var-name.

confirmation-expires-default

db

(db src)(db src account-type)

Returns an authentication database connection object using the given authentication settings source src and optional account type account-type.

index-by-type

(index-by-type coll db)

Prepares static authentication preference map by mapping a copy of each authentication configuration (of type AuthConfig) to any account type identifier found within it. So, [{:account-types {:ids [:a :b]}}] becomes: {:a {:account-types {:ids [:a :b]}}, :b {:account-types {:ids [:a :b]}}.

Additionally, it sets :db from global settings and updates :account-types field to have current account type set as its default (including SQL query). Original account types data is preserved under :parent-account-types. Each authentication configuration will be initialized if it isn’t already.

init-auth

(init-auth k config)

Authentication configurator.

init-config

(init-config config)

Prepares authentication settings.

make-account-types

(make-account-types m)

make-auth

(make-auth m)(make-auth k m)

make-confirmation

(make-confirmation m)

make-locking

(make-locking m)

make-password

(make-password password auth-config)

Creates new password for a user. Specific authentication configuration map must be given.

make-password-json

(make-password-json password auth-config)

Creates new password for a user in JSON format. Specific authentication configuration map must be given.

make-passwords

(make-passwords m)

new-account-types

(new-account-types ids)(new-account-types ids default-id)

parse-account-ids

(parse-account-ids v)(parse-account-ids f v)

settings

(settings src)

Returns authentication settings for the given authentication settings source src.

settings?

(settings? v)

Returns true if the given object is an instance of AuthSettings.

setup