detector

package
v1.10.8 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultDetector

type DefaultDetector struct{}

DefaultDetector is the default implementation of the Detector interface. It uses depth-first search (DFS) to detect cycles in role inheritance.

func NewDefaultDetector

func NewDefaultDetector() *DefaultDetector

NewDefaultDetector creates a new instance of DefaultDetector.

func (*DefaultDetector) Check

func (d *DefaultDetector) Check(rm rbac.RoleManager) error

Check checks whether the current status of the passed-in RoleManager contains logical errors (e.g., cycles in role inheritance). It uses DFS to traverse the role graph and detect cycles. Returns nil if no cycle is found, otherwise returns an error with a description of the cycle.

type Detector

type Detector interface {
	// Check checks whether the current status of the passed-in RoleManager contains logical errors (e.g., cycles in role inheritance).
	// param: rm RoleManager instance
	// return: If an error is found, return a descriptive error; otherwise return nil.
	Check(rm rbac.RoleManager) error
}

Detector defines the interface of a policy consistency checker, currently used to detect RBAC inheritance cycles.

Jump to

Keyboard shortcuts

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