authmidware

package module
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 27, 2020 License: BSD-3-Clause Imports: 4 Imported by: 0

README

CleverGo Authentication Middleware

Build Status Coverage Status Go.Dev reference Go Report Card Release

Usage

import (
    "clevergo.tech/auth"
    "clevergo.tech/auth/authenticators"
    "clevergo.tech/authmidware"
    "clevergo.tech/clevergo"
)
var store auth.IdentityStore
authenticator := authenticators.NewBasicAuth(store)
app := clevergo.New()
app.Use(authmidware.New(authenticator))

Checkout example for details.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetIdentity

func GetIdentity(ctx context.Context) auth.Identity

GetIdentity retrieves a authenticated identity from context.

func New

func New(authenticator auth.Authenticator) clevergo.MiddlewareFunc

New returns a middleware with the given authenticator.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL