Liking cljdoc? Tell your friends :D

monkey.ci.web.auth

Authentication and authorization functions

Authentication and authorization functions
raw docstring

allowed?clj

(allowed? r)
source

augment-payloadclj

(augment-payload payload)
source

auth-chainclj

(auth-chain chain req)

Applies the authorization chain to the request. The chain consists of functions that are applied to the request. Each part can return a non-nil value, which is interpreted as a security advise. This can be to deny, or allow the request. If the request is denied, an authorization exception is thrown. This system allows a large degree of autonomy to each checker. They can inspect the previous advises, and modify their response accordingly.

Applies the authorization chain to the request.  The chain consists of
functions that are applied to the request.  Each part can return a
non-nil value, which is interpreted as a security advise.  This can
be to deny, or allow the request.  If the request is denied, an 
authorization exception is thrown.  This system allows a large degree
of autonomy to each checker.  They can inspect the previous advises,
and modify their response accordingly.
sourceraw docstring

auth-chain-middlewareclj

(auth-chain-middleware h)

Middleware that extracts any authorization checkers from the route data and applies them. If the chain results in a request denied, a 403 response is returned.

Middleware that extracts any authorization checkers from the route data
and applies them.  If the chain results in a request denied, a 403 response
is returned.
sourceraw docstring

build-tokenclj

Creates token contents for a build, to be used by a build script.

Creates token contents for a build, to be used by a build script.
sourceraw docstring

chain-result->exceptionclj

(chain-result->exception r)
source

default-token-expirationclj

Default token expiration period, one day

Default token expiration period, one day
sourceraw docstring

denied?clj

(denied? r)
source

expired?clj

(expired? {:keys [exp]})

Returns true if token has expired

Returns true if token has expired
sourceraw docstring

generate-and-sign-jwtclj

(generate-and-sign-jwt payload pk)
source

generate-jwtclj

(generate-jwt req payload)

Signs a JWT using the keypair from the request context.

Signs a JWT using the keypair from the request context.
sourceraw docstring

generate-jwt-from-rtclj

(generate-jwt-from-rt rt payload)

Generates a JWT from the private key in the runtime

Generates a JWT from the private key in the runtime
sourceraw docstring

generate-keypairclj

(generate-keypair)

Generates a new RSA keypair

Generates a new RSA keypair
sourceraw docstring

generate-secret-keyclj

(generate-secret-key)

Generates a random secret key object

Generates a random secret key object
sourceraw docstring

grantedclj

source

hash-pwclj

(hash-pw pw)

Creates SHA256 hash of password, returns hex encoded string

Creates SHA256 hash of password, returns hex encoded string
sourceraw docstring

jwksclj

(jwks req)

JWKS endpoint handler

JWKS endpoint handler
sourceraw docstring

keypair->rtclj

(keypair->rt kp)
source

kidclj

source

make-jwkclj

(make-jwk pub)

Creates a JWK object from a public key that can be exposed for external verification.

Creates a JWK object from a public key that can be exposed for external 
verification.
sourceraw docstring

org-auth-checkerclj

Checks if the user has access to the organization

Checks if the user has access to the organization
sourceraw docstring

org-body-checkerclj

Checks if the user has access to the organization specified in the body

Checks if the user has access to the organization specified in the body
sourceraw docstring

parse-signatureclj

(parse-signature s)

Parses HMAC signature header, returns the algorithm and the signature.

Parses HMAC signature header, returns the algorithm and the signature.
sourceraw docstring

public-repo-checkerclj

(public-repo-checker chain req)

Checks if the repository that's being accessed is public, and the request method is GET.

Checks if the repository that's being accessed is public, and the
request method is `GET`.
sourceraw docstring

req->webhook-idclj

source

resolve-tokencljmultimethod

source

role-buildclj

source

role-sysadminclj

source

role-userclj

source

rt->pub-keyclj

source

secure-ring-appclj

(secure-ring-app app rt)

Wraps the ring handler so it verifies the JWT authorization header

Wraps the ring handler so it verifies the JWT authorization header
sourceraw docstring

sign-jwtclj

(sign-jwt payload pk)
source

sysadmin-authorizationclj

(sysadmin-authorization h)
source

sysadmin-tokenclj

Creates token contents for a system admin, a user that has special privileges.

Creates token contents for a system admin, a user that has special privileges.
sourceraw docstring

sysadmin?clj

(sysadmin? user)
source

user-idclj

Retrieves current user id from request

Retrieves current user id from request
sourceraw docstring

user-tokenclj

Creates token contents for an authenticated user

Creates token contents for an authenticated user
sourceraw docstring

valid-security?clj

(valid-security? {:keys [secret payload x-hub-signature]})

Validates security header

Validates security header
sourceraw docstring

validate-hmac-securityclj

(validate-hmac-security h
                        {:keys [get-secret header]
                         :or {header "x-hub-signature-256"}})

Middleware that validates the HMAC security header using a fn that retrieves the secret for the request.

Middleware that validates the HMAC security header using a fn that retrieves
the secret for the request.
sourceraw docstring

webhook-org-checkerclj

(webhook-org-checker _ req)

Verifies if the user has permissions on the webhook org

Verifies if the user has permissions on the webhook org
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