Liking cljdoc? Tell your friends :D

altcha-clj.verify


assoc-if-someclj/s

(assoc-if-some m)
(assoc-if-some m k v)
(assoc-if-some m k v & kvs)

Conditionally adds a key k to value v pairs to map m. If no args are present or v is nil, returns m. If passed a variadic argument of arbitrary number of kvs key-value pairs, adds each of them that is not nil to m

Conditionally adds a key `k` to value `v` pairs 
to map `m`. If no args are present or `v` is nil, returns `m`.
If passed a variadic argument of arbitrary number of `kvs` 
key-value pairs, adds each of them that is not nil to `m`
sourceraw docstring

check-solutionclj/s

(check-solution payload
                hmac-key
                check-expiration?
                &
                {:keys [max-number reference-time throw-on-false?]})

Verifies the solution received from the client, returning an explicit true or a falsy nil Params:

  • payload: the map of the following keys received from the client. Note that usually you'll get the solution encoded in base-64
    • algorithm
    • challenge - the solved challenge value
    • number - the random number generated previously
    • salt
    • signature
  • hmac-key - the HMAC key used for verification.
  • check-expiration? - whether to check if the challenge has not expired. Recommended to be kept as true

Keys:

  • max-number - optional max-number override. If you're facing issues with false negatives, try adding your value to this function's args
  • reference-time - reference timestamp to compare as the timestamp which must be greater than the challenge's created-at value
  • throw-on-false? - whether to throw an error if the result is false. The result will be an ex-message with params, payload, not-expired? and expected-challenge
Verifies the solution received from the client, returning
an explicit `true` or a falsy `nil`
Params:
- `payload`: the map of the following keys received from the client.
Note that usually you'll get the solution encoded in base-64
  - `algorithm`
  - `challenge` - the solved challenge value
  - `number` - the random number generated previously
  - `salt`
  - `signature`
- `hmac-key` - the HMAC key used for verification.
- `check-expiration?` - whether to check if the challenge has not expired.
Recommended to be kept as true

Keys:
- `max-number` - optional max-number override. If you're facing issues with
false negatives, try adding your value to this function's args
- `reference-time` - reference timestamp to compare as the timestamp 
which must be greater than the challenge's `created-at` value
- `throw-on-false?` - whether to throw an error if the result is false.
The result will be an ex-message with `params`, `payload`, `not-expired?` and `expected-challenge`
sourceraw docstring

check-solution-base64clj/s

(check-solution-base64 b64-payload
                       hmac-key
                       check-expiration?
                       &
                       {:keys [max-number reference-time]})

Verifies a base64 encoded solution

Verifies a base64 encoded solution
sourceraw docstring

signature-not-expired?clj/s

(signature-not-expired? verification-data current)
source

verify-fields-hashclj/s

(verify-fields-hash form-data fields fields-hash algorithm)

Verify the hashes of field values in the input map. Useful for scraper protection

Verify the hashes of field values in the input map.
Useful for scraper protection
sourceraw docstring

verify-server-signatureclj/s

(verify-server-signature {:keys [algorithm verification-data signature verified]
                          :as payload}
                         hmac-key)
source

verify-server-signature-base64clj/s

(verify-server-signature-base64 base64-payload hmac-key)
source

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close