middleware

package
v0.0.0-...-a869338 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AllAccessScope = "ALL_ACCESS"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthData

type AuthData struct {
	ID         string   `json:"id"`
	FirstName  string   `json:"first_name"`
	MiddleName string   `json:"middle_name"`
	LastName   string   `json:"last_name"`
	Email      string   `json:"email"`
	Scopes     []string `json:"scopes"`
}

type DataWrapper

type DataWrapper struct {
	Data AuthData `json:"data"`
}

type MiddlewareComponent

type MiddlewareComponent interface {
	Auth(scopes ...string) gin.HandlerFunc
	Cors() gin.HandlerFunc
}

func NewMiddlewareComponent

func NewMiddlewareComponent(config MiddlewareConfig) MiddlewareComponent

type MiddlewareConfig

type MiddlewareConfig struct {
	AuthUrl string `env:"AUTH_SERVICE_URL" yaml:"authUrl" default:"http://localhost:8081"`
	Cors    bool   `env:"USE_CORS" yaml:"cors" default:"true"`
}

Jump to

Keyboard shortcuts

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