Skip to content

Commit

Permalink
refactor: make Kargo Roles proper runtime objects (#1917)
Browse files Browse the repository at this point in the history
Signed-off-by: Kent Rancourt <[email protected]>
  • Loading branch information
krancour authored May 1, 2024
1 parent c6d0a6d commit af4feb5
Show file tree
Hide file tree
Showing 33 changed files with 3,826 additions and 2,422 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ codegen-controller:
rbac:roleName=manager-role \
crd \
webhook \
paths=./api/... \
paths=./api/v1alpha1/... \
output:crd:artifacts:config=charts/kargo/resources/crds
controller-gen \
object:headerFile=hack/boilerplate.go.txt \
Expand Down
1 change: 1 addition & 0 deletions api/buf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ lint:
- PACKAGE_DIRECTORY_MATCH
ignore:
- v1alpha1/generated.proto
- rbac/v1alpha1/generated.proto
allow_comment_ignores: true
breaking:
use:
Expand Down
33 changes: 33 additions & 0 deletions api/rbac/v1alpha1/annotations.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package v1alpha1

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"

// AnnotationKeyOIDCEmails is an annotation key that can be set on a
// ServiceAccount to associate it with a list of email addresses. The
// annotation is used to grant permissions to the ServiceAccount based on
// the email claim from a user who authenticates using OIDC.
// The value of the annotation should be a comma-separated list.
AnnotationKeyOIDCEmails = "rbac.kargo.akuity.io/email"

// AnnotationKeyOIDCGroups is an annotation key that can be set on a
// ServiceAccount to associate it with a list of groups from an OIDC
// provider. The annotation is used to grant permissions to the
// ServiceAccount based on the groups claim from a user who authenticates
// using OIDC.
// The value of the annotation should be a comma-separated list.
AnnotationKeyOIDCGroups = "rbac.kargo.akuity.io/groups"

// AnnotationKeyOIDCSubjects is an annotation key that can be set on a
// ServiceAccount to associate it with a list of subjects from an OIDC
// provider. The annotation is used to grant permissions to the
// ServiceAccount based on the subject claim from a user who authenticates
// using OIDC.
// The value of the annotation should be a comma-separated list.
AnnotationKeyOIDCSubjects = "rbac.kargo.akuity.io/sub"

AnnotationValueTrue = "true"
)
Loading

0 comments on commit af4feb5

Please sign in to comment.