authmiddleware

package module
Version: v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2020 License: BSD-3-Clause Imports: 4 Imported by: 5

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/authmiddleware"
    "clevergo.tech/clevergo"
)
var store auth.IdentityStore
authenticator := authenticators.NewBasicAuth(store)
app := clevergo.New()
app.Use(authmiddleware.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.

Source Files

Jump to

Keyboard shortcuts

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