IAM: Implement update method in team API (#111660)

* implement team update in legacy store

* add unit tests

* add integration test

* set permissions for user in integration tests

* add more integration tests for update

* update validations

* add unit tests for ValidateOnUpdate() func

* fix integration test
This commit is contained in:
Mihai Doarna
2025-10-03 12:48:38 +03:00
committed by GitHub
parent 76d467f285
commit 0f60e2208e
13 changed files with 484 additions and 7 deletions
+19
View File
@@ -60,6 +60,12 @@ func TestIdentityQueries(t *testing.T) {
return &v
}
updateTeam := func(cmd *UpdateTeamCommand) sqltemplate.SQLTemplate {
v := newUpdateTeam(nodb, cmd)
v.SQLTemplate = mocks.NewTestingSQLTemplate()
return &v
}
listTeams := func(q *ListTeamQuery) sqltemplate.SQLTemplate {
v := newListTeams(nodb, q)
v.SQLTemplate = mocks.NewTestingSQLTemplate()
@@ -393,6 +399,19 @@ func TestIdentityQueries(t *testing.T) {
}),
},
},
sqlUpdateTeamTemplate: {
{
Name: "update_team_basic",
Data: updateTeam(&UpdateTeamCommand{
UID: "team-1",
Name: "Team 1",
Email: "team1@example.com",
IsProvisioned: true,
ExternalUID: "team-1-uid",
Updated: NewDBTime(time.Date(2023, 1, 1, 12, 0, 0, 0, time.UTC)),
}),
},
},
sqlDeleteTeamTemplate: {
{
Name: "delete_team_basic",