middleware

package
v0.0.0-...-bb536ff Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ServiceAccount = Authentication{
	Username: "letsdeploy-service-account",
	Token:    "TODO",
}

Functions

func ApiKeyAuthMiddleware

func ApiKeyAuthMiddleware(ctx *gin.Context, userProvider UserProviderFunc)

func AuthMiddleware

func AuthMiddleware(ctx *gin.Context, cfg *viper.Viper, rsaKeys map[string]*rsa.PublicKey)

func Authz

func Authz(c *gin.Context)

func CreateApiKeyAuthMiddleware

func CreateApiKeyAuthMiddleware(userProvider UserProviderFunc) openapi.MiddlewareFunc

func CreateAuthMiddleware

func CreateAuthMiddleware(cfg *viper.Viper) openapi.MiddlewareFunc

func ErrorHandler

func ErrorHandler(c *gin.Context)

Types

type Authentication

type Authentication struct {
	Username string
	Token    string
}

func GetAuth

func GetAuth(ctx context.Context) Authentication

type UserProviderFunc

type UserProviderFunc = func(apiKey string) (username string, err error)

Jump to

Keyboard shortcuts

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