Skip to content

Commit

Permalink
feat(bpdm): add bpdm orchestrator roles and svc acc (#1048)
Browse files Browse the repository at this point in the history
* feat(seeder): add new BPDM service accounts, identities, user role assignments, and descriptions
Refs: #1020
* Add version updates
* Add changelog
* null user_entity_id variable
* Update descriptions
  • Loading branch information
typecastcloud authored Oct 7, 2024
1 parent 246e487 commit 0fbcb76
Show file tree
Hide file tree
Showing 10 changed files with 188 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ New features, fixed bugs, known defects and other noteworthy changes to each rel

* **Technical User**
* add Registration Internal as Operator technical user for invite API [#1002](https://github.com/eclipse-tractusx/portal-backend/pull/1002)
* add BPDM Orchestrator technical user and service accounts [#1048](https://github.com/eclipse-tractusx/portal-backend/pull/1048)

## 2.3.0-alpha.1

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,5 +124,45 @@
"company_service_account_kind_id": 1,
"client_id": "beb01d13-04e2-4a2b-a909-8b4166b3dcf7",
"client_client_id": "sa-cl2-05"
},
{
"id": "48fb21ad-4439-455b-92bb-8c54801e3eab",
"name": "sa-cl7-cx-1",
"description": "Technical User for the BPDM Portal Gate to consume golden record data from the Pool.",
"company_service_account_type_id": 2,
"company_service_account_kind_id": 1,
"client_client_id": "sa-cl7-cx-1"
},
{
"id": "724fda4d-e0c0-4b90-a36f-f11b75cc53cd",
"name": "sa-cl7-cx-7",
"description": "Technical User for BPDM services to communicate between each other to realize the golden record process: used by the Portal Gate, Pool and Cleaning Service.",
"company_service_account_type_id": 2,
"company_service_account_kind_id": 1,
"client_client_id": "sa-cl7-cx-7"
},
{
"id": "d33043a0-ed8f-46b7-9319-8f3f6f052c28",
"name": "sa-cl25-cx-1",
"description": "Technical User for the BPDM cleaning service dummy component to process golden record tasks from the Orchestrator.",
"company_service_account_type_id": 2,
"company_service_account_kind_id": 1,
"client_client_id": "sa-cl25-cx-1"
},
{
"id": "fc729705-adf0-499e-91c7-1e04d817bad8",
"name": "sa-cl25-cx-2",
"description": "Technical User for the BPDM Pool component to process golden record tasks from the Orchestrator.",
"company_service_account_type_id": 2,
"company_service_account_kind_id": 1,
"client_client_id": "sa-cl25-cx-2"
},
{
"id": "c8ab54ea-830e-4f8a-a540-336e0576a619",
"name": "sa-cl25-cx-3",
"description": "Technical User for the BPDM Portal Gate to create and monitor golden record tasks inside the Orchestrator.",
"company_service_account_type_id": 2,
"company_service_account_kind_id": 1,
"client_client_id": "sa-cl25-cx-3"
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -120,5 +120,45 @@
"user_status_id": 1,
"user_entity_id": "e8bc6470-28ee-4c40-a2d9-27c6e78f303b",
"identity_type_id": 2
},
{
"id": "48fb21ad-4439-455b-92bb-8c54801e3eab",
"company_id": "2dc4249f-b5ca-4d42-bef1-7a7a950a4f87",
"date_created": "2024-09-27 10:01:33.439000 +00:00",
"user_status_id": 1,
"user_entity_id": null,
"identity_type_id": 2
},
{
"id": "724fda4d-e0c0-4b90-a36f-f11b75cc53cd",
"company_id": "2dc4249f-b5ca-4d42-bef1-7a7a950a4f87",
"date_created": "2024-09-27 10:01:33.439000 +00:00",
"user_status_id": 1,
"user_entity_id": null,
"identity_type_id": 2
},
{
"id": "d33043a0-ed8f-46b7-9319-8f3f6f052c28",
"company_id": "2dc4249f-b5ca-4d42-bef1-7a7a950a4f87",
"date_created": "2024-09-27 10:01:33.439000 +00:00",
"user_status_id": 1,
"user_entity_id": null,
"identity_type_id": 2
},
{
"id": "fc729705-adf0-499e-91c7-1e04d817bad8",
"company_id": "2dc4249f-b5ca-4d42-bef1-7a7a950a4f87",
"date_created": "2024-09-27 10:01:33.439000 +00:00",
"user_status_id": 1,
"user_entity_id": null,
"identity_type_id": 2
},
{
"id": "c8ab54ea-830e-4f8a-a540-336e0576a619",
"company_id": "2dc4249f-b5ca-4d42-bef1-7a7a950a4f87",
"date_created": "2024-09-27 10:01:33.439000 +00:00",
"user_status_id": 1,
"user_entity_id": null,
"identity_type_id": 2
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,26 @@
"user_role_id": "34c42896-a003-4653-af8f-ba06ca595754",
"user_role_collection_id": "1a24eca5-901f-4191-84a7-4ef09a894575"
},
{
"user_role_id": "79638264-25f1-46df-89c6-a6e306c69462",
"user_role_collection_id": "1a24eca5-901f-4191-84a7-4ef09a894575"
},
{
"user_role_id": "77439600-ebfa-4f02-a3f9-cfad6160f8ed",
"user_role_collection_id": "1a24eca5-901f-4191-84a7-4ef09a894575"
},
{
"user_role_id": "16822e29-1b41-4359-9fc4-1aafb1bf8509",
"user_role_collection_id": "1a24eca5-901f-4191-84a7-4ef09a894575"
},
{
"user_role_id": "4c7e1144-0ec5-4874-8439-3afc2e8e71db",
"user_role_collection_id": "1a24eca5-901f-4191-84a7-4ef09a894575"
},
{
"user_role_id": "a53a95be-ea7b-4033-926c-26275dc16e0f",
"user_role_collection_id": "1a24eca5-901f-4191-84a7-4ef09a894575"
},
{
"user_role_id": "58f897ec-0aad-4588-8ffa-5f45d6638633",
"user_role_collection_id": "8cb12ea2-aed4-4d75-b041-ba297df3d2f2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,5 +268,55 @@
"user_role_id": "34c42896-a003-4653-af8f-ba06ca595754",
"language_short_name": "en",
"description": "Technical user enabling the invitation API to integrate 3rd party software."
},
{
"user_role_id": "79638264-25f1-46df-89c6-a6e306c69462",
"language_short_name": "de",
"description": "Vollzugriff auf die Golden Record Tasks."
},
{
"user_role_id": "79638264-25f1-46df-89c6-a6e306c69462",
"language_short_name": "en",
"description": "Full access to Golden Record Tasks."
},
{
"user_role_id": "77439600-ebfa-4f02-a3f9-cfad6160f8ed",
"language_short_name": "de",
"description": "Erstelle Golden Record Tasks, lese das Task-Ergebnis und den Status aus."
},
{
"user_role_id": "77439600-ebfa-4f02-a3f9-cfad6160f8ed",
"language_short_name": "en",
"description": "Create Golden Record Tasks, view task results and status."
},
{
"user_role_id": "16822e29-1b41-4359-9fc4-1aafb1bf8509",
"language_short_name": "de",
"description": "Reserviere und bearbeitete Golden Record Tasks im Schritt 'Clean'."
},
{
"user_role_id": "16822e29-1b41-4359-9fc4-1aafb1bf8509",
"language_short_name": "en",
"description": "Reserve and resolve Golden Record Tasks in step 'Clean'."
},
{
"user_role_id": "4c7e1144-0ec5-4874-8439-3afc2e8e71db",
"language_short_name": "de",
"description": "Reserviere und bearbeitete Golden Record Tasks im Schritt 'Clean And Sync'."
},
{
"user_role_id": "4c7e1144-0ec5-4874-8439-3afc2e8e71db",
"language_short_name": "en",
"description": "Reserve and resolve Golden Record Tasks in step 'Clean And Sync'."
},
{
"user_role_id": "a53a95be-ea7b-4033-926c-26275dc16e0f",
"language_short_name": "de",
"description": "Reserve and resolve Golden Record Tasks in step 'Pool'."
},
{
"user_role_id": "a53a95be-ea7b-4033-926c-26275dc16e0f",
"language_short_name": "en",
"description": "Reserviere und bearbeitete Golden Record Tasks im Schritt 'Pool'."
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -166,5 +166,35 @@
"user_role": "Registration Internal",
"offer_id": "0ffcb416-1101-4ba6-8d4a-a9dfa31745a4",
"last_editor_id": null
},
{
"id": "79638264-25f1-46df-89c6-a6e306c69462",
"user_role": "BPDM Orchestrator Admin",
"offer_id": "0ffcb416-1101-4ba6-8d4a-a9dfa31745a4",
"last_editor_id": null
},
{
"id": "77439600-ebfa-4f02-a3f9-cfad6160f8ed",
"user_role": "BPDM Orchestrator Task Creator",
"offer_id": "0ffcb416-1101-4ba6-8d4a-a9dfa31745a4",
"last_editor_id": null
},
{
"id": "16822e29-1b41-4359-9fc4-1aafb1bf8509",
"user_role": "BPDM Orchestrator Processor Clean",
"offer_id": "0ffcb416-1101-4ba6-8d4a-a9dfa31745a4",
"last_editor_id": null
},
{
"id": "4c7e1144-0ec5-4874-8439-3afc2e8e71db",
"user_role": "BPDM Orchestrator Processor CleanAndSync",
"offer_id": "0ffcb416-1101-4ba6-8d4a-a9dfa31745a4",
"last_editor_id": null
},
{
"id": "a53a95be-ea7b-4033-926c-26275dc16e0f",
"user_role": "BPDM Orchestrator Processor PoolSync",
"offer_id": "0ffcb416-1101-4ba6-8d4a-a9dfa31745a4",
"last_editor_id": null
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,7 @@ public async Task GetCompanyIdAndBpnForIamUserUntrackedAsync_WithValidData_Retur
// Assert
result.Should().NotBe(default);
result.Bpn.Should().Be("BPNL00000003CRHK");
result.TechnicalUserRoleIds.Should().HaveCount(14).And.OnlyHaveUniqueItems();
result.TechnicalUserRoleIds.Should().HaveCount(19).And.OnlyHaveUniqueItems();
}

#endregion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public async Task CompanyRoleCollectionRolesView_GetAll_ReturnsExpected()

// Act
var result = await sut.CompanyRoleCollectionRolesView.ToListAsync();
result.Should().HaveCount(57);
result.Should().HaveCount(62);
}

[Fact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ public async Task GetOwnCompanyServiceAccountsUntracked_WithOwnerTrue_ReturnsExp

// Assert
result.Should().NotBeNull();
result!.Count.Should().Be(17);
result!.Count.Should().Be(22);
result.Data.Should().HaveCount(10)
.And.AllSatisfy(x => x.Should().Match<Models.CompanyServiceAccountData>(y =>
y.CompanyServiceAccountTypeId == CompanyServiceAccountTypeId.OWN &&
Expand Down Expand Up @@ -371,7 +371,7 @@ public async Task GetOwnCompanyServiceAccountsUntracked_WithSearch_ReturnsExpect

// Assert
result.Should().NotBeNull();
result!.Count.Should().Be(13);
result!.Count.Should().Be(18);
result.Data.Should().HaveCount(10);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public async Task GetCoreOfferRolesAsync_WithValidData_ReturnsExpected()
var data = await sut.GetCoreOfferRolesAsync(_validCompanyId, "en", ClientId).ToListAsync();

// Assert
data.Should().HaveCount(14);
data.Should().HaveCount(19);
}

#endregion
Expand Down Expand Up @@ -135,9 +135,9 @@ public async Task GetServiceAccountRolesAsync_WithValidData_ReturnsExpected()
var data = await sut.GetServiceAccountRolesAsync(_validCompanyId, ClientId, Enumerable.Repeat(new Guid("607818be-4978-41f4-bf63-fa8d2de51157"), 1), Constants.DefaultLanguage).ToListAsync();

// Assert
data.Should().HaveCount(14);
data.Should().HaveCount(19);
data.Should().OnlyHaveUniqueItems();
data.Where(x => x.RoleType == UserRoleType.Internal).Should().HaveCount(13);
data.Where(x => x.RoleType == UserRoleType.Internal).Should().HaveCount(18);
data.Where(x => x.RoleType == UserRoleType.External).Should().ContainSingle();
}

Expand Down

0 comments on commit 0fbcb76

Please sign in to comment.