mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-23 05:18:46 +00:00
chore: Service Account Naming Consistency (#11557)
# Which Problems Are Solved Inconsistent naming of service account, found in the following variations: - Machine User - machine user - Service User - Machine Account - Technical Account - User: Type Machine # How the Problems Are Solved Attentive search and replace. Localizations have been translated using Copilot # Additional Changes Some unused methods have been removed from the Go code. # Additional Context - Closes #11285
This commit is contained in:
@@ -29,7 +29,7 @@ func TestServer_ListAdministrators(t *testing.T) {
|
||||
organizationAdmin2 := createOrganizationAdministrator(iamOwnerCtx, instanceQuery, organizationResp.GetOrganizationId(), organizationName, t)
|
||||
organizationAdmin3 := createOrganizationAdministrator(iamOwnerCtx, instanceQuery, organizationResp.GetOrganizationId(), organizationName, t)
|
||||
|
||||
// Additionally, a machine user as a project grant owner to test permissions
|
||||
// Additionally, a service account as a project grant owner to test permissions
|
||||
userOrganizationResp := instanceQuery.CreateMachineUser(iamOwnerCtx)
|
||||
instanceQuery.CreateOrgMembership(t, iamOwnerCtx, organizationResp.GetOrganizationId(), userOrganizationResp.GetUserId())
|
||||
patOrganizationResp := instanceQuery.CreatePersonalAccessToken(iamOwnerCtx, userOrganizationResp.GetUserId())
|
||||
@@ -42,7 +42,7 @@ func TestServer_ListAdministrators(t *testing.T) {
|
||||
projectAdministrator2 := createProjectAdministrator(iamOwnerCtx, instanceQuery, t, organizationResp.GetOrganizationId(), projectResp.GetId(), projectName)
|
||||
projectAdministrator3 := createProjectAdministrator(iamOwnerCtx, instanceQuery, t, organizationResp.GetOrganizationId(), projectResp.GetId(), projectName)
|
||||
|
||||
// Additionally, a machine user as a project owner to test permissions
|
||||
// Additionally, a service account as a project owner to test permissions
|
||||
userProjectResp := instanceQuery.CreateMachineUser(iamOwnerCtx)
|
||||
instanceQuery.CreateProjectMembership(t, iamOwnerCtx, projectResp.GetId(), userProjectResp.GetUserId())
|
||||
patProjectResp := instanceQuery.CreatePersonalAccessToken(iamOwnerCtx, userProjectResp.GetUserId())
|
||||
@@ -56,7 +56,7 @@ func TestServer_ListAdministrators(t *testing.T) {
|
||||
projectGrantAdministrator2 := createProjectGrantAdministrator(iamOwnerCtx, instanceQuery, t, organizationResp.GetOrganizationId(), projectResp.GetId(), projectName, grantedOrganizationResp.GetOrganizationId())
|
||||
projectGrantAdministrator3 := createProjectGrantAdministrator(iamOwnerCtx, instanceQuery, t, organizationResp.GetOrganizationId(), projectResp.GetId(), projectName, grantedOrganizationResp.GetOrganizationId())
|
||||
|
||||
// Additionally, a machine user as a project grant owner to test permissions
|
||||
// Additionally, a service account as a project grant owner to test permissions
|
||||
userProjectGrantResp := instanceQuery.CreateMachineUser(iamOwnerCtx)
|
||||
instanceQuery.CreateProjectGrantMembership(t, iamOwnerCtx, projectResp.GetId(), grantedOrganizationResp.GetOrganizationId(), userProjectGrantResp.GetUserId())
|
||||
patProjectGrantResp := instanceQuery.CreatePersonalAccessToken(iamOwnerCtx, userProjectGrantResp.GetUserId())
|
||||
@@ -845,7 +845,7 @@ func TestServer_ListAdministrators_PermissionV2(t *testing.T) {
|
||||
organizationAdmin2 := createOrganizationAdministrator(iamOwnerCtx, instancePermissionV2, organizationResp.GetOrganizationId(), organizationName, t)
|
||||
organizationAdmin3 := createOrganizationAdministrator(iamOwnerCtx, instancePermissionV2, organizationResp.GetOrganizationId(), organizationName, t)
|
||||
|
||||
// Additionally, a machine user as a project grant owner to test permissions
|
||||
// Additionally, a service account as a project grant owner to test permissions
|
||||
userOrganizationResp := instancePermissionV2.CreateMachineUser(iamOwnerCtx)
|
||||
instancePermissionV2.CreateOrgMembership(t, iamOwnerCtx, organizationResp.GetOrganizationId(), userOrganizationResp.GetUserId())
|
||||
patOrganizationResp := instancePermissionV2.CreatePersonalAccessToken(iamOwnerCtx, userOrganizationResp.GetUserId())
|
||||
@@ -858,7 +858,7 @@ func TestServer_ListAdministrators_PermissionV2(t *testing.T) {
|
||||
projectAdministrator2 := createProjectAdministrator(iamOwnerCtx, instancePermissionV2, t, organizationResp.GetOrganizationId(), projectResp.GetId(), projectName)
|
||||
projectAdministrator3 := createProjectAdministrator(iamOwnerCtx, instancePermissionV2, t, organizationResp.GetOrganizationId(), projectResp.GetId(), projectName)
|
||||
|
||||
// Additionally, a machine user as a project owner to test permissions
|
||||
// Additionally, a service account as a project owner to test permissions
|
||||
userProjectResp := instancePermissionV2.CreateMachineUser(iamOwnerCtx)
|
||||
instancePermissionV2.CreateProjectMembership(t, iamOwnerCtx, projectResp.GetId(), userProjectResp.GetUserId())
|
||||
patProjectResp := instancePermissionV2.CreatePersonalAccessToken(iamOwnerCtx, userProjectResp.GetUserId())
|
||||
@@ -872,7 +872,7 @@ func TestServer_ListAdministrators_PermissionV2(t *testing.T) {
|
||||
projectGrantAdministrator2 := createProjectGrantAdministrator(iamOwnerCtx, instancePermissionV2, t, organizationResp.GetOrganizationId(), projectResp.GetId(), projectName, grantedOrganizationResp.GetOrganizationId())
|
||||
projectGrantAdministrator3 := createProjectGrantAdministrator(iamOwnerCtx, instancePermissionV2, t, organizationResp.GetOrganizationId(), projectResp.GetId(), projectName, grantedOrganizationResp.GetOrganizationId())
|
||||
|
||||
// Additionally, a machine user as a project grant owner to test permissions
|
||||
// Additionally, a service account as a project grant owner to test permissions
|
||||
userProjectGrantResp := instancePermissionV2.CreateMachineUser(iamOwnerCtx)
|
||||
instancePermissionV2.CreateProjectGrantMembership(t, iamOwnerCtx, projectResp.GetId(), grantedOrganizationResp.GetOrganizationId(), userProjectGrantResp.GetUserId())
|
||||
patProjectGrantResp := instancePermissionV2.CreatePersonalAccessToken(iamOwnerCtx, userProjectGrantResp.GetUserId())
|
||||
|
||||
@@ -221,7 +221,7 @@ func TestServer_CreateProject_Permission(t *testing.T) {
|
||||
}
|
||||
|
||||
func getOrgProjectCreatorToken(t *testing.T, ctx context.Context, orgId1, orgId2 string) string {
|
||||
// create a machine user in Org 1
|
||||
// create a service account in Org 1
|
||||
userResp := instance.CreateUserTypeMachine(ctx, orgId1)
|
||||
|
||||
// assign ORG_PROJECT_CREATOR role in Org 2
|
||||
@@ -970,7 +970,6 @@ func TestServer_ActivateProject(t *testing.T) {
|
||||
name: "not existing",
|
||||
prepare: func(request *project.ActivateProjectRequest) {
|
||||
request.ProjectId = "notexisting"
|
||||
return
|
||||
},
|
||||
args: args{
|
||||
ctx: iamOwnerCtx,
|
||||
|
||||
@@ -200,7 +200,7 @@ func TestServer_CreateProject_Permission(t *testing.T) {
|
||||
}
|
||||
|
||||
func getOrgProjectCreatorToken(t *testing.T, ctx context.Context, orgId1, orgId2 string) string {
|
||||
// create a machine user in Org 1
|
||||
// create a service account in Org 1
|
||||
userResp := instance.CreateUserTypeMachine(ctx, orgId1)
|
||||
|
||||
// assign ORG_PROJECT_CREATOR role in Org 2
|
||||
@@ -953,7 +953,6 @@ func TestServer_ActivateProject(t *testing.T) {
|
||||
name: "not existing",
|
||||
prepare: func(request *project.ActivateProjectRequest) {
|
||||
request.Id = "notexisting"
|
||||
return
|
||||
},
|
||||
args: args{
|
||||
ctx: iamOwnerCtx,
|
||||
|
||||
@@ -824,7 +824,7 @@ func Test_UsersToPb(t *testing.T) {
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "slice with one machine user",
|
||||
name: "slice with one service account",
|
||||
args: args{
|
||||
users: []*query.User{
|
||||
{
|
||||
|
||||
@@ -398,7 +398,7 @@ func TestServer_ListUsers(t *testing.T) {
|
||||
wantErr bool
|
||||
}{
|
||||
{
|
||||
name: "list user by id, no permission machine user",
|
||||
name: "list user by id, no permission service account",
|
||||
args: args{
|
||||
InstancePermissionV2.WithAuthorizationToken(OrgCTX, integration.UserTypeNoPermission),
|
||||
&user.ListUsersRequest{},
|
||||
|
||||
@@ -3358,7 +3358,7 @@ func TestServer_CreateUser(t *testing.T) {
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "machine user",
|
||||
name: "service account",
|
||||
testCase: func(runId string) testCase {
|
||||
username := fmt.Sprintf("donald.duck+%s", runId)
|
||||
return testCase{
|
||||
@@ -3577,7 +3577,7 @@ func TestServer_CreateUser_And_Compare(t *testing.T) {
|
||||
}
|
||||
},
|
||||
}, {
|
||||
name: "machine username given",
|
||||
name: "service accountname given",
|
||||
testCase: func(runId string) testCase {
|
||||
username := fmt.Sprintf("donald.duck+%s", runId)
|
||||
return testCase{
|
||||
@@ -3599,7 +3599,7 @@ func TestServer_CreateUser_And_Compare(t *testing.T) {
|
||||
}
|
||||
},
|
||||
}, {
|
||||
name: "machine username default to generated id",
|
||||
name: "service accountname default to generated id",
|
||||
testCase: func(runId string) testCase {
|
||||
return testCase{
|
||||
args: args{
|
||||
@@ -3619,7 +3619,7 @@ func TestServer_CreateUser_And_Compare(t *testing.T) {
|
||||
}
|
||||
},
|
||||
}, {
|
||||
name: "machine username default to given id",
|
||||
name: "service accountname default to given id",
|
||||
testCase: func(runId string) testCase {
|
||||
return testCase{
|
||||
args: args{
|
||||
@@ -3795,7 +3795,7 @@ func TestServer_CreateUser_Permission(t *testing.T) {
|
||||
wantErr: true,
|
||||
},
|
||||
{
|
||||
name: "machine user, error",
|
||||
name: "service account, error",
|
||||
args: args{
|
||||
UserCTX,
|
||||
&user.CreateUserRequest{
|
||||
@@ -4150,7 +4150,7 @@ func TestServer_UpdateUserTypeMachine(t *testing.T) {
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "update machine user with human fields, error",
|
||||
name: "update service account with human fields, error",
|
||||
testCase: func(runId, userId string) testCase {
|
||||
return testCase{
|
||||
args: args{
|
||||
@@ -4280,7 +4280,7 @@ func TestServer_UpdateUser_And_Compare(t *testing.T) {
|
||||
}
|
||||
},
|
||||
}, {
|
||||
name: "machine username",
|
||||
name: "service accountname",
|
||||
testCase: func(runId string) testCase {
|
||||
username := fmt.Sprintf("donald.duck+%s", runId)
|
||||
return testCase{
|
||||
@@ -4493,7 +4493,7 @@ func TestServer_UpdateUser_Permission(t *testing.T) {
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "machine user, error",
|
||||
name: "service account, error",
|
||||
testCase: func() testCase {
|
||||
return testCase{
|
||||
args: args{
|
||||
|
||||
@@ -393,7 +393,7 @@ func TestServer_ListUsers(t *testing.T) {
|
||||
wantErr bool
|
||||
}{
|
||||
{
|
||||
name: "list user by id, no permission machine user",
|
||||
name: "list user by id, no permission service account",
|
||||
args: args{
|
||||
UserCTX,
|
||||
&user_v2beta.ListUsersRequest{},
|
||||
|
||||
Reference in New Issue
Block a user