auth

package
v0.9.4 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2023 License: Unlicense Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const AuthNop = "None"

AuthNop is the identifier returned by Nop.Identifier

View Source
const AuthUserpass = "Userpass"

AuthUserpass is the identifier returned by Nop.Userpass

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthType

type AuthType string

type Authorizer

type Authorizer interface {
	LoginHandler() http.HandlerFunc
	TokenHandler() TokenFunc
	Identifier() AuthType
}

func NewAuth

func NewAuth(conf Config) (Authorizer, error)

type Config

type Config struct {
	Type       string                 `yaml:"type"`
	Properties map[string]interface{} `yaml:"properties"`
}

type Nop

type Nop struct{}

func NewNop

func NewNop(_ NopConfig) (*Nop, error)

func (Nop) Identifier

func (_ Nop) Identifier() AuthType

func (Nop) LoginHandler

func (_ Nop) LoginHandler() http.HandlerFunc

func (Nop) TokenHandler

func (_ Nop) TokenHandler() TokenFunc

type NopConfig

type NopConfig struct{}

type TokenFunc

type TokenFunc func(http.HandlerFunc) http.HandlerFunc

type Userpass

type Userpass struct {
	// contains filtered or unexported fields
}

func NewUserpass

func NewUserpass(conf UserpassConfig) (*Userpass, error)

func (*Userpass) Identifier

func (_ *Userpass) Identifier() AuthType

func (*Userpass) LoginHandler

func (u *Userpass) LoginHandler() http.HandlerFunc

func (*Userpass) TokenHandler

func (u *Userpass) TokenHandler() TokenFunc

type UserpassConfig

type UserpassConfig struct {
	Username string `yaml:"username"`
	Password string `yaml:"password"`
	Timeout  int    `yaml:"timeout"`
	Refresh  bool   `yaml:"refresh"`
}

Jump to

Keyboard shortcuts

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