auth

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2020 License: BSD-3-Clause Imports: 1 Imported by: 7

README

Authentication

Build Status Coverage Status GoDoc Go Report Card Release

Usage

Credit

Inspired by Yii Auth.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Authenticator

type Authenticator interface {
	// Authenticates the current user.
	Authenticate(*http.Request) (Identity, error)

	// Challenge generates challenges upon authentication failure.
	Challenge(http.ResponseWriter)
}

Authenticator is an interface that authenticates an user.

type Identity

type Identity interface {
	GetID() string
}

Identity is an interface that should be implemented by an user instance.

type IdentityStore

type IdentityStore interface {
	// Gets identity by ID.
	GetIdentity(id string) (Identity, error)

	// Gets identity by the given token and token type.
	GetIdentityByToken(token string, tokenType interface{}) (Identity, error)
}

IdentityStore is a store interface for retrieving identity by ID or token.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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