Skip to content

Commit

Permalink
fix(sa): only sync active service accounts (#311)
Browse files Browse the repository at this point in the history
Refs: CPLP-3312
Reviewed-by: Norbert Truchsess <[email protected]>
  • Loading branch information
Phil91 authored Oct 24, 2023
1 parent 5342eda commit ce34d82
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,8 @@ public IAsyncEnumerable<CompanyUserIdentityProviderProcessData> GetUserAssignedI
.Where(x =>
x.IdentityTypeId == IdentityTypeId.COMPANY_SERVICE_ACCOUNT &&
x.UserEntityId == null &&
x.CompanyServiceAccount!.ClientClientId != null)
x.CompanyServiceAccount!.ClientClientId != null &&
x.UserStatusId == UserStatusId.ACTIVE)
.Select(x => new ValueTuple<Guid, string>(x.Id, x.CompanyServiceAccount!.ClientClientId!))
.Take(2)
.ToAsyncEnumerable();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
"company_id": "41fd2ab8-71cd-4546-9bef-a388d91b2543",
"client_client_id": "sa-x-2"
},

{
"id": "cd436931-8399-4c1d-bd81-7dffb298c7ca",
"name": "test-user-service-accounts",
Expand All @@ -50,6 +49,14 @@
"offer_subscription_id": null,
"company_id": "2dc4249f-b5ca-4d42-bef1-7a7a950a4f8",
"client_client_id": "sa-x-3"
},
{
"id": "38c92162-6328-40ce-80f3-22e3f3e9b94d",
"name": "sa-inactive",
"description": "inactive service account",
"company_service_account_type_id": 1,
"offer_subscription_id": null,
"company_id": "729e0af2-6723-4a7f-85a1-833d84b39bdf",
"client_client_id": "sa-x-inactive"
}

]
Original file line number Diff line number Diff line change
Expand Up @@ -150,5 +150,13 @@
"user_status_id": 1,
"user_entity_id": null,
"identity_type_id": 1
},
{
"id": "38c92162-6328-40ce-80f3-22e3f3e9b94d",
"date_created": "2022-06-01 18:01:33.439000 +00:00",
"company_id": "729e0af2-6723-4a7f-85a1-833d84b39bdf",
"user_status_id": 2,
"user_entity_id": null,
"identity_type_id": 2
}
]

0 comments on commit ce34d82

Please sign in to comment.