RBAC: Add legacy authorization checks to teams (#94524)

* Setup team authorization for teams

* Add list filter for teams
This commit is contained in:
Karl Persson
2024-10-10 16:47:31 +02:00
committed by GitHub
parent 315778227b
commit 86fc8da703
7 changed files with 170 additions and 55 deletions
+9
View File
@@ -1,6 +1,8 @@
package v0alpha1
import (
"fmt"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
@@ -15,6 +17,13 @@ type Team struct {
type TeamSpec struct {
Title string `json:"title,omitempty"`
Email string `json:"email,omitempty"`
// This is currently used for authorization checks but we don't want to expose it
InternalID int64 `json:"-"`
}
func (t Team) AuthID() string {
return fmt.Sprintf("%d", t.Spec.InternalID)
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object