Liking cljdoc? Tell your friends :D

fahrscheine-bitte.core


check-consented-scopesclj

(check-consented-scopes tokeninfo required-scopes)

Checks if every scope is mentioned in the 'scope' attribute of the token info: {"scope" ["read" "write"]}

Checks if every scope is mentioned in the 'scope' attribute of the token info:
{"scope" ["read" "write"]}
sourceraw docstring

check-corresponding-attributesclj

(check-corresponding-attributes tokeninfo required-scopes)

Checks if every scope has a truthy attribute in the token info of the same name: {"read": true, "write": true}

Checks if every scope has a truthy attribute in the token info of the same name:
{"read": true, "write": true}
sourceraw docstring

explain-reason-codeclj

(explain-reason-code code)

If code is one of the supported codes, returns the explanation. If code is a string, returns it as is.

If code is one of the supported codes, returns the explanation.
If code is a string, returns it as is.
sourceraw docstring

extract-access-tokenclj

(extract-access-token request)

Extracts the Bearer token from the Authorization header. Returns either nil or the token string.

Extracts the Bearer token from the Authorization header.
Returns either nil or the token string.
sourceraw docstring

fetch-tokeninfoclj

(fetch-tokeninfo tokeninfo-url access-token client-middleware)

Returns a response with status 2xx or 4xx, throws an exception on 5xx or when http/get throws. Returned results are cacheable, thrown ones are not.

Returns a response with status 2xx or 4xx,
throws an exception on 5xx or when http/get throws.
Returned results are cacheable, thrown ones are not.
sourceraw docstring

make-cached-access-token-resolverclj

(make-cached-access-token-resolver
  tokeninfo-url
  {:keys [ttl-ms max-size client-middleware]
   :or {ttl-ms 120000 max-size 100 client-middleware identity}})

Returns a function that throws or returns whatever resolve-access-token throws or returns. Only returned results are cached.

Returns a function that throws or returns whatever resolve-access-token throws or returns.
Only returned results are cached.
sourceraw docstring

make-oauth2-s1st-security-handlerclj

(make-oauth2-s1st-security-handler access-token-resolver-fn scope-checker-fn)

Returns a swagger1st security handler that checks OAuth 2.0 tokens.

  • access-token-resolver-fn takes a token and returns tokeninfo: https://tools.ietf.org/html/rfc7662#section-2.2
  • scope-checker-fn takes tokeninfo and requirements and returns true if scopes in the tokeninfo match the requirements access-token-resolver-fn is presumably created by make-cached-access-token-resolver.
Returns a swagger1st security handler that checks OAuth 2.0 tokens.
* access-token-resolver-fn takes a token and returns tokeninfo: https://tools.ietf.org/html/rfc7662#section-2.2
* scope-checker-fn takes tokeninfo and requirements and returns true if scopes in the tokeninfo match the requirements
access-token-resolver-fn is presumably created by make-cached-access-token-resolver.
sourceraw docstring

make-wrap-oauth2-token-verifierclj

(make-wrap-oauth2-token-verifier access-token-resolver-fn)

Returns a swagger1st security handler that checks OAuth 2.0 tokens.

Returns a swagger1st security handler that checks OAuth 2.0 tokens.
* access-token-resolver-fn takes a token and returns tokeninfo: https://tools.ietf.org/html/rfc7662#section-2.2
access-token-resolver-fn is presumably created by make-cached-access-token-resolver.
sourceraw docstring

resolve-access-tokenclj

(resolve-access-token tokeninfo-url access-token client-middleware)

Checks with a tokeninfo endpoint for the token's validity. Returns the session information if valid (2xx), otherwise (4xx) returns nil. Throws if fetch-tokeninfo throws (which it does on 5xx or on connection errors/timeouts).

Checks with a tokeninfo endpoint for the token's validity.
Returns the session information if valid (2xx), otherwise (4xx) returns nil.
Throws if fetch-tokeninfo throws (which it does on 5xx or on connection errors/timeouts).
sourceraw docstring

wrap-log-auth-errorclj

(wrap-log-auth-error next-handler logger-fn)
source

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

× close