Documentation
¶
Index ¶
- Constants
- func ContextWithJWTCreator(ctx context.Context) context.Context
- func ContextWithStrategies(ctx context.Context, strategies union.Union) context.Context
- func InitStategies(ctx context.Context, i any) (union.Union, error)
- func StrategiesFromContext(ctx context.Context) union.Union
- type AllStrategieser
- type JWTCreator
- type JWTFiler
- type ListenAddresser
- type NodeAuthenticater
- type UserGranter
- type X509CACertFiler
Constants ¶
const ( StrategyUX = "ux" StrategyJWT = "jwt" StrategyNode = "node" StrategyUser = "user" )
Variables ¶
This section is empty.
Functions ¶
func ContextWithStrategies ¶
func InitStategies ¶
InitStategies initialize and returns strategies to enable all strategies, i has to implement AllStrategieser
Types ¶
type AllStrategieser ¶
type AllStrategieser interface { ListenAddresser JWTFiler X509CACertFiler NodeAuthenticater UserGranter }
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 ¶
JWTFiler is the interface that groups SignKeyFile and VerifyKeyFile methods for JWT auth.
type ListenAddresser ¶
ListenAddresser is the interface for ListenAddr method for ux auth.
type NodeAuthenticater ¶
NodeAuthenticater is the interface for AuthenticateNode method for node basic auth.
type UserGranter ¶
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.