IAM: Create Service Account API and legacy store impl (#110411)

* wip

* IAM: Create Service Account

* Add dual writer

* Update openapi_test.go

* Add integration tests

* Add sql tests

* Add Role to SA spec, add validation, add DBTime, add tests

* Format, update test

* Fixes

* Add check for External

* Address feedback

* Update tests

* Address feedback

* make gen-go

* Simplify a bit

* Fixes

* make update-workspace

* Update pkg/registry/apis/iam/serviceaccount/store.go

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>

* Address feedback, add test for generateName

---------

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
This commit is contained in:
Misi
2025-09-08 14:31:32 +02:00
committed by GitHub
co-authored by Ryan McKinley
parent 8a28381278
commit badea8bc37
46 changed files with 1961 additions and 198 deletions
@@ -1,6 +1,10 @@
package v0alpha1
ServiceAccountSpec: {
disabled: bool |* false
plugin: string
role: OrgRole
title: string
disabled: bool
}
OrgRole: "None" | "Viewer" | "Editor" | "Admin" @cuetsy(kind="enum")
@@ -2,13 +2,27 @@
package v0alpha1
// +k8s:openapi-gen=true
type ServiceAccountOrgRole string
const (
ServiceAccountOrgRoleNone ServiceAccountOrgRole = "None"
ServiceAccountOrgRoleViewer ServiceAccountOrgRole = "Viewer"
ServiceAccountOrgRoleEditor ServiceAccountOrgRole = "Editor"
ServiceAccountOrgRoleAdmin ServiceAccountOrgRole = "Admin"
)
// +k8s:openapi-gen=true
type ServiceAccountSpec struct {
Title string `json:"title"`
Disabled bool `json:"disabled"`
Disabled bool `json:"disabled"`
Plugin string `json:"plugin"`
Role ServiceAccountOrgRole `json:"role"`
Title string `json:"title"`
}
// NewServiceAccountSpec creates a new ServiceAccountSpec object.
func NewServiceAccountSpec() *ServiceAccountSpec {
return &ServiceAccountSpec{}
return &ServiceAccountSpec{
Disabled: false,
}
}
@@ -1877,13 +1877,6 @@ func schema_pkg_apis_iam_v0alpha1_ServiceAccountSpec(ref common.ReferenceCallbac
SchemaProps: spec.SchemaProps{
Type: []string{"object"},
Properties: map[string]spec.Schema{
"title": {
SchemaProps: spec.SchemaProps{
Default: "",
Type: []string{"string"},
Format: "",
},
},
"disabled": {
SchemaProps: spec.SchemaProps{
Default: false,
@@ -1891,8 +1884,29 @@ func schema_pkg_apis_iam_v0alpha1_ServiceAccountSpec(ref common.ReferenceCallbac
Format: "",
},
},
"plugin": {
SchemaProps: spec.SchemaProps{
Default: "",
Type: []string{"string"},
Format: "",
},
},
"role": {
SchemaProps: spec.SchemaProps{
Default: "",
Type: []string{"string"},
Format: "",
},
},
"title": {
SchemaProps: spec.SchemaProps{
Default: "",
Type: []string{"string"},
Format: "",
},
},
},
Required: []string{"title", "disabled"},
Required: []string{"disabled", "plugin", "role", "title"},
},
},
}