handler

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InternalServerError        string = "An unexpected error occurred while processing your request."
	SignatureVerificationError string = "Signature verification failed. Please try again."
	InvalidChallengeError      string = "Challenge is invalid. Please try again."
	UnauthorizedAccessError    string = "Authorization failed. Please verify your credentials and try again."
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	pb.UnimplementedAuthServer
	// contains filtered or unexported fields
}

func NewHandler

func NewHandler(config util.Config, store db.Store, tokenMaker token.Maker, cache cache.Cache) Handler

func (*Handler) AuthenticateAccount

func (*Handler) GetChallenge

func (h *Handler) GetChallenge(ctx context.Context, req *pb.GetChallengeRequest) (*pb.GetChallengeResponse, error)

func (*Handler) RefreshAccessToken

func (*Handler) RevokeRefreshTokens

func (*Handler) VerifyAccessToken

type Session

type Session struct {
	ID                  string
	AccessToken         string
	AccessTokenPayload  *token.Payload
	RefreshToken        string
	RefreshTokenPayload *token.Payload
	ExpiresAt           time.Time
}

func NewSession

func NewSession(ctx context.Context, accountOwner string, accountRole token.Role, config util.Config, tokenMaker token.Maker, store db.Store) (*Session, error)

Jump to

Keyboard shortcuts

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