Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions api/clusters/v1alpha1/accessrequest_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ type AccessRequestSpec struct {
}

type PermissionsRequest struct {
// Name is an optional name for the (Cluster)Role that will be created for the requested permissions.
// If not set, a randomized name that is unique in the cluster will be generated.
// Note that the AccessRequest will not be granted if the to-be-created (Cluster)Role already exists, but is not managed by the AccessRequest, so choose this name carefully.
// +optional
Name string `json:"name,omitempty"`

// Namespace is the namespace for which the permissions are requested.
// If empty, this will result in a ClusterRole, otherwise in a Role in the respective namespace.
// Note that for a Role, the namespace needs to either exist or a permission to create it must be included in the requested permissions (it will be created automatically then), otherwise the request will be rejected.
Expand Down
9 changes: 9 additions & 0 deletions api/clusters/v1alpha1/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,13 @@ const (
// SecretKeyCreationTimestamp is the name of the key in the AccessRequest secret that contains the creation timestamp.
// This value is optional and must not be set for non-expiring authentication methods.
SecretKeyCreationTimestamp = "creationTimestamp"
// SecretKeyCAData is the name of the key in the AccessRequest secret that contains the CA data.
// This value is optional and must not be set.
SecretKeyCAData = "caData"
// SecretKeyHost is the name of the key in the AccessRequest secret that contains the host.
// This value is optional and must not be set.
SecretKeyHost = "host"
// SecretKeyClientID is the name of the key in the AccessRequest secret that contains the client ID.
// This value is optional and must not be set for non-OIDC-based authentication methods.
SecretKeyClientID = "clientID"
)
6 changes: 6 additions & 0 deletions api/crds/manifests/clusters.openmcp.cloud_accessrequests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,12 @@ spec:
For token-based access, the serviceaccount will be bound to the created Roles and ClusterRoles.
items:
properties:
name:
description: |-
Name is an optional name for the (Cluster)Role that will be created for the requested permissions.
If not set, a randomized name that is unique in the cluster will be generated.
Note that the AccessRequest will not be granted if the to-be-created (Cluster)Role already exists, but is not managed by the AccessRequest, so choose this name carefully.
type: string
namespace:
description: |-
Namespace is the namespace for which the permissions are requested.
Expand Down