Skip to content

Commit 54c224d

Browse files
authored
IAM: Add the external field to the TeamBinding spec (grafana#112382)
* add the external field to the TeamBinding spec * fix unit tests
1 parent 2b4292f commit 54c224d

20 files changed

+303
-33
lines changed

apps/iam/go.mod

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,28 @@ replace github.com/grafana/grafana/apps/secret => ../secret
1212

1313
replace github.com/grafana/grafana/apps/provisioning => ../provisioning
1414

15+
replace github.com/grafana/grafana/apps/advisor => ../advisor
16+
17+
replace github.com/grafana/grafana/apps/alerting/alertenrichment => ../alerting/alertenrichment
18+
19+
replace github.com/grafana/grafana/apps/alerting/notifications => ../alerting/notifications
20+
21+
replace github.com/grafana/grafana/apps/alerting/rules => ../alerting/rules
22+
23+
replace github.com/grafana/grafana/apps/correlations => ../correlations
24+
25+
replace github.com/grafana/grafana/apps/investigations => ../investigations
26+
27+
replace github.com/grafana/grafana/apps/playlist => ../playlist
28+
29+
replace github.com/grafana/grafana/apps/plugins => ../plugins
30+
31+
replace github.com/grafana/grafana/apps/preferences => ../preferences
32+
33+
replace github.com/grafana/grafana/apps/scope => ../scope
34+
35+
replace github.com/grafana/grafana/apps/shorturl => ../shorturl
36+
1537
replace github.com/grafana/grafana/pkg/apimachinery => ../../pkg/apimachinery
1638

1739
replace github.com/grafana/grafana/pkg/apiserver => ../../pkg/apiserver
@@ -45,14 +67,14 @@ require (
4567
cuelang.org/go v0.11.1 // indirect
4668
dario.cat/mergo v1.0.2 // indirect
4769
filippo.io/edwards25519 v1.1.0 // indirect
48-
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.18.1 // indirect
49-
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.10.1 // indirect
50-
github.com/Azure/azure-sdk-for-go/sdk/internal v1.11.1 // indirect
70+
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.19.1 // indirect
71+
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.12.0 // indirect
72+
github.com/Azure/azure-sdk-for-go/sdk/internal v1.11.2 // indirect
5173
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.6.1 // indirect
5274
github.com/Azure/go-autorest v14.2.0+incompatible // indirect
5375
github.com/Azure/go-autorest/autorest/to v0.4.1 // indirect
5476
github.com/Azure/go-ntlmssp v0.0.0-20220621081337-cb9428e4ac1e // indirect
55-
github.com/AzureAD/microsoft-authentication-library-for-go v1.4.2 // indirect
77+
github.com/AzureAD/microsoft-authentication-library-for-go v1.5.0 // indirect
5678
github.com/BurntSushi/toml v1.5.0 // indirect
5779
github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.29.0 // indirect
5880
github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.51.0 // indirect
@@ -200,13 +222,13 @@ require (
200222
github.com/googleapis/enterprise-certificate-proxy v0.3.6 // indirect
201223
github.com/googleapis/gax-go/v2 v2.14.2 // indirect
202224
github.com/gorilla/mux v1.8.1 // indirect
203-
github.com/grafana/alerting v0.0.0-20251007160934-e642236ea9eb // indirect
225+
github.com/grafana/alerting v0.0.0-20251009192429-9427c24835ae // indirect
204226
github.com/grafana/authlib v0.0.0-20250930082137-a40e2c2b094f // indirect
205227
github.com/grafana/authlib/types v0.0.0-20250926065801-df98203cff37 // indirect
206228
github.com/grafana/dataplane/sdata v0.0.9 // indirect
207229
github.com/grafana/dskit v0.0.0-20250908063411-6b6da59b5cc4 // indirect
208230
github.com/grafana/grafana-aws-sdk v1.2.0 // indirect
209-
github.com/grafana/grafana-azure-sdk-go/v2 v2.2.0 // indirect
231+
github.com/grafana/grafana-azure-sdk-go/v2 v2.3.1 // indirect
210232
github.com/grafana/grafana-plugin-sdk-go v0.279.0 // indirect
211233
github.com/grafana/grafana/apps/dashboard v0.0.0 // indirect
212234
github.com/grafana/grafana/apps/provisioning v0.0.0 // indirect

apps/iam/go.sum

Lines changed: 236 additions & 12 deletions
Large diffs are not rendered by default.

apps/iam/kinds/v0alpha1/teambindingspec.cue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ TeamBindingSpec: {
1111

1212
// permission of the identity in the team
1313
permission: TeamPermission
14+
15+
external: bool
1416
}
1517

1618
TeamRef:{

apps/iam/pkg/apis/iam/v0alpha1/teambinding_spec_gen.go

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/iam/pkg/apis/iam/v0alpha1/zz_openapi_gen.go

Lines changed: 8 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/registry/apis/iam/legacy/team.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ func (s *legacySQLStore) ListTeamBindings(ctx context.Context, ns claims.Namespa
509509

510510
for rows.Next() {
511511
m := TeamMember{}
512-
err = rows.Scan(&m.ID, &m.TeamUID, &m.TeamID, &m.UserUID, &m.UserID, &m.Created, &m.Updated, &m.Permission)
512+
err = rows.Scan(&m.ID, &m.TeamUID, &m.TeamID, &m.UserUID, &m.UserID, &m.Created, &m.Updated, &m.Permission, &m.External)
513513
if err != nil {
514514
return res, err
515515
}

pkg/registry/apis/iam/legacy/team_bindings_query.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
SELECT tm.id as id, t.uid as team_uid, t.id as team_id, u.uid as user_uid, u.id as user_id, tm.created, tm.updated, tm.permission
1+
SELECT tm.id as id, t.uid as team_uid, t.id as team_id, u.uid as user_uid, u.id as user_id, tm.created, tm.updated, tm.permission, tm.external
22
FROM {{ .Ident .TeamMemberTable }} tm
33
INNER JOIN {{ .Ident .TeamTable }} t ON tm.team_id = t.id
44
INNER JOIN {{ .Ident .UserTable }} u ON tm.user_id = u.id

pkg/registry/apis/iam/legacy/testdata/mysql--team_bindings_query-team_bindings_id.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
SELECT tm.id as id, t.uid as team_uid, t.id as team_id, u.uid as user_uid, u.id as user_id, tm.created, tm.updated, tm.permission
1+
SELECT tm.id as id, t.uid as team_uid, t.id as team_id, u.uid as user_uid, u.id as user_id, tm.created, tm.updated, tm.permission, tm.external
22
FROM `grafana`.`team_member` tm
33
INNER JOIN `grafana`.`team` t ON tm.team_id = t.id
44
INNER JOIN `grafana`.`user` u ON tm.user_id = u.id

pkg/registry/apis/iam/legacy/testdata/mysql--team_bindings_query-team_bindings_page_1.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
SELECT tm.id as id, t.uid as team_uid, t.id as team_id, u.uid as user_uid, u.id as user_id, tm.created, tm.updated, tm.permission
1+
SELECT tm.id as id, t.uid as team_uid, t.id as team_id, u.uid as user_uid, u.id as user_id, tm.created, tm.updated, tm.permission, tm.external
22
FROM `grafana`.`team_member` tm
33
INNER JOIN `grafana`.`team` t ON tm.team_id = t.id
44
INNER JOIN `grafana`.`user` u ON tm.user_id = u.id

pkg/registry/apis/iam/legacy/testdata/mysql--team_bindings_query-team_bindings_page_2.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
SELECT tm.id as id, t.uid as team_uid, t.id as team_id, u.uid as user_uid, u.id as user_id, tm.created, tm.updated, tm.permission
1+
SELECT tm.id as id, t.uid as team_uid, t.id as team_id, u.uid as user_uid, u.id as user_id, tm.created, tm.updated, tm.permission, tm.external
22
FROM `grafana`.`team_member` tm
33
INNER JOIN `grafana`.`team` t ON tm.team_id = t.id
44
INNER JOIN `grafana`.`user` u ON tm.user_id = u.id

0 commit comments

Comments
 (0)