Documentation ¶
Overview ¶
Package auth holds user login related stuff
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GoogleJWTTokenValidator ¶
type GoogleJWTTokenValidator struct{}
func NewGoogleJWTTokenValidator ¶
func NewGoogleJWTTokenValidator() *GoogleJWTTokenValidator
func (*GoogleJWTTokenValidator) Validate ¶
func (g *GoogleJWTTokenValidator) Validate(token string) error
type HandlerAuthenticator ¶
type HandlerAuthenticator struct {
// contains filtered or unexported fields
}
HandlerAuthenticator is responsible for authenticating handlers
func NewHandlerAuthenticator ¶
func NewHandlerAuthenticator(sessionManager *helpers.SessionHelper[models.Session]) *HandlerAuthenticator
NewHandlerAuthenticator returns a new HandlerAuthenticator instance
func (*HandlerAuthenticator) AuthenticateHandler ¶
func (h *HandlerAuthenticator) AuthenticateHandler(handler HandlerFunc) http.HandlerFunc
AuthenticateHandler executes the given handler function is authentication is done correctly :)
func (*HandlerAuthenticator) AuthenticateHandlers ¶
func (h *HandlerAuthenticator) AuthenticateHandlers(handlers map[string]HandlerFunc) map[string]http.HandlerFunc
AuthenticateHandlers returns authenticated handler functions map of the given map
type HandlerFunc ¶
type HandlerFunc func(ctx context.HandlerContext)
HandlerFunc is a handler function with an extra parameter(session)
type JWTTokenValidator ¶
type MicrosoftJWTValidator ¶
type MicrosoftJWTValidator struct{}
func NewMicrosoftJWTValidator ¶
func NewMicrosoftJWTValidator() *MicrosoftJWTValidator
func (*MicrosoftJWTValidator) Validate ¶
func (m *MicrosoftJWTValidator) Validate(token string) error
type OAuthLoginAPI ¶
type OAuthLoginAPI struct {
// contains filtered or unexported fields
}
OAuthLoginAPI holds google login handlers
func NewOAuthLoginAPI ¶
func NewOAuthLoginAPI(userManager *helpers.UserHelper, tokenValidator JWTTokenValidator, apiEndPoint string) *OAuthLoginAPI
NewOAuthLoginAPI returns a new OAuthLoginAPI instance
func (*OAuthLoginAPI) ServeHTTP ¶
func (l *OAuthLoginAPI) ServeHTTP(res http.ResponseWriter, req *http.Request)
Click to show internal directories.
Click to hide internal directories.