Documentation
¶
Overview ¶
Package v1alpha1 contains API Schema definitions for the kargo rbac v1alpha1 API group +kubebuilder:object:generate=true +groupName=rbac.kargo.akuity.io
Index ¶
- Constants
- Variables
- func AnnotationKeyOIDCClaim(name string) string
- func OIDCClaimNameFromAnnotationKey(key string) (string, bool)
- func OIDCClaimsFromAnnotationValues(annotations map[string]string) (map[string][]string, error)
- func SetOIDCClaimsAnnotation(sa *corev1.ServiceAccount, claims map[string][]string) error
- type Claim
- func (in *Claim) DeepCopy() *Claim
- func (in *Claim) DeepCopyInto(out *Claim)
- func (*Claim) Descriptor() ([]byte, []int)
- func (m *Claim) Marshal() (dAtA []byte, err error)
- func (m *Claim) MarshalTo(dAtA []byte) (int, error)
- func (m *Claim) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Claim) ProtoMessage()
- func (m *Claim) Reset()
- func (m *Claim) Size() (n int)
- func (this *Claim) String() string
- func (m *Claim) Unmarshal(dAtA []byte) error
- func (m *Claim) XXX_DiscardUnknown()
- func (m *Claim) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Claim) XXX_Merge(src proto.Message)
- func (m *Claim) XXX_Size() int
- func (m *Claim) XXX_Unmarshal(b []byte) error
- type ResourceDetails
- func (in *ResourceDetails) DeepCopy() *ResourceDetails
- func (in *ResourceDetails) DeepCopyInto(out *ResourceDetails)
- func (*ResourceDetails) Descriptor() ([]byte, []int)
- func (m *ResourceDetails) Marshal() (dAtA []byte, err error)
- func (m *ResourceDetails) MarshalTo(dAtA []byte) (int, error)
- func (m *ResourceDetails) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*ResourceDetails) ProtoMessage()
- func (m *ResourceDetails) Reset()
- func (m *ResourceDetails) Size() (n int)
- func (this *ResourceDetails) String() string
- func (m *ResourceDetails) Unmarshal(dAtA []byte) error
- func (m *ResourceDetails) XXX_DiscardUnknown()
- func (m *ResourceDetails) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ResourceDetails) XXX_Merge(src proto.Message)
- func (m *ResourceDetails) XXX_Size() int
- func (m *ResourceDetails) XXX_Unmarshal(b []byte) error
- type Role
- func (in *Role) DeepCopy() *Role
- func (in *Role) DeepCopyInto(out *Role)
- func (in *Role) DeepCopyObject() runtime.Object
- func (*Role) Descriptor() ([]byte, []int)
- func (m *Role) Marshal() (dAtA []byte, err error)
- func (m *Role) MarshalTo(dAtA []byte) (int, error)
- func (m *Role) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Role) ProtoMessage()
- func (m *Role) Reset()
- func (m *Role) Size() (n int)
- func (this *Role) String() string
- func (m *Role) Unmarshal(dAtA []byte) error
- func (m *Role) XXX_DiscardUnknown()
- func (m *Role) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Role) XXX_Merge(src proto.Message)
- func (m *Role) XXX_Size() int
- func (m *Role) XXX_Unmarshal(b []byte) error
- type RoleResources
- func (in *RoleResources) DeepCopy() *RoleResources
- func (in *RoleResources) DeepCopyInto(out *RoleResources)
- func (in *RoleResources) DeepCopyObject() runtime.Object
- func (*RoleResources) Descriptor() ([]byte, []int)
- func (m *RoleResources) Marshal() (dAtA []byte, err error)
- func (m *RoleResources) MarshalTo(dAtA []byte) (int, error)
- func (m *RoleResources) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*RoleResources) ProtoMessage()
- func (m *RoleResources) Reset()
- func (m *RoleResources) Size() (n int)
- func (this *RoleResources) String() string
- func (m *RoleResources) Unmarshal(dAtA []byte) error
- func (m *RoleResources) XXX_DiscardUnknown()
- func (m *RoleResources) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *RoleResources) XXX_Merge(src proto.Message)
- func (m *RoleResources) XXX_Size() int
- func (m *RoleResources) XXX_Unmarshal(b []byte) error
- type ServiceAccountReference
- func (in *ServiceAccountReference) DeepCopy() *ServiceAccountReference
- func (in *ServiceAccountReference) DeepCopyInto(out *ServiceAccountReference)
- func (*ServiceAccountReference) Descriptor() ([]byte, []int)
- func (m *ServiceAccountReference) Marshal() (dAtA []byte, err error)
- func (m *ServiceAccountReference) MarshalTo(dAtA []byte) (int, error)
- func (m *ServiceAccountReference) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*ServiceAccountReference) ProtoMessage()
- func (m *ServiceAccountReference) Reset()
- func (m *ServiceAccountReference) Size() (n int)
- func (this *ServiceAccountReference) String() string
- func (m *ServiceAccountReference) Unmarshal(dAtA []byte) error
- func (m *ServiceAccountReference) XXX_DiscardUnknown()
- func (m *ServiceAccountReference) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ServiceAccountReference) XXX_Merge(src proto.Message)
- func (m *ServiceAccountReference) XXX_Size() int
- func (m *ServiceAccountReference) XXX_Unmarshal(b []byte) error
Constants ¶
const ( // AnnotationKeyManaged is an annotation key that can be set on a // ServiceAccount, Role, or RoleBinding to indicate that it is managed by // Kargo. AnnotationKeyManaged = "rbac.kargo.akuity.io/managed" // AnnotationKeyOIDCClaimNamePrefix is the prefix of an annotation key that // can be set on a ServiceAccount to associate it with any user authenticated // via OIDC and having the claim indicated by the full annotation key with // any of the values indicated by the annotation. The value of the annotation // may be either a scalar string value or a comma-separated list. // A string representation of a JSON object in the AnnotationKeyOIDCClaims // is the preferred method. AnnotationKeyOIDCClaimNamePrefix = "rbac.kargo.akuity.io/claim." // AnnotationKeyOIDCClaims is an annotation key that can be set on a // ServiceAccount to associate it with any user authenticated via OIDC and // having any of the claims indicated by the value of the annotation. The // value is expected to be a string representation of a JSON object containing // claim names as keys mapped to claim values represented as lists of strings. // // For example: // // `{"email": ["kilgore@kilgore.trout"], "groups": ["devops", "maintainers"]}` AnnotationKeyOIDCClaims = "rbac.kargo.akuity.io/claims" // AnnotationValueTrue is a value that can be set on an annotation to indicate // that it applies. AnnotationValueTrue = "true" )
const ( // LabelKeyAPIToken can be used to mark a Kubernetes Secret as a // token for the Kargo API. LabelKeyAPIToken = "rbac.kargo.akuity.io/api-token" // nolint: gosec // LabelKeySystemRole can be used to mark a ServiceAccount in Kargo's own // namespace as a "system role". LabelKeySystemRole = "rbac.kargo.akuity.io/system-role" // LabelValueTrue is used to identify a label that has a value of "true". LabelValueTrue = "true" )
Variables ¶
var ( ErrInvalidLengthGenerated = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowGenerated = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupGenerated = fmt.Errorf("proto: unexpected end of group") )
var ( // GroupVersion is group version used to register these objects GroupVersion = schema.GroupVersion{ Group: "rbac.kargo.akuity.io", Version: "v1alpha1", } // SchemeBuilder is used to add go types to the GroupVersionKind scheme SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) // AddToScheme adds the types in this group-version to the given scheme. AddToScheme = SchemeBuilder.AddToScheme )
Functions ¶
func AnnotationKeyOIDCClaim ¶
func OIDCClaimsFromAnnotationValues ¶
OIDCClaimsFromAnnotationValue parses the values of the newer, preferred rbac.kargo.akuity.io/claims annotation as well as the values of older annotations with keys of the form rbac.kargo.akuity.io/claim.<name> and consolidates them into a single map of claim names to (deduped) claim values describing the set of users mapped to some ServiceAccount.
func SetOIDCClaimsAnnotation ¶
func SetOIDCClaimsAnnotation(sa *corev1.ServiceAccount, claims map[string][]string) error
SetOIDCClaimsAnnotation marshals the provided map of claims to claim values and writes its string representation as the value of the ServiceAccount's rbac.kargo.akuity.io/claims annotation, which is the newer, preferred method of mapping users to ServiceAccounts. This function also removes any annotations with keys of the form rbac.kargo.akuity.io/claim.<name> (the older method) from the ServiceAccount.
Types ¶
type Claim ¶
type Claim struct {
Name string `json:"name,omitempty" protobuf:"bytes,1,opt,name=name"`
Values []string `json:"values,omitempty" protobuf:"bytes,2,rep,name=values"`
} // @name Claim
func (*Claim) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Claim.
func (*Claim) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*Claim) Descriptor ¶
func (*Claim) ProtoMessage ¶
func (*Claim) ProtoMessage()
func (*Claim) XXX_DiscardUnknown ¶
func (m *Claim) XXX_DiscardUnknown()
func (*Claim) XXX_Marshal ¶
func (*Claim) XXX_Unmarshal ¶
type ResourceDetails ¶
type ResourceDetails struct {
ResourceType string `json:"resourceType,omitempty" protobuf:"bytes,1,opt,name=resourceType"`
ResourceName string `json:"resourceName,omitempty" protobuf:"bytes,2,opt,name=resourceName"`
Verbs []string `json:"verbs,omitempty" protobuf:"bytes,3,rep,name=verbs"`
} // @name ResourceDetails
func (*ResourceDetails) DeepCopy ¶
func (in *ResourceDetails) DeepCopy() *ResourceDetails
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceDetails.
func (*ResourceDetails) DeepCopyInto ¶
func (in *ResourceDetails) DeepCopyInto(out *ResourceDetails)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*ResourceDetails) Descriptor ¶
func (*ResourceDetails) Descriptor() ([]byte, []int)
func (*ResourceDetails) Marshal ¶
func (m *ResourceDetails) Marshal() (dAtA []byte, err error)
func (*ResourceDetails) MarshalToSizedBuffer ¶
func (m *ResourceDetails) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*ResourceDetails) ProtoMessage ¶
func (*ResourceDetails) ProtoMessage()
func (*ResourceDetails) Reset ¶
func (m *ResourceDetails) Reset()
func (*ResourceDetails) Size ¶
func (m *ResourceDetails) Size() (n int)
func (*ResourceDetails) String ¶
func (this *ResourceDetails) String() string
func (*ResourceDetails) Unmarshal ¶
func (m *ResourceDetails) Unmarshal(dAtA []byte) error
func (*ResourceDetails) XXX_DiscardUnknown ¶
func (m *ResourceDetails) XXX_DiscardUnknown()
func (*ResourceDetails) XXX_Marshal ¶
func (m *ResourceDetails) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ResourceDetails) XXX_Merge ¶
func (m *ResourceDetails) XXX_Merge(src proto.Message)
func (*ResourceDetails) XXX_Size ¶
func (m *ResourceDetails) XXX_Size() int
func (*ResourceDetails) XXX_Unmarshal ¶
func (m *ResourceDetails) XXX_Unmarshal(b []byte) error
type Role ¶
type Role struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
KargoManaged bool `json:"kargoManaged,omitempty" protobuf:"varint,2,opt,name=kargoManaged"`
Claims []Claim `json:"claims,omitempty" protobuf:"bytes,7,rep,name=claims"`
Rules []rbacv1.PolicyRule `json:"rules,omitempty" protobuf:"bytes,6,rep,name=rules"`
}
+kubebuilder:object:root=true
func (*Role) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Role.
func (*Role) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*Role) DeepCopyObject ¶
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (*Role) Descriptor ¶
func (*Role) ProtoMessage ¶
func (*Role) ProtoMessage()
func (*Role) XXX_DiscardUnknown ¶
func (m *Role) XXX_DiscardUnknown()
func (*Role) XXX_Unmarshal ¶
type RoleResources ¶
type RoleResources struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
ServiceAccount corev1.ServiceAccount `json:"serviceAccount,omitempty" protobuf:"bytes,2,opt,name=serviceAccount"`
Roles []rbacv1.Role `json:"roles,omitempty" protobuf:"bytes,3,rep,name=roles"`
ClusterRoles []rbacv1.ClusterRole `json:"clusterRoles,omitempty" protobuf:"bytes,5,rep,name=clusterRoles"`
RoleBindings []rbacv1.RoleBinding `json:"roleBindings,omitempty" protobuf:"bytes,4,rep,name=roleBindings"`
}
+kubebuilder:object:root=true
func (*RoleResources) DeepCopy ¶
func (in *RoleResources) DeepCopy() *RoleResources
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RoleResources.
func (*RoleResources) DeepCopyInto ¶
func (in *RoleResources) DeepCopyInto(out *RoleResources)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*RoleResources) DeepCopyObject ¶
func (in *RoleResources) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (*RoleResources) Descriptor ¶
func (*RoleResources) Descriptor() ([]byte, []int)
func (*RoleResources) Marshal ¶
func (m *RoleResources) Marshal() (dAtA []byte, err error)
func (*RoleResources) MarshalToSizedBuffer ¶
func (m *RoleResources) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*RoleResources) ProtoMessage ¶
func (*RoleResources) ProtoMessage()
func (*RoleResources) Reset ¶
func (m *RoleResources) Reset()
func (*RoleResources) Size ¶
func (m *RoleResources) Size() (n int)
func (*RoleResources) String ¶
func (this *RoleResources) String() string
func (*RoleResources) Unmarshal ¶
func (m *RoleResources) Unmarshal(dAtA []byte) error
func (*RoleResources) XXX_DiscardUnknown ¶
func (m *RoleResources) XXX_DiscardUnknown()
func (*RoleResources) XXX_Marshal ¶
func (m *RoleResources) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*RoleResources) XXX_Merge ¶
func (m *RoleResources) XXX_Merge(src proto.Message)
func (*RoleResources) XXX_Size ¶
func (m *RoleResources) XXX_Size() int
func (*RoleResources) XXX_Unmarshal ¶
func (m *RoleResources) XXX_Unmarshal(b []byte) error
type ServiceAccountReference ¶
type ServiceAccountReference struct {
Name string `json:"name,omitempty" protobuf:"bytes,1,opt,name=name"`
Namespace string `json:"namespace,omitempty" protobuf:"bytes,2,opt,name=namespace"`
}
func (*ServiceAccountReference) DeepCopy ¶
func (in *ServiceAccountReference) DeepCopy() *ServiceAccountReference
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceAccountReference.
func (*ServiceAccountReference) DeepCopyInto ¶
func (in *ServiceAccountReference) DeepCopyInto(out *ServiceAccountReference)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*ServiceAccountReference) Descriptor ¶
func (*ServiceAccountReference) Descriptor() ([]byte, []int)
func (*ServiceAccountReference) Marshal ¶
func (m *ServiceAccountReference) Marshal() (dAtA []byte, err error)
func (*ServiceAccountReference) MarshalTo ¶
func (m *ServiceAccountReference) MarshalTo(dAtA []byte) (int, error)
func (*ServiceAccountReference) MarshalToSizedBuffer ¶
func (m *ServiceAccountReference) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*ServiceAccountReference) ProtoMessage ¶
func (*ServiceAccountReference) ProtoMessage()
func (*ServiceAccountReference) Reset ¶
func (m *ServiceAccountReference) Reset()
func (*ServiceAccountReference) Size ¶
func (m *ServiceAccountReference) Size() (n int)
func (*ServiceAccountReference) String ¶
func (this *ServiceAccountReference) String() string
func (*ServiceAccountReference) Unmarshal ¶
func (m *ServiceAccountReference) Unmarshal(dAtA []byte) error
func (*ServiceAccountReference) XXX_DiscardUnknown ¶
func (m *ServiceAccountReference) XXX_DiscardUnknown()
func (*ServiceAccountReference) XXX_Marshal ¶
func (m *ServiceAccountReference) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ServiceAccountReference) XXX_Merge ¶
func (m *ServiceAccountReference) XXX_Merge(src proto.Message)
func (*ServiceAccountReference) XXX_Size ¶
func (m *ServiceAccountReference) XXX_Size() int
func (*ServiceAccountReference) XXX_Unmarshal ¶
func (m *ServiceAccountReference) XXX_Unmarshal(b []byte) error