role

package
v0.9.3 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DisableRoleCheckKey = "auth_disable_role_check"
	KeyAuthNoop         = "auth_noop"
	KeyClaims           = "claims"
)

Functions

This section is empty.

Types

type ClaimsRole added in v0.8.14

type ClaimsRole interface {
	HasRole(role string) bool
}

type Role

type Role struct {
	Roles   []string `cfg:"roles"`
	Methods []string `cfg:"methods"`

	Noop bool `cfg:"noop"`
}

func (*Role) Middleware

func (m *Role) Middleware() func(http.Handler) http.Handler

MiddlewareRole that checks the role claim.

This middleware just work with ClaimsRole interface in claim.

Jump to

Keyboard shortcuts

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