Skip to content

Commit 8598cba

Browse files
authored
v1.0.1 release
1 parent 79ee01f commit 8598cba

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+821
-801
lines changed

.azuredevops/pipelines/build-v2.yml

Lines changed: 37 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,18 @@ steps:
153153
dockerComposeFile: $(Build.SourcesDirectory)/sb-mock-data-recipient/Source/docker-compose.IntegrationTests.yml
154154
dockerComposeCommand: down
155155

156+
# Surface Integration tests TRX results to Devops
157+
- task: PublishTestResults@2
158+
displayName: 'Surface Integration tests TRX results to Devops'
159+
condition: succeededOrFailed()
160+
inputs:
161+
testResultsFormat: 'VSTest'
162+
testResultsFiles: '**/results.trx'
163+
searchFolder: $(Build.SourcesDirectory)/sb-mock-data-recipient/Source/_temp/mock-data-recipient-integration-tests/testresults
164+
mergeTestResults: true
165+
testRunTitle: 'mock-data-recipient-Integration-tests'
166+
publishRunAttachments: true
167+
156168
# Run e2e tests
157169
- task: DockerCompose@0
158170
displayName: E2E tests - Up
@@ -171,6 +183,18 @@ steps:
171183
dockerComposeFile: $(Build.SourcesDirectory)/sb-mock-data-recipient/Source/docker-compose.E2ETests.yml
172184
dockerComposeCommand: down
173185

186+
# Surface E2E tests TRX results to Devops
187+
- task: PublishTestResults@2
188+
displayName: 'Surface E2E tests TRX results to Devops'
189+
condition: succeededOrFailed()
190+
inputs:
191+
testResultsFormat: 'VSTest'
192+
testResultsFiles: '**/results.trx'
193+
searchFolder: $(Build.SourcesDirectory)/sb-mock-data-recipient/Source/_temp/mock-data-recipient-e2e-tests/testresults
194+
mergeTestResults: true
195+
testRunTitle: 'mock-data-recipient-E2E-tests'
196+
publishRunAttachments: true
197+
174198
# Save docker image to TAR so it can be published
175199
- task: Docker@2
176200
displayName: Save MockDataRecipient image to TAR
@@ -265,16 +289,16 @@ steps:
265289
condition: always()
266290
artifact: Database Migration Scripts
267291

268-
- task: PublishTestResults@2
269-
displayName: 'Surface Integration Test TRX results to devops'
270-
condition: succeededOrFailed()
271-
inputs:
272-
testResultsFormat: 'VSTest' # Options: JUnit, NUnit, VSTest, xUnit, cTest
273-
testResultsFiles: '**/results.trx'
274-
#searchFolder: '$(System.DefaultWorkingDirectory)' # Optional
275-
#mergeTestResults: false # Optional
276-
#failTaskOnFailedTests: false # Optional
277-
#testRunTitle: # Optional
278-
#buildPlatform: # Optional
279-
#buildConfiguration: # Optional
280-
#publishRunAttachments: true # Optional
292+
# - task: PublishTestResults@2
293+
# displayName: 'Surface Integration Test TRX results to devops'
294+
# condition: succeededOrFailed()
295+
# inputs:
296+
# testResultsFormat: 'VSTest' # Options: JUnit, NUnit, VSTest, xUnit, cTest
297+
# testResultsFiles: '**/results.trx'
298+
# #searchFolder: '$(System.DefaultWorkingDirectory)' # Optional
299+
# #mergeTestResults: false # Optional
300+
# #failTaskOnFailedTests: false # Optional
301+
# #testRunTitle: # Optional
302+
# #buildPlatform: # Optional
303+
# #buildConfiguration: # Optional
304+
# #publishRunAttachments: true # Optional

CHANGELOG.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [Unreleased]
88

9-
## [1.0.0] - 2022-08-02
9+
## [1.0.1] - 2022-08-30
10+
### Changed
11+
- Updated arrangement revocation to match CDS v1.18. Configuration added based on the date to make functionality available or unavailable.
12+
- Updated side menu layout and text on screens.
13+
- Updated package references.
14+
15+
### Fixed
16+
- Fixed issue with Dynamic Client Registration Azure function not retrying for DCR Failed data holders.
17+
18+
## [1.0.0] - 2022-07-22
1019
### Added
1120
- Azure functions to perform Data Holder discovery by polling the Get Data Holder Brands API of the Register.
1221

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2022 Commonwealth of Australia
3+
Copyright (c) 2021 Commonwealth of Australia
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
![Consumer Data Right Logo](https://raw.githubusercontent.com/ConsumerDataRight/mock-data-recipient/main/cdr-logo.png)
22

3-
[![Consumer Data Standards v1.16.0](https://img.shields.io/badge/Consumer%20Data%20Standards-v1.16.0-blue.svg)](https://consumerdatastandardsaustralia.github.io/standards-archives/standards-1.16.0/#introduction)
3+
[![Consumer Data Standards v1.17.0](https://img.shields.io/badge/Consumer%20Data%20Standards-v1.17.0-blue.svg)](https://consumerdatastandardsaustralia.github.io/standards/#introduction)
44
[![Conformance Test Suite 3.2](https://img.shields.io/badge/Conformance%20Test%20Suite-v3.2-darkblue.svg)](https://www.cdr.gov.au/for-providers/conformance-test-suite-data-recipients)
55
[![made-with-dotnet](https://img.shields.io/badge/Made%20with-.NET-1f425Ff.svg)](https://dotnet.microsoft.com/)
66
[![made-with-csharp](https://img.shields.io/badge/Made%20with-C%23-1f425Ff.svg)](https://docs.microsoft.com/en-us/dotnet/csharp/)
@@ -13,9 +13,9 @@ This project includes source code, documentation and instructions for a Consumer
1313
This repository contains a mock implementation of a Mock Data Recipient and is offered to help the community in the development and testing of their CDR solutions.
1414

1515
## Mock Data Recipient - Alignment
16-
The Mock Data Recipient aligns to [v1.16.0](https://consumerdatastandardsaustralia.github.io/standards-archives/standards-1.16.0/#introduction) of the [Consumer Data Standards](https://consumerdatastandardsaustralia.github.io/standards/#introduction).
16+
The Mock Data Recipient aligns to [v1.17.0](https://consumerdatastandardsaustralia.github.io/standards/#introduction) of the [Consumer Data Standards](https://consumerdatastandardsaustralia.github.io/standards/#introduction).
1717
The Mock Data Recipient passed v3.2 of the [Conformance Test Suite for Data Recipients](https://www.cdr.gov.au/for-providers/conformance-test-suite-data-recipients).
18-
The Mock Data Recipient can connect to and complete authentication against both [FAPI 1.0 Migration Phase 1 and Phase 2](https://consumerdatastandardsaustralia.github.io/standards-archives/standards-1.16.0/#authentication-flows) compliant data holders.
18+
The Mock Data Recipient can connect to and complete authentication against both [FAPI 1.0 Migration Phase 1 and Phase 2](https://consumerdatastandardsaustralia.github.io/standards/#authentication-flows) compliant data holders.
1919

2020
## Getting Started
2121
The Mock Data Recipient was built using the [Mock Register](https://github.com/ConsumerDataRight/mock-register), the [Mock Data Holder](https://github.com/ConsumerDataRight/mock-data-holder) and the [Mock Data Holder Energy](https://github.com/ConsumerDataRight/mock-data-holder-energy). You can swap out any of the Mock Data Holders, Mock Data Register and Mock Data Recipient solutions with a solution of your own.

Source/CDR.DCR/CDR.DCR.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<_FunctionsSkipCleanOutput>true</_FunctionsSkipCleanOutput>
66
</PropertyGroup>
77
<ItemGroup>
8-
<PackageReference Include="Azure.Storage.Queues" Version="12.9.0" />
8+
<PackageReference Include="Azure.Storage.Queues" Version="12.11.0" />
99
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.Storage" Version="4.0.5" />
1010
<PackageReference Include="Microsoft.Data.SqlClient" Version="4.1.0" />
1111
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="4.0.1" />

Source/CDR.DCR/DCR.cs

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,13 @@ public static class DynamicClientRegistrationFunction
3333
[FunctionName("FunctionDCR")]
3434
public static async Task DCR([QueueTrigger("dynamicclientregistration", Connection = "StorageConnectionString")] CloudQueueMessage myQueueItem, ILogger log, ExecutionContext context)
3535
{
36-
string msg = "";
37-
string infosecBaseUri = "";
38-
string regEndpoint = "";
36+
string msg = string.Empty;
37+
string dataHolderBrandName = string.Empty;
38+
string infosecBaseUri = string.Empty;
39+
string regEndpoint = string.Empty;
3940

4041
DcrQueueMessage myQMsg = JsonConvert.DeserializeObject<DcrQueueMessage>(myQueueItem.AsString);
41-
42+
4243
try
4344
{
4445
var isLocalDev = Environment.GetEnvironmentVariable("AZURE_FUNCTIONS_ENVIRONMENT").Equals("Development");
@@ -98,9 +99,9 @@ public static async Task DCR([QueueTrigger("dynamicclientregistration", Connecti
9899
{
99100
var ssa = await GetSoftwareStatementAssertion(ssaEndpoint, xv, tokenResponse.Data.AccessToken, clientCertificate, brandId, softwareProductId, log, ignoreServerCertificateErrors);
100101
if (ssa.IsSuccessful)
101-
{
102-
// DOES the Data Holder EXIST in the REPO?
103-
DataHolderBrand dh = await new SqlDataAccess(dbConnString).GetDHBrandById(myQMsg.DataHolderBrandId);
102+
{
103+
//DOES the Data Holder Brand EXIST in the REPO?
104+
DataHolderBrand dh = await new SqlDataAccess(dbConnString).GetDataHolderBrand(myQMsg.DataHolderBrandId);
104105
if (dh == null)
105106
{
106107
// NO - DOES the DcrMessage exist?
@@ -115,12 +116,13 @@ public static async Task DCR([QueueTrigger("dynamicclientregistration", Connecti
115116
MessageState = MessageEnum.DCRFailed.ToString(),
116117
MessageError = $"{msg} - does not exist in the repo"
117118
};
118-
await new SqlDataAccess(dbConnString).UpdateDcrMsgReplaceMessageId(dcrMsg, myQueueItem.Id);
119+
await new SqlDataAccess(dbConnString).UpdateDcrMsgReplaceMessageIdWithoutBrand(dcrMsg, myQueueItem.Id);
119120
}
120121
await InsertLog(log, dbConnString, $"{msg} - does not exist in the repo", "Error", "DCR");
121122
}
122123
else
123124
{
125+
dataHolderBrandName = dh.BrandName;
124126
// YES - DOES a Registration already exist for the DataHolderBrandId in the local repo?
125127
Guid clientId = await new SqlDataAccess(dbConnString).GetRegByDHBrandId(dh.DataHolderBrandId);
126128
if (clientId == Guid.Empty)
@@ -164,6 +166,8 @@ public static async Task DCR([QueueTrigger("dynamicclientregistration", Connecti
164166
{
165167
ClientId = regClientId,
166168
DataHolderBrandId = new Guid(dh.DataHolderBrandId),
169+
BrandName = dh.BrandName,
170+
InfosecBaseUri = infosecBaseUri,
167171
MessageState = MessageEnum.DCRComplete.ToString()
168172
};
169173
await new SqlDataAccess(dbConnString).UpdateDcrMsgByDHBrandId(dcrMsg);
@@ -182,6 +186,8 @@ public static async Task DCR([QueueTrigger("dynamicclientregistration", Connecti
182186
DcrMessage dcrMsg = new()
183187
{
184188
DataHolderBrandId = new Guid(dh.DataHolderBrandId),
189+
BrandName = dh.BrandName,
190+
InfosecBaseUri = infosecBaseUri,
185191
MessageState = MessageEnum.DCRFailed.ToString(),
186192
MessageError = $"StatusCode: {regStatusCode}, {regMessage}"
187193
};
@@ -195,6 +201,8 @@ public static async Task DCR([QueueTrigger("dynamicclientregistration", Connecti
195201
DcrMessage dcrMsg = new()
196202
{
197203
DataHolderBrandId = new Guid(myQMsg.DataHolderBrandId),
204+
BrandName = dh.BrandName,
205+
InfosecBaseUri = infosecBaseUri,
198206
MessageState = MessageEnum.DCRFailed.ToString(),
199207
MessageError = "OidcDiscovery failed InfosecBaseUri: " + infosecBaseUri
200208
};
@@ -233,6 +241,8 @@ public static async Task DCR([QueueTrigger("dynamicclientregistration", Connecti
233241
DcrMessage dcrMsg = new()
234242
{
235243
DataHolderBrandId = new Guid(myQMsg.DataHolderBrandId),
244+
BrandName = dataHolderBrandName,
245+
InfosecBaseUri = infosecBaseUri,
236246
MessageState = MessageEnum.DCRFailed.ToString(),
237247
MessageError = ex.Message
238248
};
@@ -245,7 +255,12 @@ public static async Task DCR([QueueTrigger("dynamicclientregistration", Connecti
245255
if (!string.IsNullOrEmpty(regEndpoint))
246256
extraMsg = " - RegistrationEndpoint: " + regEndpoint;
247257

248-
await InsertLog(log, dbLoggingConnString, $"{msg}, REGISTRATION FAILED{extraMsg}", "Exception", "DCR", ex);
258+
if (ex is JsonReaderException)
259+
{
260+
await InsertLog(log, dbLoggingConnString, $"{msg}, REGISTRATION FAILED: OidcDiscovery can't be desiearlized {extraMsg}", "Exception", "DCR", ex);
261+
}
262+
else
263+
await InsertLog(log, dbLoggingConnString, $"{msg}, REGISTRATION FAILED{extraMsg}", "Exception", "DCR", ex);
249264
}
250265
}
251266

Source/CDR.DataRecipient.E2ETests/AATestPlaywrightInstallation.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ public class AATestPlaywrightInstallation : BaseTest_v2, IClassFixture<TestFixtu
1010
[Fact]
1111
public async Task ShouldDisplayGoogleHomePage()
1212
{
13+
await Task.Delay(10000); // FIXME - MJS - This test sometimes just fails in build pipeline with error about google hanging up the connection, maybe just need to give the network a little extra time to get ready?
14+
1315
await TestAsync($"{nameof(AATestPlaywrightInstallation)} - {nameof(ShouldDisplayGoogleHomePage)}", async (page) =>
1416
{
1517
// Act - Goto Google.com

Source/CDR.DataRecipient.E2ETests/BaseTest_v2.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// #define TEST_DEBUG_MODE // Run Playwright in non-headless mode for debugging purposes (ie show a browser)
1+
#define TEST_DEBUG_MODE // Run Playwright in non-headless mode for debugging purposes (ie show a browser)
22

33
// In docker (Ubuntu container) Playwright will fail if running in non-headless mode, so we ensure TEST_DEBUG_MODE is undef'ed
44
#if !DEBUG
@@ -28,6 +28,8 @@ namespace CDR.DataRecipient.E2ETests
2828
[DisplayTestMethodName]
2929
public class BaseTest_v2
3030
{
31+
static public bool RUNNING_IN_CONTAINER => Environment.GetEnvironmentVariable("DOTNET_RUNNING_IN_CONTAINER")?.ToUpper() == "TRUE";
32+
3133
// Customers
3234
public const string CUSTOMERID_BANKING = "jwilson";
3335
public const string CUSTOMERACCOUNTS_BANKING = "Personal Loan xxx-xxx xxxxx987,Transactions and Savings Account xxx-xxx xxxxx988";

Source/CDR.DataRecipient.E2ETests/CDR.DataRecipient.E2ETests.csproj

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
<PropertyGroup>
44
<TargetFramework>net6.0</TargetFramework>
55
<IsPackable>false</IsPackable>
6-
<Version>1.0.0</Version>
7-
<FileVersion>1.0.0</FileVersion>
8-
<AssemblyVersion>1.0.0</AssemblyVersion>
6+
<Version>1.0.1</Version>
7+
<FileVersion>1.0.1</FileVersion>
8+
<AssemblyVersion>1.0.1</AssemblyVersion>
99
</PropertyGroup>
1010

1111
<ItemGroup>
@@ -29,13 +29,13 @@
2929
</ItemGroup>
3030

3131
<ItemGroup>
32-
<PackageReference Include="FluentAssertions" Version="6.4.0" />
33-
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="6.0.2" />
32+
<PackageReference Include="FluentAssertions" Version="6.7.0" />
33+
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="6.0.7" />
3434
<PackageReference Include="Microsoft.Data.SqlClient" Version="4.1.0" />
35-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
36-
<PackageReference Include="Microsoft.Playwright" Version="1.18.1" />
35+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.2.0" />
36+
<PackageReference Include="Microsoft.Playwright" Version="1.24.1" />
3737
<PackageReference Include="xunit" Version="2.4.1" />
38-
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
38+
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
3939
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
4040
<PrivateAssets>all</PrivateAssets>
4141
</PackageReference>

Source/CDR.DataRecipient.E2ETests/Fixtures/TestFixture.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,13 @@ public class TestFixture : IAsyncLifetime
1111
{
1212
public Task InitializeAsync()
1313
{
14-
// Ensure that Playwright has been fully installed.
15-
Microsoft.Playwright.Program.Main(new string[] { "install" });
16-
Microsoft.Playwright.Program.Main(new string[] { "install-deps" });
14+
// Only install Playwright if not running in container, since Dockerfile.e2e-tests already installed Playwright
15+
if (!BaseTest_v2.RUNNING_IN_CONTAINER)
16+
{
17+
// Ensure that Playwright has been fully installed.
18+
Microsoft.Playwright.Program.Main(new string[] { "install" });
19+
Microsoft.Playwright.Program.Main(new string[] { "install-deps" });
20+
}
1721

1822
return Task.CompletedTask;
1923
}

0 commit comments

Comments
 (0)