Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .azuredevops/pipelines/build-dcr-func.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ variables:
- group: PT-Pipeline-Common

pool:
vmImage: $(Pipeline_Host_Image)
name: mdp-mgmt-shared
demands:
- ImageOverride -equals $(PipelineHostWindowsImage)

steps:
- task: UseDotNet@2
Expand Down
4 changes: 3 additions & 1 deletion .azuredevops/pipelines/build-dh-func.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ variables:
- group: PT-Pipeline-Common

pool:
vmImage: $(Pipeline_Host_Image)
name: mdp-mgmt-shared
demands:
- ImageOverride -equals $(PipelineHostWindowsImage)

steps:
- task: UseDotNet@2
Expand Down
7 changes: 6 additions & 1 deletion .azuredevops/pipelines/build-no-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,14 @@ resources:

trigger:
- none

variables:
- group: PT-Pipeline-Common

pool:
vmImage: ubuntu-latest
name: mdp-mgmt-shared
demands:
- ImageOverride -equals $(PipelineHostLinuxImage)

steps:

Expand Down
38 changes: 25 additions & 13 deletions .azuredevops/pipelines/build-v2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,30 @@
type: string
default: ' ' # default value; if no default, then the parameter MUST be given by the user at runtime

variables:
baseSourceDirectory: $(Build.SourcesDirectory)/Source
dockerComposeDirectory: $(baseSourceDirectory)/DockerCompose
resources:
repositories:
- repository: shared-code-scanning
type: git
name: Common/shared-code-scanning
ref: refs/heads/main
trigger: none

variables:
- name: baseSourceDirectory
value: $(Build.SourcesDirectory)/Source
- name: dockerComposeDirectory
value: $(baseSourceDirectory)/DockerCompose
- group: PT-Pipeline-Common

trigger:
- develop
- main
- releases/*

pool:
vmImage: ubuntu-latest
name: mdp-mgmt-shared
demands:
- ImageOverride -equals $(PipelineHostLinuxImage)

jobs:
- job: Build
Expand Down Expand Up @@ -66,6 +79,11 @@
repository: mock-data-recipient
tags: latest

- template: templates/scan-image.yml@shared-code-scanning
parameters:
Repository: mock-data-recipient
Tag: latest

# Login to Shared ACR
- task: Docker@2
displayName: Login to Shared ACR
Expand Down Expand Up @@ -186,7 +204,7 @@
displayName: Publish container images
# condition: always()
inputs:
path: $(build.artifactstagingdirectory)
path: $(build.artifactstagingdirectory)/mock-data-recipient.image.tar
artifact: Container Images

# Publish mock-data-recipient unit tests results
Expand Down Expand Up @@ -234,16 +252,10 @@
performMultiLevelLookup: true

- task: CmdLine@2
displayName: 'Install dotnet-ef'
condition: always()
inputs:
script: 'dotnet tool install --version 8.0.4 --global dotnet-ef'

- task: CmdLine@2
displayName: 'Check dotnet-ef version'
displayName: 'Restore dotnet tooling'
condition: always()
inputs:
script: 'dotnet-ef'
script: 'dotnet tool restore'

- script: |
cd $(baseSourceDirectory)/CDR.DataRecipient.Repository.SQL
Expand All @@ -263,7 +275,7 @@
inputs:
targetType: inline
script: |
echo Tagging mock-data-recipient with Source Branch Name: $(Build.SourceBranchName)

Check failure on line 278 in .azuredevops/pipelines/build-v2.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Change this step to not use user-controlled data directly in the argument 'script'.

See more on https://sonarcloud.io/project/issues?id=ConsumerDataRight_mock-data-recipient&issues=AZ87GMbS4WpN4_eff1DK&open=AZ87GMbS4WpN4_eff1DK&pullRequest=98
docker tag mock-data-recipient $(SharedAcrBaseUrl).azurecr.io/mock-data-recipient:$(Build.SourceBranchName)

echo Pushing all tags to $(SharedAcrBaseUrl).azurecr.io/mock-data-recipient
Expand All @@ -278,7 +290,7 @@
echo Tagging mock-data-recipient with latest tag
docker tag mock-data-recipient $(SharedAcrBaseUrl).azurecr.io/mock-data-recipient:latest

echo Tagging mock-data-recipient with Source Branch Name-latest: $(Build.SourceBranchName)-latest

Check failure on line 293 in .azuredevops/pipelines/build-v2.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Change this step to not use user-controlled data directly in the argument 'script'.

See more on https://sonarcloud.io/project/issues?id=ConsumerDataRight_mock-data-recipient&issues=AZ87GMbS4WpN4_eff1DL&open=AZ87GMbS4WpN4_eff1DL&pullRequest=98
docker tag mock-data-recipient $(SharedAcrBaseUrl).azurecr.io/mock-data-recipient:$(Build.SourceBranchName)-latest

echo Tagging mock-data-recipient with build id: $(Build.BuildId)
Expand Down
4 changes: 3 additions & 1 deletion .azuredevops/pipelines/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ variables:
- group: PT-Pipeline-Common

pool:
vmImage: $(Pipeline_Host_Image)
name: mdp-mgmt-shared
demands:
- ImageOverride -equals $(PipelineHostLinuxImage)

steps:

Expand Down
20 changes: 20 additions & 0 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"version": 1,
"isRoot": true,
"tools": {
"dotnet-ef": {
"version": "8.0.27",
"commands": [
"dotnet-ef"
],
"rollForward": false
},
"trxtoextentreport": {
"version": "0.0.4",
"commands": [
"TrxToExtentReport"
],
"rollForward": false
}
}
}
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
## [3.0.5] - 2026-07-08
### Changed
- Updated nuget package versions
### Fixed
- Fixed multiple E2E tests by making them independent, also fixed some minor issues.

## [3.0.4] - 2026-03-18
### Fixed
- Upgrade packages to address vulnerabilities
## [3.0.3] - 2025-12-03
### Fixed
- Upgrade multiple packages to address vulnerabilities
Expand Down
21 changes: 11 additions & 10 deletions Source/CDR.DCR/CDR.DCR.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,21 @@
<PropertyGroup>
<AzureFunctionsVersion>v4</AzureFunctionsVersion>
<_FunctionsSkipCleanOutput>true</_FunctionsSkipCleanOutput>
<TargetFramework>$(TargetFrameworkVersion)</TargetFramework>
<Version>$(Version)</Version>
<FileVersion>$(Version)</FileVersion>
<AssemblyVersion>$(Version)</AssemblyVersion>
<TargetFramework>$(TargetFrameworkVersion)</TargetFramework>
<Version>$(Version)</Version>
<FileVersion>$(Version)</FileVersion>
<AssemblyVersion>$(Version)</AssemblyVersion>
<OutputType>Exe</OutputType>
<ImplicitUsings>enabled</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.Azure.Functions.Worker" Version="1.22.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Sdk" Version="1.17.4" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Http.AspNetCore" Version="1.3.2" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Storage.Queues" Version="5.5.3" />
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.2.2" />
<FrameworkReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.Azure.Functions.Worker" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Sdk" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Http.AspNetCore" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Storage.Queues" />
<PackageReference Include="Microsoft.Data.SqlClient" />
<PackageReference Include="Microsoft.Extensions.Logging"/>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\CDR.DataRecipient.Repository.SQL\CDR.DataRecipient.Repository.SQL.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,26 @@
<PropertyGroup>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<TargetFramework>$(TargetFrameworkVersion)</TargetFramework>
<Version>$(Version)</Version>
<FileVersion>$(Version)</FileVersion>
<AssemblyVersion>$(Version)</AssemblyVersion>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
<TargetFramework>$(TargetFrameworkVersion)</TargetFramework>
<Version>$(Version)</Version>
<FileVersion>$(Version)</FileVersion>
<AssemblyVersion>$(Version)</AssemblyVersion>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.2.2" />
<PackageReference Include="Microsoft.IO.RecyclableMemoryStream" Version="3.0.1" />
<PackageReference Include="Serilog.AspNetCore" Version="8.0.1" />
<PackageReference Include="Serilog.Settings.Configuration" Version="8.0.2" />
<PackageReference Include="Serilog.Sinks.MSSqlServer" Version="7.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.7" />
<PackageReference Include="SonarAnalyzer.CSharp" Version="9.32.0.97167">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PackageReference Include="Microsoft.Data.SqlClient" />
<PackageReference Include="Microsoft.IO.RecyclableMemoryStream" />
<PackageReference Include="Serilog.AspNetCore" />
<PackageReference Include="Serilog.Settings.Configuration" />
<PackageReference Include="Serilog.Sinks.MSSqlServer" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" />
<PackageReference Include="SonarAnalyzer.CSharp">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.556">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PackageReference Include="StyleCop.Analyzers">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
</Project>
26 changes: 13 additions & 13 deletions Source/CDR.DataRecipient.E2ETests/CDR.DataRecipient.E2ETests.csproj
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<IsPackable>false</IsPackable>
<TargetFramework>$(TargetFrameworkVersion)</TargetFramework>
<Version>$(Version)</Version>
<FileVersion>$(Version)</FileVersion>
<AssemblyVersion>$(Version)</AssemblyVersion>
<TargetFramework>$(TargetFrameworkVersion)</TargetFramework>
<Version>$(Version)</Version>
<FileVersion>$(Version)</FileVersion>
<AssemblyVersion>$(Version)</AssemblyVersion>
</PropertyGroup>
<ItemGroup>
<None Remove="appsettings.Development.json" />
Expand All @@ -21,21 +21,21 @@
</Content>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Azure.Identity" Version="1.17.0" />
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.2.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="Microsoft.Playwright" Version="1.43.0" />
<PackageReference Include="xunit" Version="2.9.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<PackageReference Include="Azure.Identity" />
<PackageReference Include="FluentAssertions" />
<PackageReference Include="Microsoft.Data.SqlClient" />
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="Microsoft.Playwright" />
<PackageReference Include="xunit" />
<PackageReference Include="xunit.runner.visualstudio">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="6.0.4">
<PackageReference Include="coverlet.collector">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="8.0.7" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\CDR.DataRecipient.IntegrationTests\CDR.DataRecipient.IntegrationTests.csproj" />
Expand Down
4 changes: 2 additions & 2 deletions Source/CDR.DataRecipient.E2ETests/Pages/ParPage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ public async Task<bool> ErrorExists(string errorToCheckFor)
{
try
{
var element = await _page.WaitForSelectorAsync($"//*[contains(.,\"{errorToCheckFor}\")]");
return await element.IsVisibleAsync();
var isVisible = await _page.GetByText(errorToCheckFor).IsVisibleAsync();
return isVisible;
}
catch (TimeoutException) { }
{
Expand Down
14 changes: 8 additions & 6 deletions Source/CDR.DataRecipient.E2ETests/US23863_MDR_E2ETests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ await TestAsync($"{nameof(US23863_MDR_E2ETests)} - {nameof(AC01_HomePage)}", asy
[Fact]
public async Task AC02_01_DiscoverDataHolders_Banking()
{
PurgeMDR();
await TestAsync($"{nameof(US23863_MDR_E2ETests)} - {nameof(AC02_01_DiscoverDataHolders_Banking)}", async (page) =>
{
await DataHolders_Discover(page, "BANKING", "2", 30);
Expand Down Expand Up @@ -128,15 +129,15 @@ await TestAsync($"{nameof(US23863_MDR_E2ETests)} - {nameof(AC02_04_DiscoverDataH
}

[Theory]
[InlineData("ALL", "3", null, "NotAcceptable - Not Acceptable")]
[InlineData("ALL", "4", null, "NotAcceptable - Not Acceptable")]
[InlineData("ALL", "foo", null, "BadRequest - Bad Request")]
[InlineData("BANKING", "3", null, "NotAcceptable - Not Acceptable")]
[InlineData("BANKING", "4", null, "NotAcceptable - Not Acceptable")]
[InlineData("BANKING", "foo", null, "BadRequest - Bad Request")]
[InlineData("ENERGY", "3", null, "NotAcceptable - Not Acceptable")]
[InlineData("ENERGY", "4", null, "NotAcceptable - Not Acceptable")]
[InlineData("ENERGY", "foo", null, "BadRequest - Bad Request")]
[InlineData("TELCO", "3", null, "NotAcceptable - Not Acceptable")]
[InlineData("TELCO", "4", null, "NotAcceptable - Not Acceptable")]
[InlineData("TELCO", "foo", null, "BadRequest - Bad Request")]
public async Task AC02_99_DiscoverDataHolders(string industry = "ALL", string version = "2", int? expectedRecords = 32, string? expectedError = null)
public async Task AC02_99_DiscoverDataHolders(string industry = "ALL", string version = "3", int? expectedRecords = 32, string? expectedError = null)
{
await TestAsync($"{nameof(US23863_MDR_E2ETests)} - {nameof(AC02_99_DiscoverDataHolders)} - Industry={industry} - Version={version}", async (page) =>
{
Expand All @@ -148,7 +149,8 @@ await TestAsync($"{nameof(US23863_MDR_E2ETests)} - {nameof(AC02_99_DiscoverDataH
[InlineData("BANKING", "1", DR_BRANDID, DR_SOFTWAREPRODUCTID, "NotAcceptable")]
[InlineData("BANKING", "2", DR_BRANDID, DR_SOFTWAREPRODUCTID, "NotAcceptable")]
[InlineData("BANKING", "3", DR_BRANDID, DR_SOFTWAREPRODUCTID, "OK - SSA Generated")]
[InlineData("BANKING", "4", DR_BRANDID, DR_SOFTWAREPRODUCTID, "NotAcceptable")]
[InlineData("ALL", "4", DR_BRANDID, DR_SOFTWAREPRODUCTID, "OK - SSA Generated")]
[InlineData("BANKING", "5", DR_BRANDID, DR_SOFTWAREPRODUCTID, "NotAcceptable")]
public async Task AC03_GetSSA(string industry, string version, string drBrandId, string drSoftwareProductId, string expectedMessage)
{
await TestAsync($"{nameof(US23863_MDR_E2ETests)} - {nameof(AC03_GetSSA)} - Version={version} - DR_BrandId={drBrandId} - DR_SoftwareProductId={drSoftwareProductId}", async (page) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public async Task AC04_AC0_AC06_AC07_InvalidParRequests(string scenarioName, str
string? dhClientId = null;
await ArrangeAsync(testName, async (page) =>
{

await DataHolders_Discover(page, "ALL", "2", -1); // get all dh brands
var responseTypeForRegCreation = useDefaultResponseTypeForDCR != null && useDefaultResponseTypeForDCR == true ? "code" : responseType;

dhClientId = await ClientRegistration_Create(page, dhBrandId, responseTypes: responseTypeForRegCreation)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public async Task AC01_AC03_AC04_AC05_AC19_Valid_Authorisation_Code_Par(string t
string? dhClientId = null;
await ArrangeAsync(testName, async (page) =>
{
await DataHolders_Discover(page, "ALL", "2", -1); // get all dh brands
dhClientId = await ClientRegistration_Create(page, dhBrandId, jarmSigningAlgo: jarmSigningAlgo, jarmEncrypAlg: jarmEncryptAlg, jarmEncryptEnc: jarmEncryptEnc, responseTypes: "code")
?? throw new NullReferenceException(nameof(dhClientId));
});
Expand Down Expand Up @@ -249,10 +250,10 @@ await CleanupAsync(async (page) =>
}

[Theory]
[InlineData("Iss_Missing", null, "USE_VALID_AUD", DEFAULT_JWT_EXP_IN_SECONDS, "Token Validation Failed (IDX10211): Unable to validate issuer. The 'issuer' parameter is null or whitespace", "'iss' is blank in simulated callback.")]
[InlineData("Iss_Missing", null, "USE_VALID_AUD", DEFAULT_JWT_EXP_IN_SECONDS, "Token Validation Failed (IDX10211): Issuer validation failed. Unable to validate issuer. The 'issuer' parameter is null or whitespace", "'iss' is blank in simulated callback.")]
[InlineData("Iss_Mismatch", "foo", "USE_VALID_AUD", DEFAULT_JWT_EXP_IN_SECONDS, "Token Validation Failed (IDX10205): Issuer validation failed. Issuer: 'foo'.", "'iss' is different to the expected client Id in simulated callback.")]
[InlineData("Aud_Missing", "USE_VALID_ISS", null, DEFAULT_JWT_EXP_IN_SECONDS, "Token Validation Failed (IDX10206): Unable to validate audience. The 'audiences' parameter is empty.", "'aud' is blank in simulated callback.")]
[InlineData("Aud_Mismatch", "USE_VALID_ISS", "foo", DEFAULT_JWT_EXP_IN_SECONDS, "Token Validation Failed (IDX10214): Audience validation failed. Audiences: 'foo'.", "'aud' is different to the expected uri in simulated callback..")]
[InlineData("Aud_Mismatch", "USE_VALID_ISS", "foo", DEFAULT_JWT_EXP_IN_SECONDS, "Token Validation Failed (IDX10214): Audience validation failed.", "'aud' is different to the expected uri in simulated callback..")]
[InlineData("missing_Exp", "USE_VALID_ISS", "USE_VALID_AUD", null, "Token Validation Failed (IDX10225): Lifetime validation failed. The token is missing an Expiration Time.", "'exp' is blank in simulated callback.")]
[InlineData("Expired_Token", "USE_VALID_ISS", "USE_VALID_AUD", "-500", "Token Validation Failed (IDX10223): Lifetime validation failed. The token is expired.", "JWT has expired. (now - 500 seconds)")]
public async Task AC12_AC13_AC14_AC15_Jwt_Missing_And_Mismatch_Metadata(string testSuffix, string? issuer, string? audience, string? jwtExpiry, string expectedError, string becauseText)
Expand All @@ -263,6 +264,7 @@ public async Task AC12_AC13_AC14_AC15_Jwt_Missing_And_Mismatch_Metadata(string t
string? dhClientId = null;
await ArrangeAsync(testName, async (page) =>
{
await DataHolders_Discover(page, "ALL", "2", -1); // get all dh brands
dhClientId = await CreateBankingRegistration(page, "code");
});

Expand Down
Loading
Loading