Skip to content

Latest commit

 

History

History
72 lines (49 loc) · 1.91 KB

README.md

File metadata and controls

72 lines (49 loc) · 1.91 KB

Duct middleware.buddy

Build Status

A Duct library that provides keys for (some) Buddy middleware.

Installation

To install, add the following to your project :dependencies:

[duct/middleware.buddy "0.2.0"]

Usage

This library currently only supports two Integrant keys:

:duct.middleware.buddy/authentication

This keyword wraps the buddy.auth.middleware/wrap-authentication function. The authentication backend is denoted by a keyword on the :backend key:

{:duct.middleware.buddy/authentication
 {:backend :basic
  :realm   "Example"
  :authfn  #ig/ref :example.auth/basic-auth}

 :example.auth/basic-auth {}}

:duct.middleware.buddy/authorization

This keyword wraps the buddy.auth.middleware/wrap-authorization function. The authorization backend is denoted by a keyword on the :backend key:

{:duct.middleware.buddy/authorization
 {:backend :basic
  :realm   "Example"
  :authfn  #ig/ref :example.auth/basic-auth}

 :example.auth/basic-auth {}}

Five backends are supported:

  • :basic
  • :session
  • :token
  • :jws
  • :jwe

These are covered in more detail in the buddy-auth documentation.

License

Copyright © 2017 James Reeves

Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.