auth

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2021 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthData

type AuthData struct {
	User       string
	Group      string
	Properties map[string]string
}

type AuthManager

type AuthManager interface {
	AddUser(user string, group string, password string) error
	DeleteUser(user string) error
	DoAuth(w http.ResponseWriter, r *http.Request) (*AuthData, bool)
}

func NewAuth

func NewAuth(kind string) AuthManager

func NewBasicAuth

func NewBasicAuth() AuthManager

func NewNoAuth

func NewNoAuth() AuthManager

type Authenticator added in v0.2.0

type Authenticator interface {
	DoAuth(w http.ResponseWriter, r *http.Request) (*AuthData, bool)
}

type BasicAuth

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

func (*BasicAuth) AddUser

func (ba *BasicAuth) AddUser(user, group, password string) error

func (*BasicAuth) DeleteUser

func (ba *BasicAuth) DeleteUser(user string) error

func (*BasicAuth) DoAuth

func (ba *BasicAuth) DoAuth(w http.ResponseWriter, r *http.Request) (*AuthData, bool)

type BasicAuthInfo

type BasicAuthInfo struct {
	Group    string
	Password string
}

type NoAuth

type NoAuth struct {
	User AuthData
}

----------------------------------------------------------------------------------------------------------------------

func (*NoAuth) AddUser

func (a *NoAuth) AddUser(user string, group string, password string) error

func (*NoAuth) DeleteUser

func (a *NoAuth) DeleteUser(user string) error

func (*NoAuth) DoAuth

func (a *NoAuth) DoAuth(w http.ResponseWriter, r *http.Request) (*AuthData, bool)

type TokenAuth

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

----------------------------------------------------------------------------------------------------------------------

func NewTokenAuth

func NewTokenAuth() *TokenAuth

func (*TokenAuth) AddUser

func (a *TokenAuth) AddUser(user string, group string, password string) error

func (*TokenAuth) DeleteUser

func (a *TokenAuth) DeleteUser(user string) error

func (*TokenAuth) DoAuth

func (a *TokenAuth) DoAuth(w http.ResponseWriter, r *http.Request) (*AuthData, bool)

type TokenUser

type TokenUser struct {
	User  string
	Group string
}

Jump to

Keyboard shortcuts

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