middleware

package
v0.7.4 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const ContextKeyRole = "casbinRole"
View Source
const ContextKeySession = "kratosSession"

Variables

This section is empty.

Functions

func LanguageMiddleware

func LanguageMiddleware(defaultLang string, available []string) echo.MiddlewareFunc

func RoleFromContext

func RoleFromContext(c echo.Context) (string, bool)

func SessionFromContext

func SessionFromContext(c echo.Context) (*ory.Session, bool)

Types

type AdminKeyAuth

type AdminKeyAuth struct {
	// contains filtered or unexported fields
}

func NewAdminKeyAuth

func NewAdminKeyAuth(secretKey string) *AdminKeyAuth

func (*AdminKeyAuth) RequireAdminKey

func (m *AdminKeyAuth) RequireAdminKey(next echo.HandlerFunc) echo.HandlerFunc

type CasbinRBAC

type CasbinRBAC struct {
	// contains filtered or unexported fields
}

func NewCasbinRBAC

func NewCasbinRBAC(authorizer *authz.CasbinAuthorizer) *CasbinRBAC

func (*CasbinRBAC) Require

func (m *CasbinRBAC) Require(dom, obj, act string) echo.MiddlewareFunc

type KeyLang

type KeyLang struct{}

type KeyLangCandidates

type KeyLangCandidates struct{}

type KratosAuth

type KratosAuth struct {
	// contains filtered or unexported fields
}

func NewKratosAuth

func NewKratosAuth(kratosPublicURL string) *KratosAuth

func (*KratosAuth) RequireSession

func (a *KratosAuth) RequireSession(next echo.HandlerFunc) echo.HandlerFunc

Jump to

Keyboard shortcuts

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