Skip to content

Commit

Permalink
release(1.7.0-RC1): merge release into main #312
Browse files Browse the repository at this point in the history
release(1.7.0-RC1): merge release into main
  • Loading branch information
Phil91 authored Oct 24, 2023
2 parents 87e8202 + 2f75e1f commit 11096f4
Show file tree
Hide file tree
Showing 203 changed files with 13,597 additions and 2,180 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,6 @@ jobs:
./.sonar/scanner/dotnet-sonarscanner begin /k:"${{ vars.SONAR_PROJECT_KEY }}" /o:"${{ vars.SONAR_ORGANIZATION }}" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.vscoveragexml.reportsPaths=src/coverage.xml
dotnet build src
cd src
dotnet-coverage collect 'dotnet test --filter FullyQualifiedName\!~Org.Eclipse.TractusX.Portal.Backend.EndToEnd.Tests --no-restore --verbosity normal' -s 'settings-coverage.xml' -f xml -o 'coverage.xml'
dotnet-coverage collect 'dotnet test --filter Category!=PortalHC&Category!=InterfaceHC&Category!=Portal&Category!=Registration --no-restore --verbosity normal' -s 'settings-coverage.xml' -f xml -o 'coverage.xml'
cd ..
./.sonar/scanner/dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}"
60 changes: 54 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,54 @@

New features, fixed bugs, known defects and other noteworthy changes to each release of the Catena-X Portal Backend.

## 1.7.0-RC1

### Change
* Apps Service
* instead of creating the notification for an app subscription after triggering the provider, the notification will directly be created when subscribing to an offer
* enhanced POST /{appId}/subscribe endpoint business logic enhanced to set offer_subscriptions.date_created value when running the endpoint
* enhanced GET /api/apps/{appId} logic to fetch the "isSubscribe" value by the latest subscription record
* enhanced GET /api/Apps/provided/subscription-status & GET /api/Apps/{appId}/subscription/{subscriptionId}/provider by adding processStepTypeId responding with the latest subscription processStepTypeId
* Services Service
* instead of creating the notification for an app subscription after triggering the provider, the notification will directly be created when subscribing to an offer
* POST {appId}/subscribe endpoint business logic enhanced to set offer_subscriptions.date_created value when running the endpoint
* Administration
* endpoint GET api/administration/partnernetwork/memberCompanies enhanced to allow to send specific set of BPNs inside the request payload to request membership status for those BPNLs only
* implemented business/backend logic to set/update company_applications.date_last_changed when running an update on the companyApplication

### Feature
* App Service
* added endpoint to AppChange controller to allow app document change process - fetch app documents api: GET /apps/appchange/{appId}/documents
* Onboarding Service Provider *new function since 1.7.0 alpha* - released onboarding service provider functionality, incl.:
* moved creation of the users for network registrations in keycloak to the process step; if the call to keycloak fails operator can retrigger the process without impact to OSP/3rd party
* added /api/administration/identityprovider/network/identityproviders/managed/{identityProviderId} endpoint to retrieve idp information regarding IdP connected companies

### Technical Support
* Removed auth trail from the provisioning settings and added the use of the keycloak settings to set the correct useAuthTrail value
* adjusted process worker workflow to build the process worker when changes within the networkRegistration directory appear
* Controller slimlined
* removse all identity related code from controllers
* added identityservice to buisnessLogic to access idenitity
* Mask sensitive information in portal logs
* Extended logs for external service/component calls
* Portal DB
* added inside portal.offer_subscription new attribute "date_created", incl. a migration to set all existing offer subscriptiond dates to "1970-01-01"
* check constraints is_external_type_use_case, is_credential_type_use_case & is_connector_managed changed from function constraint to trigger function constraint
* Add new process to synchronize keycloak user with company service account to set the correct user entity id

### Bugfix
* Application approval/verification process: adjusted bpdm businessPartnerNumber pull process to handle an unset SharingProcessStarted and retry the process
* Onboarding Service Provider *new function since 1.7.0 alpha*
* OSP 3rd party customer registration submit endpoint run fixed by adding NetworkBusinessLogic Registration
* updated POST /partnerregistration endpoint - bpn propoerty value NULL allowed
* Seeding data typo fixes (agreements.json)
* Updated userRole for service endpoint PUT api/services/{subscriptionId}/unsubscribe to "unsubscribe_services"
* Add user entity id when creating a company service account

### Known Knowns
* POST /api/registration/application/{applicationId}/inviteNewUser runs on error if user email is already known/existing in the portal db (no matter to which company the user is connected)


## 1.7.0 alpha

### Change
Expand Down Expand Up @@ -40,16 +88,16 @@ New features, fixed bugs, known defects and other noteworthy changes to each rel
* Notification Service
* GET /api/notifications search string enabled to support search by notification content
* Onboarding Service Provider *new function* - released onboarding service provider functionality, incl.:
* add new database structure for network to network
* add seeding for n2n
* added new database structure for network to network
* added seeding for n2n
* enhanced POST /api/administration/identityprovider/owncompany/identityproviders endpoint by identityProviderType (managed; own; shared)
* network process worker registered to use process worker for onboarding service provider registration flow
* add seeding (test data only) for the osp realm and company including users
* added seeding (test data only) for the osp realm and company including users
* added POST /api/administration/registration/network/partnerRegistration/submit endpoint
* added POST registration/network/partnerRegistration to register partners to the network
* add new process to synchronize users with central keycloak instance for the partnerRegistration
* add endpoint to get the callback url of an osp
* add endpoint to set the callback url of an osp
* added new process to synchronize users with central keycloak instance for the partnerRegistration
* added endpoint to get the callback url of an osp
* added endpoint to set the callback url of an osp
* Email templates
* released new email template 'offer release approval'
* released new email tempülate 'welcome onboarding service provider registration company' (connected to feature release Onboarding Service Provider)
Expand Down
1 change: 1 addition & 0 deletions DEPENDENCIES
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ nuget/nuget/-/Serilog.AspNetCore/7.0.0, Apache-2.0 AND MIT, approved, #10084
nuget/nuget/-/Serilog.Enrichers.CorrelationId/3.0.1, MIT, approved, clearlydefined
nuget/nuget/-/Serilog.Enrichers.Environment/2.2.0, Apache-2.0, approved, clearlydefined
nuget/nuget/-/Serilog.Enrichers.Process/2.0.2, Apache-2.0, approved, clearlydefined
nuget/nuget/-/Serilog.Enrichers.Sensitive/1.7.3, MIT, approved, clearlydefined
nuget/nuget/-/Serilog.Enrichers.Thread/3.1.0, Apache-2.0, approved, clearlydefined
nuget/nuget/-/Serilog.Extensions.Hosting/7.0.0, Apache-2.0, approved, #10078
nuget/nuget/-/Serilog.Extensions.Logging/7.0.0, Apache-2.0, approved, #10070
Expand Down
2 changes: 1 addition & 1 deletion src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
<Project>
<PropertyGroup>
<VersionPrefix>1.7.0</VersionPrefix>
<VersionSuffix>alpha</VersionSuffix>
<VersionSuffix>RC1</VersionSuffix>
</PropertyGroup>
</Project>
45 changes: 45 additions & 0 deletions src/Portal.Backend.sln
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,12 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OnboardingServiceProvider.L
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NetworkRegistration.Executor.Tests", "..\tests\processes\NetworkRegistration.Executor.Tests\NetworkRegistration.Executor.Tests.csproj", "{F1A5A73C-2B8C-4959-A128-CC5A8DECCB1B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Framework.Logging.Tests", "..\tests\framework\Framework.Logging.Tests\Framework.Logging.Tests.csproj", "{146865E5-7DFF-4CC2-8521-9E22CFCEEA20}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ServiceAccountSync.Executor", "processes\ServiceAccountSync.Executor\ServiceAccountSync.Executor.csproj", "{B2E5EBAB-AE49-47B6-8220-4844AC9DA456}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ServiceAccountSync.Executor.Tests", "..\tests\processes\ServiceAccountSync.Executor.Tests\ServiceAccountSync.Executor.Tests.csproj", "{571DA63A-6B96-4C6C-8D82-D2C1F10BDAE5}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -1466,6 +1472,42 @@ Global
{F1A5A73C-2B8C-4959-A128-CC5A8DECCB1B}.Release|x64.Build.0 = Release|Any CPU
{F1A5A73C-2B8C-4959-A128-CC5A8DECCB1B}.Release|x86.ActiveCfg = Release|Any CPU
{F1A5A73C-2B8C-4959-A128-CC5A8DECCB1B}.Release|x86.Build.0 = Release|Any CPU
{146865E5-7DFF-4CC2-8521-9E22CFCEEA20}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{146865E5-7DFF-4CC2-8521-9E22CFCEEA20}.Debug|Any CPU.Build.0 = Debug|Any CPU
{146865E5-7DFF-4CC2-8521-9E22CFCEEA20}.Debug|x64.ActiveCfg = Debug|Any CPU
{146865E5-7DFF-4CC2-8521-9E22CFCEEA20}.Debug|x64.Build.0 = Debug|Any CPU
{146865E5-7DFF-4CC2-8521-9E22CFCEEA20}.Debug|x86.ActiveCfg = Debug|Any CPU
{146865E5-7DFF-4CC2-8521-9E22CFCEEA20}.Debug|x86.Build.0 = Debug|Any CPU
{146865E5-7DFF-4CC2-8521-9E22CFCEEA20}.Release|Any CPU.ActiveCfg = Release|Any CPU
{146865E5-7DFF-4CC2-8521-9E22CFCEEA20}.Release|Any CPU.Build.0 = Release|Any CPU
{146865E5-7DFF-4CC2-8521-9E22CFCEEA20}.Release|x64.ActiveCfg = Release|Any CPU
{146865E5-7DFF-4CC2-8521-9E22CFCEEA20}.Release|x64.Build.0 = Release|Any CPU
{146865E5-7DFF-4CC2-8521-9E22CFCEEA20}.Release|x86.ActiveCfg = Release|Any CPU
{146865E5-7DFF-4CC2-8521-9E22CFCEEA20}.Release|x86.Build.0 = Release|Any CPU
{B2E5EBAB-AE49-47B6-8220-4844AC9DA456}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B2E5EBAB-AE49-47B6-8220-4844AC9DA456}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B2E5EBAB-AE49-47B6-8220-4844AC9DA456}.Debug|x64.ActiveCfg = Debug|Any CPU
{B2E5EBAB-AE49-47B6-8220-4844AC9DA456}.Debug|x64.Build.0 = Debug|Any CPU
{B2E5EBAB-AE49-47B6-8220-4844AC9DA456}.Debug|x86.ActiveCfg = Debug|Any CPU
{B2E5EBAB-AE49-47B6-8220-4844AC9DA456}.Debug|x86.Build.0 = Debug|Any CPU
{B2E5EBAB-AE49-47B6-8220-4844AC9DA456}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B2E5EBAB-AE49-47B6-8220-4844AC9DA456}.Release|Any CPU.Build.0 = Release|Any CPU
{B2E5EBAB-AE49-47B6-8220-4844AC9DA456}.Release|x64.ActiveCfg = Release|Any CPU
{B2E5EBAB-AE49-47B6-8220-4844AC9DA456}.Release|x64.Build.0 = Release|Any CPU
{B2E5EBAB-AE49-47B6-8220-4844AC9DA456}.Release|x86.ActiveCfg = Release|Any CPU
{B2E5EBAB-AE49-47B6-8220-4844AC9DA456}.Release|x86.Build.0 = Release|Any CPU
{571DA63A-6B96-4C6C-8D82-D2C1F10BDAE5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{571DA63A-6B96-4C6C-8D82-D2C1F10BDAE5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{571DA63A-6B96-4C6C-8D82-D2C1F10BDAE5}.Debug|x64.ActiveCfg = Debug|Any CPU
{571DA63A-6B96-4C6C-8D82-D2C1F10BDAE5}.Debug|x64.Build.0 = Debug|Any CPU
{571DA63A-6B96-4C6C-8D82-D2C1F10BDAE5}.Debug|x86.ActiveCfg = Debug|Any CPU
{571DA63A-6B96-4C6C-8D82-D2C1F10BDAE5}.Debug|x86.Build.0 = Debug|Any CPU
{571DA63A-6B96-4C6C-8D82-D2C1F10BDAE5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{571DA63A-6B96-4C6C-8D82-D2C1F10BDAE5}.Release|Any CPU.Build.0 = Release|Any CPU
{571DA63A-6B96-4C6C-8D82-D2C1F10BDAE5}.Release|x64.ActiveCfg = Release|Any CPU
{571DA63A-6B96-4C6C-8D82-D2C1F10BDAE5}.Release|x64.Build.0 = Release|Any CPU
{571DA63A-6B96-4C6C-8D82-D2C1F10BDAE5}.Release|x86.ActiveCfg = Release|Any CPU
{571DA63A-6B96-4C6C-8D82-D2C1F10BDAE5}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -1474,6 +1516,7 @@ Global
SolutionGuid = {2EB6265F-323A-4BF3-969E-003D64A14B64}
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{146865E5-7DFF-4CC2-8521-9E22CFCEEA20} = {323C198D-A8C6-4EB0-8B79-72624275E35F}
{A43B5ACA-1209-46E9-84DB-A48553ED623E} = {323C198D-A8C6-4EB0-8B79-72624275E35F}
{1EAF34DA-6D16-4F5E-86F4-344185F53942} = {323C198D-A8C6-4EB0-8B79-72624275E35F}
{A5BEDD89-7280-466E-8D14-EC5E177AAD07} = {323C198D-A8C6-4EB0-8B79-72624275E35F}
Expand Down Expand Up @@ -1576,5 +1619,7 @@ Global
{D22934D7-59B7-4779-AB59-E5BE12DE2F06} = {323C198D-A8C6-4EB0-8B79-72624275E35F}
{B06A4F63-FE8C-40D2-B39F-8C15031A55CC} = {C8957230-4203-452C-A085-34091C5E370B}
{F1A5A73C-2B8C-4959-A128-CC5A8DECCB1B} = {323C198D-A8C6-4EB0-8B79-72624275E35F}
{B2E5EBAB-AE49-47B6-8220-4844AC9DA456} = {282CEF03-292F-4A49-83C6-997567D0FF5F}
{571DA63A-6B96-4C6C-8D82-D2C1F10BDAE5} = {323C198D-A8C6-4EB0-8B79-72624275E35F}
EndGlobalSection
EndGlobal
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
* SPDX-License-Identifier: Apache-2.0
********************************************************************************/

using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Options;
using Org.Eclipse.TractusX.Portal.Backend.Administration.Service.Models;
using Org.Eclipse.TractusX.Portal.Backend.Framework.Async;
Expand All @@ -44,6 +43,7 @@ public class ConnectorsBusinessLogic : IConnectorsBusinessLogic
private readonly IPortalRepositories _portalRepositories;
private readonly ISdFactoryBusinessLogic _sdFactoryBusinessLogic;
private readonly IIdentityService _identityService;
private readonly ILogger<ConnectorsBusinessLogic> _logger;
private readonly ConnectorsSettings _settings;
private static readonly Regex bpnRegex = new(@"(\w|\d){16}", RegexOptions.None, TimeSpan.FromSeconds(1));

Expand All @@ -54,12 +54,14 @@ public class ConnectorsBusinessLogic : IConnectorsBusinessLogic
/// <param name="options">The options</param>
/// <param name="sdFactoryBusinessLogic">Access to the connectorsSdFactory</param>
/// <param name="identityService">Access to the current logged in user</param>
public ConnectorsBusinessLogic(IPortalRepositories portalRepositories, IOptions<ConnectorsSettings> options, ISdFactoryBusinessLogic sdFactoryBusinessLogic, IIdentityService identityService)
/// <param name="logger">Access to the logger</param>
public ConnectorsBusinessLogic(IPortalRepositories portalRepositories, IOptions<ConnectorsSettings> options, ISdFactoryBusinessLogic sdFactoryBusinessLogic, IIdentityService identityService, ILogger<ConnectorsBusinessLogic> logger)
{
_portalRepositories = portalRepositories;
_settings = options.Value;
_sdFactoryBusinessLogic = sdFactoryBusinessLogic;
_identityService = identityService;
_logger = logger;
}

/// <inheritdoc/>
Expand Down Expand Up @@ -351,6 +353,8 @@ public IAsyncEnumerable<ConnectorEndPointData> GetCompanyConnectorEndPointAsync(
/// <inheritdoc />
public async Task ProcessClearinghouseSelfDescription(SelfDescriptionResponseData data, CancellationToken cancellationToken)
{
_logger.LogInformation("Process SelfDescription called with the following data {Data}", data);

var result = await _portalRepositories.GetInstance<IConnectorsRepository>()
.GetConnectorDataById(data.ExternalId)
.ConfigureAwait(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.DBAccess.Repositories;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.PortalEntities.Entities;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.PortalEntities.Enums;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.PortalEntities.Identities;

namespace Org.Eclipse.TractusX.Portal.Backend.Administration.Service.BusinessLogic;

Expand All @@ -35,22 +36,24 @@ namespace Org.Eclipse.TractusX.Portal.Backend.Administration.Service.BusinessLog
public class DocumentsBusinessLogic : IDocumentsBusinessLogic
{
private readonly IPortalRepositories _portalRepositories;
private readonly IIdentityService _identityService;
private readonly DocumentSettings _settings;

/// <summary>
/// Creates a new instance <see cref="DocumentsBusinessLogic"/>
/// </summary>
public DocumentsBusinessLogic(IPortalRepositories portalRepositories, IOptions<DocumentSettings> options)
public DocumentsBusinessLogic(IPortalRepositories portalRepositories, IIdentityService identityService, IOptions<DocumentSettings> options)
{
_portalRepositories = portalRepositories;
_identityService = identityService;
_settings = options.Value;
}

/// <inheritdoc />
public async Task<(string FileName, byte[] Content, string MediaType)> GetDocumentAsync(Guid documentId, Guid companyId)
public async Task<(string FileName, byte[] Content, string MediaType)> GetDocumentAsync(Guid documentId)
{
var documentDetails = await _portalRepositories.GetInstance<IDocumentRepository>()
.GetDocumentDataAndIsCompanyUserAsync(documentId, companyId)
.GetDocumentDataAndIsCompanyUserAsync(documentId, _identityService.IdentityData.CompanyId)
.ConfigureAwait(false);
if (documentDetails == default)
{
Expand Down Expand Up @@ -84,10 +87,10 @@ public DocumentsBusinessLogic(IPortalRepositories portalRepositories, IOptions<D
}

/// <inheritdoc />
public async Task<bool> DeleteDocumentAsync(Guid documentId, Guid companyUserId)
public async Task<bool> DeleteDocumentAsync(Guid documentId)
{
var documentRepository = _portalRepositories.GetInstance<IDocumentRepository>();
var details = await documentRepository.GetDocumentDetailsForIdUntrackedAsync(documentId, companyUserId).ConfigureAwait(false);
var details = await documentRepository.GetDocumentDetailsForIdUntrackedAsync(documentId, _identityService.IdentityData.UserId).ConfigureAwait(false);

if (details.DocumentId == Guid.Empty)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,8 @@ public interface IDocumentsBusinessLogic
/// Gets the document with the given id
/// </summary>
/// <param name="documentId">Id of the document to get</param>
/// <param name="companyId">Company of the user</param>
/// <returns>Returns the filename and content of the file</returns>
Task<(string FileName, byte[] Content, string MediaType)> GetDocumentAsync(Guid documentId, Guid companyId);
Task<(string FileName, byte[] Content, string MediaType)> GetDocumentAsync(Guid documentId);

/// <summary>
/// Gets the selfdescription document with the given id
Expand All @@ -46,9 +45,8 @@ public interface IDocumentsBusinessLogic
/// Deletes the document and the corresponding consent from the persistence layer.
/// </summary>
/// <param name="documentId">Id of the document that should be deleted</param>
/// <param name="companyUserId"></param>
/// <returns>Returns <c>true</c> if the document and corresponding consent were deleted successfully. Otherwise a specific error is thrown.</returns>
Task<bool> DeleteDocumentAsync(Guid documentId, Guid companyUserId);
Task<bool> DeleteDocumentAsync(Guid documentId);

/// <summary>
/// Gets the document as json for the seeding data
Expand Down
Loading

0 comments on commit 11096f4

Please sign in to comment.