项目作者: duct-framework

项目描述 :
Integrant keys for Buddy middleware
高级语言: Clojure
项目地址: git://github.com/duct-framework/middleware.buddy.git
创建时间: 2017-12-02T06:17:15Z
项目社区:https://github.com/duct-framework/middleware.buddy

开源协议:

下载


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:

  1. [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:

  1. {:duct.middleware.buddy/authentication
  2. {:backend :basic
  3. :realm "Example"
  4. :authfn #ig/ref :example.auth/basic-auth}
  5. :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:

  1. {:duct.middleware.buddy/authorization
  2. {:backend :basic
  3. :realm "Example"
  4. :authfn #ig/ref :example.auth/basic-auth}
  5. :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.