Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Policy ¶
type Policy struct { Effect bool // 是否允许(true: 允许, false: 拒绝) Action Action Subjects [][]Attribute Objects [][]Attribute Conditions []Condition // 可选,用于更复杂的条件判断 }
Policy 策略 定义哪些属性组合(Subject)可以执行哪些操作(Object)
type PolicyEnforcer ¶
type PolicyEnforcer struct {
Policies []Policy
}
PolicyEnforcer 策略执行器 根据当前的环境、用户和资源属性,以及策略,判断请求是否合法。
Click to show internal directories.
Click to hide internal directories.