IAM: Refactor team bindings to store one pair of team and member (#111871)

* store one pair of team member in team bindings object

* generate queries for sql unit tests

* remove TeamBinding struct
This commit is contained in:
Mihai Doarna
2025-10-03 16:48:51 +03:00
committed by GitHub
parent e9499bb60c
commit 6d7c50f18d
16 changed files with 120 additions and 186 deletions
@@ -3737,20 +3737,23 @@
"com.github.grafana.grafana.apps.iam.pkg.apis.iam.v0alpha1.TeamBindingSpec": {
"type": "object",
"required": [
"subjects",
"teamRef"
"subject",
"teamRef",
"permission"
],
"properties": {
"subjects": {
"type": "array",
"items": {
"default": {},
"allOf": [
{
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.iam.pkg.apis.iam.v0alpha1.TeamBindingspecSubject"
}
]
}
"permission": {
"description": "permission of the identity in the team",
"type": "string",
"default": ""
},
"subject": {
"default": {},
"allOf": [
{
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.iam.pkg.apis.iam.v0alpha1.TeamBindingspecSubject"
}
]
},
"teamRef": {
"default": {},
@@ -3778,19 +3781,13 @@
"com.github.grafana.grafana.apps.iam.pkg.apis.iam.v0alpha1.TeamBindingspecSubject": {
"type": "object",
"required": [
"name",
"permission"
"name"
],
"properties": {
"name": {
"description": "uid of the identity",
"type": "string",
"default": ""
},
"permission": {
"description": "permission of the identity in the team",
"type": "string",
"default": ""
}
}
},
@@ -5594,15 +5591,18 @@
"github.com/grafana/grafana/apps/iam/pkg/apis/iam/v0alpha1.TeamBindingSpec": {
"type": "object",
"required": [
"subjects",
"teamRef"
"subject",
"teamRef",
"permission"
],
"properties": {
"subjects": {
"type": "array",
"items": {
"default": {}
}
"permission": {
"description": "permission of the identity in the team",
"type": "string",
"default": ""
},
"subject": {
"default": {}
},
"teamRef": {
"default": {}
@@ -5644,19 +5644,13 @@
"github.com/grafana/grafana/apps/iam/pkg/apis/iam/v0alpha1.TeamBindingspecSubject": {
"type": "object",
"required": [
"name",
"permission"
"name"
],
"properties": {
"name": {
"description": "uid of the identity",
"type": "string",
"default": ""
},
"permission": {
"description": "permission of the identity in the team",
"type": "string",
"default": ""
}
}
},