avionix.kube.rbac_authorization

class avionix.kube.rbac_authorization.AggregationRule(cluster_role_selectors)
Parameters

cluster_role_selectors (List[LabelSelector]) – ClusterRoleSelectors holds a list of selectors which will be used to find ClusterRoles and create the rules. If any of the selectors match, then the ClusterRole’s permissions will be added

class avionix.kube.rbac_authorization.ClusterRole(metadata, aggregation_rule=None, rules=None, api_version=None)
Parameters
  • metadata (ObjectMeta) – Standard object’s metadata.

  • aggregation_rule (Optional[AggregationRule]) – AggregationRule is an optional field that describes how to build the Rules for this ClusterRole. If AggregationRule is set, then the Rules are controller managed and direct changes to Rules will be stomped by the controller.

  • rules (Optional[List[PolicyRule]]) – Rules holds all the PolicyRules for this ClusterRole

  • api_version (Optional[str]) – APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa

class avionix.kube.rbac_authorization.ClusterRoleBinding(metadata, role_ref, subjects=None, api_version=None)
Parameters
  • metadata (ObjectMeta) – Standard object’s metadata.

  • role_ref (RoleRef) – RoleRef can only reference a ClusterRole in the global namespace. If the RoleRef cannot be resolved, the Authorizer must return an error.

  • subjects (Optional[List[Subject]]) – Subjects holds references to the objects the role applies to.

  • api_version (Optional[str]) – APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa

class avionix.kube.rbac_authorization.PolicyRule(api_groups, resources, verbs, resource_names=None, non_resource_urls=None)
Parameters
  • api_groups (List[str]) – APIGroups is the name of the APIGroup that contains the resources. If multiple API groups are specified, any action requested against one of the enumerated resources in any API group will be allowed.

  • resources (List[str]) – Resources is a list of resources this rule applies to. ResourceAll represents all resources.

  • verbs (List[str]) – Verbs is a list of Verbs that apply to ALL the ResourceKinds and AttributeRestrictions contained in this rule. VerbAll represents all kinds.

  • resource_names (Optional[List[str]]) – ResourceNames is an optional white list of names that the rule applies to. An empty set means that everything is allowed.

  • non_resource_urls (Optional[List[str]]) – NonResourceURLs is a set of partial urls that a user should have access to. ‘*’s are allowed, but only as the full, final step in the path Since non-resource URLs are not namespaced, this field is only applicable for ClusterRoles referenced from a ClusterRoleBinding. Rules can either apply to API resources (such as “pods” or “secrets”) or non-resource URL paths (such as “/api”), but not both.

class avionix.kube.rbac_authorization.Role(metadata, rules, api_version=None)
Parameters
class avionix.kube.rbac_authorization.RoleBinding(metadata, role_ref, subjects=None, api_version=None)
Parameters
  • metadata (ObjectMeta) – Standard object’s metadata.

  • role_ref (RoleRef) – RoleRef can reference a Role in the current namespace or a ClusterRole in the global namespace. If the RoleRef cannot be resolved, the Authorizer must return an error.

  • subjects (Optional[List[Subject]]) – Subjects holds references to the objects the role applies to.

  • api_version (Optional[str]) – APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa

class avionix.kube.rbac_authorization.RoleRef(name, api_group, kind)
Parameters
  • name (str) – Name is the name of resource being referenced

  • api_group (str) – APIGroup is the group for the resource being referenced

  • kind (str) – Kind is the type of resource being referenced

class avionix.kube.rbac_authorization.Subject(name, kind, api_group=None, namespace=None)
Parameters
  • name (str) – Name of the object being referenced.

  • kind (str) – Kind of object being referenced. Values defined by this API group are “User”, “Group”, and “ServiceAccount”. If the Authorizer does not recognized the kind value, the Authorizer should report an error.

  • api_group (Optional[str]) – APIGroup holds the API group of the referenced subject. Defaults to “” for ServiceAccount subjects. Defaults to “rbac.authorization.k8s.io” for User and Group subjects.

  • namespace (Optional[str]) – Namespace of the referenced object. If the object kind is non-namespace, such as “User” or “Group”, and this value is not empty the Authorizer should report an error.