AuthN: Introduce DefaultOrgID function for managed service accounts (#93432)

* Managed Service Accounts: Use AutoAssignOrgID

* Fix the IsExternalServiceAccount function

* Reassign service account role

* Account for AutoAssignOrg

* Update pkg/services/serviceaccounts/models.go

* Simplify IsExternalServiceAccount function

* Add tests

* Easier to understand test

* Revert small change
This commit is contained in:
Gabriel MABILLE
2024-09-20 14:43:29 +02:00
committed by GitHub
parent bb69afed7c
commit 8d84517103
12 changed files with 192 additions and 122 deletions
@@ -103,10 +103,10 @@ func TestAccessControlStore_SaveExternalServiceRole(t *testing.T) {
{
cmd: accesscontrol.SaveExternalServiceRoleCommand{
ExternalServiceID: "app1",
AssignmentOrgID: 1,
AssignmentOrgID: 2,
ServiceAccountID: 2,
},
wantErr: true,
wantErr: false,
},
},
},