middlewares

package
v0.0.0-...-d64eb31 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Authorize

func Authorize(uc UserClient, roles ...string) gin.HandlerFunc

func Cors

func Cors() gin.HandlerFunc

func Logger

func Logger(serviceCtx srvctx.ServiceContext) gin.HandlerFunc

func Recovery

func Recovery(serviceCtx srvctx.ServiceContext) gin.HandlerFunc

func RequireAuth

func RequireAuth(ac AuthClient) func(*gin.Context)

Types

type AuthClient

type AuthClient interface {
	IntrospectToken(ctx context.Context, accessToken string) (sub string, tid string, err error)
}

type CanGetStatusCode

type CanGetStatusCode interface {
	StatusCode() int
}

type UserClient

type UserClient interface {
	GetUserRole(ctx context.Context, userId int) (string, error)
}

Jump to

Keyboard shortcuts

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