Help us shape the future of Go! Take the 2026 Go Developer Survey

rbac

package
v0.112.14 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OperationIn

func OperationIn(operationId string, operationIds []string) bool

Types

type Authorizer

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

func NewAuthorizer

func NewAuthorizer(
	permMap *PermissionMap,
	spec *openapi3.T,
) (*Authorizer, error)

func (*Authorizer) IsAuthorized

func (a *Authorizer) IsAuthorized(role string, operation string) bool

type PermissionMap

type PermissionMap struct {
	Roles map[string]*Role
}

func LoadPermissionMap

func LoadPermissionMap(yamlBytes []byte) (*PermissionMap, error)

func (*PermissionMap) HasPermission

func (p *PermissionMap) HasPermission(roleName string, operation string) bool

func (*PermissionMap) ValidInheritance

func (p *PermissionMap) ValidInheritance(roleName string) error

func (*PermissionMap) Validate

func (p *PermissionMap) Validate() error

func (*PermissionMap) ValidateSpec

func (p *PermissionMap) ValidateSpec(spec openapi3.T) error

type RBACError

type RBACError struct {
	Message string
}

func (*RBACError) Error

func (e *RBACError) Error() string

type Role

type Role struct {
	Inherits    *[]string
	Permissions *[]string
}

Jump to

Keyboard shortcuts

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