diff --git a/CHANGELOG.md b/CHANGELOG.md index a278c4f798..61f9853139 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/src/portalbackend/PortalBackend.Migrations/Seeder/Data/company_service_accounts.json b/src/portalbackend/PortalBackend.Migrations/Seeder/Data/company_service_accounts.json index 5a00b5fa68..a8f3c9920f 100644 --- a/src/portalbackend/PortalBackend.Migrations/Seeder/Data/company_service_accounts.json +++ b/src/portalbackend/PortalBackend.Migrations/Seeder/Data/company_service_accounts.json @@ -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" } ] diff --git a/src/portalbackend/PortalBackend.Migrations/Seeder/Data/identities.json b/src/portalbackend/PortalBackend.Migrations/Seeder/Data/identities.json index aca99b64ab..aff4a91132 100644 --- a/src/portalbackend/PortalBackend.Migrations/Seeder/Data/identities.json +++ b/src/portalbackend/PortalBackend.Migrations/Seeder/Data/identities.json @@ -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 } ] diff --git a/src/portalbackend/PortalBackend.Migrations/Seeder/Data/user_role_assigned_collections.json b/src/portalbackend/PortalBackend.Migrations/Seeder/Data/user_role_assigned_collections.json index 3719f30efd..d47782f948 100644 --- a/src/portalbackend/PortalBackend.Migrations/Seeder/Data/user_role_assigned_collections.json +++ b/src/portalbackend/PortalBackend.Migrations/Seeder/Data/user_role_assigned_collections.json @@ -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" diff --git a/src/portalbackend/PortalBackend.Migrations/Seeder/Data/user_role_descriptions.json b/src/portalbackend/PortalBackend.Migrations/Seeder/Data/user_role_descriptions.json index 1c4b9e622e..1b6de8c287 100644 --- a/src/portalbackend/PortalBackend.Migrations/Seeder/Data/user_role_descriptions.json +++ b/src/portalbackend/PortalBackend.Migrations/Seeder/Data/user_role_descriptions.json @@ -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'." } ] diff --git a/src/portalbackend/PortalBackend.Migrations/Seeder/Data/user_roles.json b/src/portalbackend/PortalBackend.Migrations/Seeder/Data/user_roles.json index 6265354c59..37514c0f26 100644 --- a/src/portalbackend/PortalBackend.Migrations/Seeder/Data/user_roles.json +++ b/src/portalbackend/PortalBackend.Migrations/Seeder/Data/user_roles.json @@ -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 } ] diff --git a/tests/portalbackend/PortalBackend.DBAccess.Tests/CompanyRepositoryTests.cs b/tests/portalbackend/PortalBackend.DBAccess.Tests/CompanyRepositoryTests.cs index 6fd014eb57..536e59878b 100644 --- a/tests/portalbackend/PortalBackend.DBAccess.Tests/CompanyRepositoryTests.cs +++ b/tests/portalbackend/PortalBackend.DBAccess.Tests/CompanyRepositoryTests.cs @@ -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 diff --git a/tests/portalbackend/PortalBackend.DBAccess.Tests/CompanyRoleCollectionRolesViewTests.cs b/tests/portalbackend/PortalBackend.DBAccess.Tests/CompanyRoleCollectionRolesViewTests.cs index f27af43a74..a55d7a2a54 100644 --- a/tests/portalbackend/PortalBackend.DBAccess.Tests/CompanyRoleCollectionRolesViewTests.cs +++ b/tests/portalbackend/PortalBackend.DBAccess.Tests/CompanyRoleCollectionRolesViewTests.cs @@ -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] diff --git a/tests/portalbackend/PortalBackend.DBAccess.Tests/ServiceAccountRespotitoryTests.cs b/tests/portalbackend/PortalBackend.DBAccess.Tests/ServiceAccountRespotitoryTests.cs index a6358cc529..568b47636f 100644 --- a/tests/portalbackend/PortalBackend.DBAccess.Tests/ServiceAccountRespotitoryTests.cs +++ b/tests/portalbackend/PortalBackend.DBAccess.Tests/ServiceAccountRespotitoryTests.cs @@ -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(y => y.CompanyServiceAccountTypeId == CompanyServiceAccountTypeId.OWN && @@ -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); } diff --git a/tests/portalbackend/PortalBackend.DBAccess.Tests/UserRolesRepositoryTests.cs b/tests/portalbackend/PortalBackend.DBAccess.Tests/UserRolesRepositoryTests.cs index b8ea838d09..858b6c6762 100644 --- a/tests/portalbackend/PortalBackend.DBAccess.Tests/UserRolesRepositoryTests.cs +++ b/tests/portalbackend/PortalBackend.DBAccess.Tests/UserRolesRepositoryTests.cs @@ -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 @@ -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(); }