-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: rename to v1.Permission to v1.PlaybookPermission [skip ci]
- Loading branch information
1 parent
4c65ec6
commit 122c08d
Showing
11 changed files
with
764 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package v1 | ||
|
||
import ( | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
) | ||
|
||
//+kubebuilder:object:root=true | ||
//+kubebuilder:subresource:status | ||
|
||
// PermissionGroup is the Schema for the Mission Control Permission Groups | ||
type PermissionGroup struct { | ||
metav1.TypeMeta `json:",inline" yaml:",inline"` | ||
metav1.ObjectMeta `json:"metadata,omitempty" yaml:"metadata,omitempty"` | ||
|
||
Spec PermissionGroupSpec `json:"spec,omitempty" yaml:"spec,omitempty"` | ||
Status PermissionGroupStatus `json:"status,omitempty" yaml:"status,omitempty"` | ||
} | ||
|
||
// +kubebuilder:object:generate=true | ||
type PermissionGroupSpec struct { | ||
PermissionGroupSubjects `json:",inline" yaml:",inline"` | ||
|
||
// Name for the group | ||
Name string `json:"name"` | ||
} | ||
|
||
type PermissionGroupStatus struct { | ||
} | ||
|
||
// +kubebuilder:object:generate=true | ||
type PermissionGroupSubjects struct { | ||
Notifications []PermissionGroupSelector `json:"notifications,omitempty"` | ||
People []PermissionGroupSelector `json:"people,omitempty"` | ||
Teams []PermissionGroupSelector `json:"teams,omitempty"` | ||
} | ||
|
||
// +kubebuilder:object:generate=true | ||
type PermissionGroupSelector struct { | ||
Namespaces string `json:"namespace,omitempty"` | ||
Name string `json:"name,omitempty"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
package v1 | ||
|
||
import ( | ||
"github.com/flanksource/duty/types" | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
) | ||
|
||
//+kubebuilder:object:root=true | ||
//+kubebuilder:subresource:status | ||
|
||
// Permission is the Schema for the Mission Control Permission | ||
type Permission struct { | ||
metav1.TypeMeta `json:",inline" yaml:",inline"` | ||
metav1.ObjectMeta `json:"metadata,omitempty" yaml:"metadata,omitempty"` | ||
|
||
Spec PermissionSpec `json:"spec,omitempty" yaml:"spec,omitempty"` | ||
Status PermissionStatus `json:"status,omitempty" yaml:"status,omitempty"` | ||
} | ||
|
||
// Subject of the permission. | ||
// Can be | ||
// - a permission group name | ||
// - id of a resource | ||
// - <namespace>/<name> of a resource | ||
type PermissionSubjectSelector string | ||
|
||
type PermissionSubject struct { | ||
Person PermissionSubjectSelector `json:"person,omitempty"` | ||
Team PermissionSubjectSelector `json:"team,omitempty"` | ||
Notification PermissionSubjectSelector `json:"notification,omitempty"` | ||
} | ||
|
||
type PermissionObject struct { | ||
Playbooks []types.ResourceSelector `json:"playbooks,omitempty"` | ||
Configs []types.ResourceSelector `json:"configs,omitempty"` | ||
Components []types.ResourceSelector `json:"components,omitempty"` | ||
} | ||
|
||
// +kubebuilder:object:generate=true | ||
type PermissionSpec struct { | ||
// Description provides a brief explanation of the permission. | ||
Description string `json:"description,omitempty"` | ||
|
||
// Action specifies the operation that the permission allows or denies. | ||
Action string `json:"action"` | ||
|
||
// Subject defines the entity (e.g., user, group) to which the permission applies. | ||
Subject PermissionSubject `json:"subject"` | ||
|
||
// Object identifies the resource or object that the permission is associated with. | ||
Object PermissionObject `json:"object"` | ||
|
||
// Deny indicates whether the permission should explicitly deny the specified action. | ||
// | ||
// Default: false | ||
Deny bool `json:"deny,omitempty"` | ||
|
||
// List of agent ids whose configs/components are accessible to a person when RLS is enabled | ||
Agents []string `json:"agents,omitempty"` | ||
|
||
// List of config/component tags a person is allowed to access to when RLS is enabled | ||
Tags map[string]string `json:"tags,omitempty"` | ||
} | ||
|
||
type PermissionStatus struct { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.