authenticator

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateToken added in v1.0.2

func GenerateToken(secret ed25519.PrivateKey, hash string, claims interface{}, externalData interface{}) (string, error)

func GetClaimsFromJwt added in v1.0.2

func GetClaimsFromJwt(claims *jwt.MapClaims) (utils.IClaims, error)

func ValidateToken added in v1.0.2

func ValidateToken(token string, secret ed25519.PublicKey, ttl time.Duration) (*jwt.MapClaims, error)

func ValidateTokenClaim added in v1.0.2

func ValidateTokenClaim(token string, secret ed25519.PublicKey, ttl time.Duration) (utils.IClaims, error)

Types

type AuthenticatorService

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

func (*AuthenticatorService) LogError

func (s *AuthenticatorService) LogError(err error)

func (*AuthenticatorService) ServiceRefreshToken

func (s *AuthenticatorService) ServiceRefreshToken(tokenID string, refreshToken string) (IAccessToken, error)

func (*AuthenticatorService) ServiceSignIn

func (s *AuthenticatorService) ServiceSignIn(username string, password string) (ISignInData, error)

type IAccessToken

type IAccessToken interface {
	GetAccessToken() string
}

type IAuthenticator

type IAuthenticator interface {
	ServiceSignIn(string, string) (ISignInData, error)
	ServiceRefreshToken(string, string) (IAccessToken, error)
	LogError(error)
}

type IRoleValidatorHandler

type IRoleValidatorHandler interface {
	RefreshToken() error
	RoleMiddleware() middleware.Middleware
	RoleValidatorHandler()
}

func NewRoleValidatorHandler

func NewRoleValidatorHandler(userinfo IUserinfo, publicKey string, accessTimeout time.Duration, refreshTimeout time.Duration, authConnection *g_grpc.ClientConn, logger log.Logger) IRoleValidatorHandler

type ISignInData

type ISignInData interface {
	GetAccessToken() string
	GetTokenId() string
	GetRefreshToken() string
}

type IUserinfo

type IUserinfo interface {
	GetUsername() string
	GetPassword() string
}

Jump to

Keyboard shortcuts

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