auth

package
v0.0.0-...-89754d3 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProviderMockSuccess = "MockSuccess"
	ProviderMockFailure = "MockFailure"
)
View Source
const (
	ProviderRpc = "rpc"
)

Variables

View Source
var (
	ErrAuthCredType         = errors.New("auth: Authentication cred type unsupported")
	ErrAuthFailure          = errors.New("auth: Authentication failure")
	ErrAuthProviderNotFound = errors.New("auth: Authentication provider not found")
)

Functions

func NewRpcRegister

func NewRpcRegister(ak, sk string, addr []string) io.Closer

func Register

func Register(name string, provider Authenticator)

func Unregister

func Unregister(name string)

Types

type Authenticator

type Authenticator interface {
	Authenticate(id string, cred interface{}) error
}

type Manager

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

func NewManager

func NewManager(providerName string) (*Manager, error)

func (*Manager) Authenticate

func (this *Manager) Authenticate(id string, cred interface{}) error

type RpcAuthenticator

type RpcAuthenticator struct {
	AccessKeyId     string
	AccessKeySecret string
	// contains filtered or unexported fields
}

func (*RpcAuthenticator) Authenticate

func (a *RpcAuthenticator) Authenticate(id string, cred interface{}) error

func (*RpcAuthenticator) Close

func (a *RpcAuthenticator) Close() error

Jump to

Keyboard shortcuts

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