buddy.auth.middleware

authenticate-request

(authenticate-request request backends)

A function that runs the authentication backend chain for the provided request and return the identity of the first matched backend (backend that properly authenticates the provided request).

NOTE: this function is for internal use, it is public because it is helpful in environments different to ring.

authentication-request

(authentication-request request & backends)

Updates request with authentication. If multiple backends are given each of them gets a chance to authenticate the request.

NOTE: this function is for internal use, it is public because it is helpful in environments different to ring.

authorization-error

(authorization-error request e backend)

Handles authorization errors.

The backend parameter should be a plain function that accepts two parameters: request and errordata hashmap, or an instance that satisfies IAuthorization protocol.

wrap-authentication

(wrap-authentication handler & backends)

Ring middleware that enables authentication for your ring handler. When multiple backends are given each of them gets a chance to authenticate the request.

wrap-authorization

(wrap-authorization handler backend)

Ring middleware that enables authorization workflow for your ring handler.

The backend parameter should be a plain function that accepts two parameters: request and errordata hashmap, or an instance that satisfies IAuthorization protocol.