diff --git a/CHANGELOG.md b/CHANGELOG.md index 22852bab6a..b0a301d016 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,30 @@ New features, fixed bugs, known defects and other noteworthy changes to each release of the Catena-X Portal Backend. +## 1.6.0-RC5 + +### Change +* Administration Service + * add validation to endpoint /api/administration/serviceaccount/owncompany/serviceaccounts/{serviceAccountId} to check if requesting user is either owner or provider + * enable search of clientId for GET /api/administration/serviceaccount/owncompany/serviceaccounts +* Daps + * Remove Daps calls from all business logic + +### Technical Support +* update of the portal_welcome_email template +* add check whether an endpoint should only be callable for a service account user +* add check whether an endpoint should only be callable for a company user + +### Bugfix +* Logging + * configure serilog for backend services + +### Known Knowns +* Registration process additional invited user receives 'Welcome Email' without personal salutation due to missing first and last name +* New service account is created with identity "Company User" inside identity table - however the user mapping to company_service_accounts is assigned correctly +* Managed technical users (for offer customers) are not fetched in the GET /serviceAccounts call +* Changing an app instance type (/api/apps/AppReleaseProcess/instance-type/{appId}) is not blocked as soon as the app is submitted for release + ## 1.6.0-RC4 ### Change diff --git a/src/Directory.Build.props b/src/Directory.Build.props index a3c653174f..b64b7a10bf 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -21,6 +21,6 @@ 1.6.0 - RC4 + RC5 diff --git a/src/portalbackend/PortalBackend.Migrations/Migrations/20230803131109_CPLP-3105-RemoveDaps.Designer.cs b/src/portalbackend/PortalBackend.Migrations/Migrations/20230804135935_1.6.0-rc5.Designer.cs similarity index 99% rename from src/portalbackend/PortalBackend.Migrations/Migrations/20230803131109_CPLP-3105-RemoveDaps.Designer.cs rename to src/portalbackend/PortalBackend.Migrations/Migrations/20230804135935_1.6.0-rc5.Designer.cs index 90cbbb29aa..a2ace8188e 100644 --- a/src/portalbackend/PortalBackend.Migrations/Migrations/20230803131109_CPLP-3105-RemoveDaps.Designer.cs +++ b/src/portalbackend/PortalBackend.Migrations/Migrations/20230804135935_1.6.0-rc5.Designer.cs @@ -29,8 +29,8 @@ namespace Org.Eclipse.TractusX.Portal.Backend.PortalBackend.Migrations.Migrations { [DbContext(typeof(PortalDbContext))] - [Migration("20230803131109_CPLP-3105-RemoveDaps")] - partial class CPLP3105RemoveDaps + [Migration("20230807080842_1.6.0-rc5")] + partial class _160rc5 { protected override void BuildTargetModel(ModelBuilder modelBuilder) { @@ -5104,6 +5104,11 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) { Id = 4, Label = "VEHICLE_DISMANTLE" + }, + new + { + Id = 5, + Label = "SUSTAINABILITY_CREDENTIAL" }); }); @@ -5183,6 +5188,11 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) { Id = 4, Label = "DISMANTLER_CERTIFICATE" + }, + new + { + Id = 5, + Label = "SUSTAINABILITY_FRAMEWORK" }); }); diff --git a/src/portalbackend/PortalBackend.Migrations/Migrations/20230803131109_CPLP-3105-RemoveDaps.cs b/src/portalbackend/PortalBackend.Migrations/Migrations/20230804135935_1.6.0-rc5.cs similarity index 93% rename from src/portalbackend/PortalBackend.Migrations/Migrations/20230803131109_CPLP-3105-RemoveDaps.cs rename to src/portalbackend/PortalBackend.Migrations/Migrations/20230804135935_1.6.0-rc5.cs index ccb390967a..9d03684a75 100644 --- a/src/portalbackend/PortalBackend.Migrations/Migrations/20230803131109_CPLP-3105-RemoveDaps.cs +++ b/src/portalbackend/PortalBackend.Migrations/Migrations/20230804135935_1.6.0-rc5.cs @@ -24,7 +24,7 @@ namespace Org.Eclipse.TractusX.Portal.Backend.PortalBackend.Migrations.Migrations { - public partial class CPLP3105RemoveDaps : Migration + public partial class _160rc5 : Migration { protected override void Up(MigrationBuilder migrationBuilder) { @@ -71,6 +71,18 @@ protected override void Up(MigrationBuilder migrationBuilder) table.PrimaryKey("pk_audit_connector20230803", x => x.audit_v1id); }); + migrationBuilder.InsertData( + schema: "portal", + table: "verified_credential_external_types", + columns: new[] { "id", "label" }, + values: new object[] { 5, "SUSTAINABILITY_CREDENTIAL" }); + + migrationBuilder.InsertData( + schema: "portal", + table: "verified_credential_types", + columns: new[] { "id", "label" }, + values: new object[] { 5, "SUSTAINABILITY_FRAMEWORK" }); + migrationBuilder.Sql("CREATE FUNCTION portal.LC_TRIGGER_AFTER_DELETE_CONNECTOR() RETURNS trigger as $LC_TRIGGER_AFTER_DELETE_CONNECTOR$\r\nBEGIN\r\n INSERT INTO portal.audit_connector20230803 (\"id\", \"name\", \"connector_url\", \"type_id\", \"status_id\", \"provider_id\", \"host_id\", \"self_description_document_id\", \"location_id\", \"self_description_message\", \"date_last_changed\", \"company_service_account_id\", \"last_editor_id\", \"audit_v1id\", \"audit_v1operation_id\", \"audit_v1date_last_changed\", \"audit_v1last_editor_id\") SELECT OLD.id, \r\n OLD.name, \r\n OLD.connector_url, \r\n OLD.type_id, \r\n OLD.status_id, \r\n OLD.provider_id, \r\n OLD.host_id, \r\n OLD.self_description_document_id, \r\n OLD.location_id, \r\n OLD.self_description_message, \r\n OLD.date_last_changed, \r\n OLD.company_service_account_id, \r\n OLD.last_editor_id, \r\n gen_random_uuid(), \r\n 3, \r\n CURRENT_DATE, \r\n OLD.last_editor_id;\r\nRETURN NEW;\r\nEND;\r\n$LC_TRIGGER_AFTER_DELETE_CONNECTOR$ LANGUAGE plpgsql;\r\nCREATE TRIGGER LC_TRIGGER_AFTER_DELETE_CONNECTOR AFTER DELETE\r\nON portal.connectors\r\nFOR EACH ROW EXECUTE PROCEDURE portal.LC_TRIGGER_AFTER_DELETE_CONNECTOR();"); migrationBuilder.Sql("CREATE FUNCTION portal.LC_TRIGGER_AFTER_INSERT_CONNECTOR() RETURNS trigger as $LC_TRIGGER_AFTER_INSERT_CONNECTOR$\r\nBEGIN\r\n INSERT INTO portal.audit_connector20230803 (\"id\", \"name\", \"connector_url\", \"type_id\", \"status_id\", \"provider_id\", \"host_id\", \"self_description_document_id\", \"location_id\", \"self_description_message\", \"date_last_changed\", \"company_service_account_id\", \"last_editor_id\", \"audit_v1id\", \"audit_v1operation_id\", \"audit_v1date_last_changed\", \"audit_v1last_editor_id\") SELECT NEW.id, \r\n NEW.name, \r\n NEW.connector_url, \r\n NEW.type_id, \r\n NEW.status_id, \r\n NEW.provider_id, \r\n NEW.host_id, \r\n NEW.self_description_document_id, \r\n NEW.location_id, \r\n NEW.self_description_message, \r\n NEW.date_last_changed, \r\n NEW.company_service_account_id, \r\n NEW.last_editor_id, \r\n gen_random_uuid(), \r\n 1, \r\n CURRENT_DATE, \r\n NEW.last_editor_id;\r\nRETURN NEW;\r\nEND;\r\n$LC_TRIGGER_AFTER_INSERT_CONNECTOR$ LANGUAGE plpgsql;\r\nCREATE TRIGGER LC_TRIGGER_AFTER_INSERT_CONNECTOR AFTER INSERT\r\nON portal.connectors\r\nFOR EACH ROW EXECUTE PROCEDURE portal.LC_TRIGGER_AFTER_INSERT_CONNECTOR();"); @@ -86,6 +98,18 @@ protected override void Down(MigrationBuilder migrationBuilder) migrationBuilder.Sql("DROP FUNCTION portal.LC_TRIGGER_AFTER_UPDATE_CONNECTOR() CASCADE;"); + migrationBuilder.DeleteData( + schema: "portal", + table: "verified_credential_external_types", + keyColumn: "id", + keyValue: 5); + + migrationBuilder.DeleteData( + schema: "portal", + table: "verified_credential_types", + keyColumn: "id", + keyValue: 5); + migrationBuilder.DropTable( name: "audit_connector20230803", schema: "portal"); diff --git a/src/portalbackend/PortalBackend.Migrations/Migrations/PortalDbContextModelSnapshot.cs b/src/portalbackend/PortalBackend.Migrations/Migrations/PortalDbContextModelSnapshot.cs index 2dfa4a7322..b6e905cda8 100644 --- a/src/portalbackend/PortalBackend.Migrations/Migrations/PortalDbContextModelSnapshot.cs +++ b/src/portalbackend/PortalBackend.Migrations/Migrations/PortalDbContextModelSnapshot.cs @@ -5102,6 +5102,11 @@ protected override void BuildModel(ModelBuilder modelBuilder) { Id = 4, Label = "VEHICLE_DISMANTLE" + }, + new + { + Id = 5, + Label = "SUSTAINABILITY_CREDENTIAL" }); }); @@ -5181,6 +5186,11 @@ protected override void BuildModel(ModelBuilder modelBuilder) { Id = 4, Label = "DISMANTLER_CERTIFICATE" + }, + new + { + Id = 5, + Label = "SUSTAINABILITY_FRAMEWORK" }); }); diff --git a/src/portalbackend/PortalBackend.Migrations/Seeder/Data/verified_credential_external_type_use_case_detail_versions.consortia.json b/src/portalbackend/PortalBackend.Migrations/Seeder/Data/verified_credential_external_type_use_case_detail_versions.consortia.json index b771a28875..2bb1b79f9f 100644 --- a/src/portalbackend/PortalBackend.Migrations/Seeder/Data/verified_credential_external_type_use_case_detail_versions.consortia.json +++ b/src/portalbackend/PortalBackend.Migrations/Seeder/Data/verified_credential_external_type_use_case_detail_versions.consortia.json @@ -30,5 +30,13 @@ "template": "https://catena-x.net/fileadmin/user_upload/04_Einfuehren_und_umsetzen/Framework_Use_Case_Traceability/Catena_X_Use_Case_Rahmenbedingungen_Trace_3.0_DE.pdf", "valid_from": "2024-01-01 00:00:00.000000 +00:00", "expiry": "2024-12-31 00:00:00.000000 +00:00" + }, + { + "id": "1268a76a-ca19-4dd8-b932-01f24071d565", + "verified_credential_external_type_id": 5, + "version": "1.0.0", + "template": "https://catena-x.net/fileadmin/user_upload/04_Einfuehren_und_umsetzen/Framework_Use_Case_Traceability/Catena_X_Use_Case_Rahmenbedingungen_Trace_3.0_DE.pdf", + "valid_from": "2024-01-01 00:00:00.000000 +00:00", + "expiry": "2024-12-31 00:00:00.000000 +00:00" } ] diff --git a/src/portalbackend/PortalBackend.Migrations/Seeder/Data/verified_credential_type_assigned_external_types.json b/src/portalbackend/PortalBackend.Migrations/Seeder/Data/verified_credential_type_assigned_external_types.json index c82c6ade28..c3b296b22d 100644 --- a/src/portalbackend/PortalBackend.Migrations/Seeder/Data/verified_credential_type_assigned_external_types.json +++ b/src/portalbackend/PortalBackend.Migrations/Seeder/Data/verified_credential_type_assigned_external_types.json @@ -14,5 +14,9 @@ { "verified_credential_external_type_id": 4, "verified_credential_type_id": 4 + }, + { + "verified_credential_external_type_id": 5, + "verified_credential_type_id": 5 } ] diff --git a/src/portalbackend/PortalBackend.Migrations/Seeder/Data/verified_credential_type_assigned_kinds.json b/src/portalbackend/PortalBackend.Migrations/Seeder/Data/verified_credential_type_assigned_kinds.json index 05051369d0..fe63a18b50 100644 --- a/src/portalbackend/PortalBackend.Migrations/Seeder/Data/verified_credential_type_assigned_kinds.json +++ b/src/portalbackend/PortalBackend.Migrations/Seeder/Data/verified_credential_type_assigned_kinds.json @@ -14,5 +14,9 @@ { "verified_credential_type_id": 4, "verified_credential_type_kind_id": 2 + }, + { + "verified_credential_type_id": 5, + "verified_credential_type_kind_id": 1 } ] diff --git a/src/portalbackend/PortalBackend.Migrations/Seeder/Data/verified_credential_type_assigned_use_cases.json b/src/portalbackend/PortalBackend.Migrations/Seeder/Data/verified_credential_type_assigned_use_cases.json index 286ee622db..22165c2153 100644 --- a/src/portalbackend/PortalBackend.Migrations/Seeder/Data/verified_credential_type_assigned_use_cases.json +++ b/src/portalbackend/PortalBackend.Migrations/Seeder/Data/verified_credential_type_assigned_use_cases.json @@ -10,5 +10,9 @@ { "verified_credential_type_id": 3, "use_case_id": "c065a349-f649-47f8-94d5-1a504a855419" + }, + { + "verified_credential_type_id": 5, + "use_case_id": "1aacde78-35ec-4df3-ba1e-f988cddcbbd8" } ] diff --git a/src/portalbackend/PortalBackend.PortalEntities/Enums/VerifiedCredentialExternalTypeId.cs b/src/portalbackend/PortalBackend.PortalEntities/Enums/VerifiedCredentialExternalTypeId.cs index 3394141f3d..8052ecfdd5 100644 --- a/src/portalbackend/PortalBackend.PortalEntities/Enums/VerifiedCredentialExternalTypeId.cs +++ b/src/portalbackend/PortalBackend.PortalEntities/Enums/VerifiedCredentialExternalTypeId.cs @@ -15,4 +15,7 @@ public enum VerifiedCredentialExternalTypeId [EnumMember(Value = "vehicleDismantle")] VEHICLE_DISMANTLE = 4, + + [EnumMember(Value = "Sustainability_Credential")] + SUSTAINABILITY_CREDENTIAL = 5, } diff --git a/src/portalbackend/PortalBackend.PortalEntities/Enums/VerifiedCredentialTypeId.cs b/src/portalbackend/PortalBackend.PortalEntities/Enums/VerifiedCredentialTypeId.cs index 1346d35376..d19531b257 100644 --- a/src/portalbackend/PortalBackend.PortalEntities/Enums/VerifiedCredentialTypeId.cs +++ b/src/portalbackend/PortalBackend.PortalEntities/Enums/VerifiedCredentialTypeId.cs @@ -35,4 +35,7 @@ public enum VerifiedCredentialTypeId [EnumMember(Value = "Dismantler Certificate")] DISMANTLER_CERTIFICATE = 4, + + [EnumMember(Value = "Sustainability Framework")] + SUSTAINABILITY_FRAMEWORK = 5, } diff --git a/tests/portalbackend/PortalBackend.DBAccess.Tests/CompanySsiDetailsRepositoryTests.cs b/tests/portalbackend/PortalBackend.DBAccess.Tests/CompanySsiDetailsRepositoryTests.cs index 2dedd57756..b23f859f57 100644 --- a/tests/portalbackend/PortalBackend.DBAccess.Tests/CompanySsiDetailsRepositoryTests.cs +++ b/tests/portalbackend/PortalBackend.DBAccess.Tests/CompanySsiDetailsRepositoryTests.cs @@ -55,11 +55,12 @@ public async Task GetDetailsForCompany_WithValidData_ReturnsExpected() var result = await sut.GetUseCaseParticipationForCompany(_validCompanyId, "en").ToListAsync().ConfigureAwait(false); // Assert - result.Should().HaveCount(3); - result.Where(x => x.Description != null).Should().HaveCount(3).And.Satisfy( + result.Should().HaveCount(4); + result.Where(x => x.Description != null).Should().HaveCount(4).And.Satisfy( x => x.Description == "Traceability", x => x.Description == "Sustainability & CO2-Footprint", - x => x.Description == "Quality Management"); + x => x.Description == "Quality Management", + x => x.Description == "Circular Economy"); var traceability = result.Single(x => x.CredentialType == VerifiedCredentialTypeId.TRACEABILITY_FRAMEWORK); traceability.VerifiedCredentials.Should().HaveCount(3).And.Satisfy( x => x.ExternalDetailData.Version == "1.0.0" && x.SsiDetailData.Single().ParticipationStatus == CompanySsiDetailStatusId.PENDING,