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.
Click to show internal directories.
Click to hide internal directories.