daemonauth

package
v1.0.0-alpha1.0...-2e0dbe4 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2025 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StrategyUX   = "ux"
	StrategyJWT  = "jwt"
	StrategyNode = "node"
	StrategyUser = "user"
)

Variables

This section is empty.

Functions

func ContextWithJWTCreator

func ContextWithJWTCreator(ctx context.Context) context.Context

func ContextWithStrategies

func ContextWithStrategies(ctx context.Context, strategies union.Union) context.Context

func InitStategies

func InitStategies(ctx context.Context, i any) (union.Union, error)

InitStategies initialize and returns strategies to enable all strategies, i has to implement AllStrategieser

func StrategiesFromContext

func StrategiesFromContext(ctx context.Context) union.Union

Types

type AllStrategieser

AllStrategieser defines interfaces that allows all strategies

type JWTCreator

type JWTCreator struct{}

JWTCreator implements CreateUserToken method

func JWTCreatorFromContext

func JWTCreatorFromContext(ctx context.Context) *JWTCreator

func (*JWTCreator) CreateUserToken

func (*JWTCreator) CreateUserToken(userInfo auth.Info, duration time.Duration, xClaims map[string]interface{}) (tk string, expiredAt time.Time, err error)

CreateUserToken implements CreateUserToken interface for JWTCreator. empty token is returned if jwtAuth is not initialized

type JWTFiler

type JWTFiler interface {
	SignKeyFile() string
	VerifyKeyFile() string
}

JWTFiler is the interface that groups SignKeyFile and VerifyKeyFile methods for JWT auth.

type ListenAddresser

type ListenAddresser interface {
	ListenAddr(context.Context) string
}

ListenAddresser is the interface for ListenAddr method for ux auth.

type NodeAuthenticater

type NodeAuthenticater interface {
	AuthenticateNode(nodename, password string) error
}

NodeAuthenticater is the interface for AuthenticateNode method for node basic auth.

type UserGranter

type UserGranter interface {
	UserGrants(username, password string) ([]string, error)
}

UserGranter is the interface for UserGrants method for user basic auth.

type X509CACertFiler

type X509CACertFiler interface {
	X509CACertFile() string
}

X509CACertFiler is the interface for X509CACertFile method for x509 auth.

Jump to

Keyboard shortcuts

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