Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExpandPermissions ¶ added in v1.3.0
ExpandPermissions resolves a wildcard-based permission map into an explicit resource-to-verbs mapping. It replicates the precedence logic from CheckPermission: specific entries override the wildcard, and an empty verb list means explicit denial. This is used by both the genroles generator and the round-trip correctness test to ensure a single expansion implementation.
func GetResourcePermissions ¶ added in v1.3.0
GetResourcePermissions returns a deep copy of the role-based permission map. This is used by the Helm ClusterRole generator to produce K8s RBAC rules that match the static authorization logic.
func GetSyntheticResources ¶ added in v1.3.0
func GetSyntheticResources() []string
GetSyntheticResources returns a copy of the synthetic resource list.
Types ¶
type K8sAuthZ ¶
type K8sAuthZ struct {
K8sClient k8sclient.K8SClient
Namespace string
Log logrus.FieldLogger
}
func (K8sAuthZ) CheckPermission ¶
func (K8sAuthZ) GetUserPermissions ¶ added in v1.0.0
type OpenShiftAuthZ ¶ added in v1.0.0
type OpenShiftAuthZ struct {
K8sClient k8sclient.K8SClient
Log logrus.FieldLogger
Cache *ttlcache.Cache[string, bool]
}
func NewOpenShiftAuthZ ¶ added in v1.0.0
func NewOpenShiftAuthZ(ctx context.Context, k8sClient k8sclient.K8SClient, log logrus.FieldLogger) *OpenShiftAuthZ
func (OpenShiftAuthZ) CheckPermission ¶ added in v1.0.0
func (OpenShiftAuthZ) GetUserPermissions ¶ added in v1.0.0
func (osAuth OpenShiftAuthZ) GetUserPermissions(ctx context.Context, token string) (*v1beta1.PermissionList, error)
type StaticAuthZ ¶ added in v1.0.0
type StaticAuthZ struct {
// contains filtered or unexported fields
}
StaticAuthZ implements role-based authorization using system groups
func NewStaticAuthZ ¶ added in v1.0.0
func NewStaticAuthZ(log logrus.FieldLogger) *StaticAuthZ
func (StaticAuthZ) CheckPermission ¶ added in v1.0.0
func (StaticAuthZ) GetUserPermissions ¶ added in v1.0.0
func (s StaticAuthZ) GetUserPermissions(ctx context.Context) (*v1beta1.PermissionList, error)