router

package
v0.0.0-...-c606dee Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2023 License: MIT Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InstanceGorillaMux int = iota
	InstanceGin
)

Variables

This section is empty.

Functions

func Auth0HandlerCallback

func Auth0HandlerCallback(auth *Authenticator) gin.HandlerFunc

Handler for our callback.

func Auth0HandlerLogin

func Auth0HandlerLogin(auth *Authenticator) gin.HandlerFunc

Handler for our login.

func Auth0HandlerLogout

func Auth0HandlerLogout(ctx *gin.Context)

Handler for our logout.

func Auth0IsAuthenticated

func Auth0IsAuthenticated(ctx *gin.Context)

Auth0 IsAuthenticated Middleware IsAuthenticated is a middleware that checks if the user has already been authenticated previously.

func Auth0Middleware

func Auth0Middleware(ctx *gin.Context)

func Auth0UserProfileHandler

func Auth0UserProfileHandler(ctx *gin.Context)

Handler for our logged-in user page.

Types

type AuthHandler

type AuthHandler struct{}

type Authenticator

type Authenticator struct {
	*oidc.Provider
	oauth2.Config
}

Authenticator is used to authenticate our users.

func NewAuthenticator

func NewAuthenticator() (*Authenticator, error)

New instantiates the *Authenticator.

func (*Authenticator) VerifyIDToken

func (a *Authenticator) VerifyIDToken(ctx context.Context, token *oauth2.Token) (*oidc.IDToken, error)

VerifyIDToken verifies that an *oauth2.Token is a valid *oidc.IDToken.

type Claims

type Claims struct {
	Username string `json:"username"`
	jwt.RegisteredClaims
}

type JWTOutput

type JWTOutput struct {
	Token   string    `json:"token"`
	Expires time.Time `json:"expires"`
}

type Port

type Port int64

type Server

type Server interface {
	Listen()
}

func NewWebServerFactory

func NewWebServerFactory(
	instance int,
	log logger.Logger,
	dbSQL repository.SQL,
	dbNoSQL repository.NoSQL,
	kv repository.KeyValStoreIn,
	validator validator.Validator,
	port Port,
	ctxTimeout time.Duration,
) (Server, error)

Jump to

Keyboard shortcuts

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