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
364 changes: 79 additions & 285 deletions .azuredevops/pipelines/build-v2.yml

Large diffs are not rendered by default.

24 changes: 24 additions & 0 deletions .azuredevops/pipelines/code-scanning.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
resources:
repositories:
- repository: shared-code-scanning
type: git
name: Common/shared-code-scanning
ref: refs/heads/main
trigger: none

schedules:
- cron: '0 17 * * 0' # Run at 17:00 Sunday night UTC (03:00+10:00 Monday Morning)
displayName: 'Weekly code scan'
branches:
include:
- develop
always: true

# Disable standard CI build
trigger: none

pool:
vmImage: 'ubuntu-latest'

extends:
template: pipeline-templates/code-scanning.yml@shared-code-scanning
33 changes: 33 additions & 0 deletions .azuredevops/pipelines/set-tag-name.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
parameters:
- name: name # Name of the variable to set
type: string
- name: input
type: string
default: ''
- name: context
type: string # e.g., $(Build.SourceBranchName)

steps:
- powershell: |
$input = "${{ parameters.input }}"
$context = "${{ parameters.context }}"
$varName = "${{ parameters.name }}"

Write-Host "Setting variable: $varName"
Write-Host "Input provided: $input"
Write-Host "Context: $context"

if (-not [string]::IsNullOrWhiteSpace($input)) {
Write-Host "##vso[task.setvariable variable=$varName]$input"
Write-Host "Used provided value for ${varName}: ${input}"
} else {
switch -Wildcard ($context) {
"main" { $value = "main-latest" }
"develop" { $value = "develop-latest" }
"*release*" { $value = "main-latest" }
default { $value = "develop-latest" }
}
Write-Host "Resolved ${varName} to: ${value}"
Write-Host "##vso[task.setvariable variable=$varName]$value"
}
displayName: 'Set ${{ parameters.name }} variable'
27 changes: 8 additions & 19 deletions .azuredevops/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,16 @@
**Checklist:** (Put an `x` in all the boxes that apply)
- [ ] My code follows the code style of this project.
- [ ] I have set this Pull Request to Auto Complete with the delete source branch option selected.
- [ ] Commented out code has been removed or will be removed.
- [ ] I have updated the documentation accordingly.
- [ ] I have added tests to cover my changes.
- [ ] All new and existing tests passed.
- [ ] I have updated the `CHANGELOG.md` file as appropriate.


**What kind of change does this PR introduce?** (Bug fix, feature, docs update, ...)


**What is the new behaviour?**

**What is the current behavior?** (You can also link to an open issue here)
(if this is a feature change)


**Does this PR introduce a breaking change?**

**What is the new behavior?** (if this is a feature change)



**Does this PR introduce a breaking change?** (What changes might users need to make in their application due to this PR?)
(What changes might users need to make in their application due to this PR?)



**Other information**:

**Checklist:** (Put an `x` in all the boxes that apply)
- [ ] I have set this Pull Request to auto complete with the delete source branch option selected.
- [ ] I have updated the documentation in confluence or relevant readme.md text accordingly.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [4.0.1] - 2025-06-19

### Changed
- Fixed multiple build warnings to improve code quality and maintainability

## [4.0.0] - 2025-03-19
### Changed
- Updated NuGet packages.
Expand Down
2 changes: 1 addition & 1 deletion Help/container/HELP.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ docker build -f Dockerfile --target Energy -t mock-data-holder-energy .

Run the SQL Server image.
```
docker run -d -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=Pa{}w0rd2019" -p 1433:1433 --name sql1 -h sql1 -d mcr.microsoft.com/mssql/server:2022-latest
docker run -d -e "ACCEPT_EULA=Y" -e "MSSQL_SA_PASSWORD=Pa{}w0rd2019" -p 1433:1433 --name sql1 -h sql1 -d mcr.microsoft.com/mssql/server:2022-latest
```
Run a new Banking docker container.
```
Expand Down
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
![Consumer Data Right Logo](./Assets/cdr-logo.png?raw=true)

[![Consumer Data Standards v1.33.0](https://img.shields.io/badge/Consumer%20Data%20Standards-v1.33.0-blue.svg)](https://consumerdatastandardsaustralia.github.io/standards-archives/standards-1.33.0/#introduction)
[![Consumer Data Standards v1.34.0](https://img.shields.io/badge/Consumer%20Data%20Standards-v1.34.0-blue.svg)](https://consumerdatastandardsaustralia.github.io/standards-archives/standards-1.34.0/#introduction)
[![Conformance Test Suite Data Holders 5.2.0](https://img.shields.io/badge/Conformance%20Test%20Suite%20Data%20Holders-v5.2.0-darkblue.svg)](https://www.cdr.gov.au/for-providers/conformance-test-suite-data-holders)
[![FAPI 1.0 Advanced Profile](https://img.shields.io/badge/FAPI%201.0-orange.svg)](https://openid.net/specs/openid-financial-api-part-2-1_0.html)
[![made-with-dotnet](https://img.shields.io/badge/Made%20with-.NET-1f425Ff.svg)](https://dotnet.microsoft.com/)
Expand All @@ -17,7 +17,7 @@ The Mock Data Holder solution can be configured for Banking or Energy industries

## Mock Data Holder - Alignment
The Mock Data Holder:
* aligns to [v1.33.0](https://consumerdatastandardsaustralia.github.io/standards-archives/standards-1.33.0/#introduction) of the [Consumer Data Standards](https://consumerdatastandardsaustralia.github.io/standards-archives/standards-1.33.0/#introduction) in particular [FAPI 1.0 Migration Phase 3](https://consumerdatastandardsaustralia.github.io/standards-archives/standards-1.33.0/#introduction) with backwards compatibility to Migration Phase 2;
* aligns to [v1.34.0](https://consumerdatastandardsaustralia.github.io/standards-archives/standards-1.34.0/#introduction) of the [Consumer Data Standards](https://consumerdatastandardsaustralia.github.io/standards-archives/standards-1.34.0/#introduction) in particular [FAPI 1.0 Migration Phase 3](https://consumerdatastandardsaustralia.github.io/standards-archives/standards-1.34.0/#introduction) with backwards compatibility to Migration Phase 2;
* has passed v5.2.0 of the [Conformance Test Suite for Data Holders](https://www.cdr.gov.au/for-providers/conformance-test-suite-data-holders); and
* is compliant with the [FAPI 1.0 Advanced Profile](https://openid.net/specs/openid-financial-api-part-2-1_0.html).

Expand Down Expand Up @@ -138,16 +138,16 @@ The [docker compose file](./Source/DockerCompose/docker-compose.yml) can be used
To get help on launching and debugging the solutions as containers and switching out your solution(s), see the [help guide](./Help/container/HELP.md).

## Mock Data Holder - Requirements
Data Holders require these core functions defined in the [Consumer Data Standards](https://consumerdatastandardsaustralia.github.io/standards-archives/standards-1.33.0/#introduction) to operate in the [Consumer Data Right](https://www.cdr.gov.au/):
- Identity Provider for [authentication and authorisation](https://consumerdatastandardsaustralia.github.io/standards-archives/standards-1.33.0/#security-profile). Compliant with OAuth and [FAPI 1.0 Advanced Profile](https://openid.net/specs/openid-financial-api-part-2-1_0.html).
- [Dynamic Client Registration](https://consumerdatastandardsaustralia.github.io/standards-archives/standards-1.33.0/#dcr-apis) to allow clients to register their Software Products.
- Data Recipient and Software Product metadata updates using the [Register APIs](https://consumerdatastandardsaustralia.github.io/standards-archives/standards-1.33.0/#register-apis).
Data Holders require these core functions defined in the [Consumer Data Standards](https://consumerdatastandardsaustralia.github.io/standards-archives/standards-1.34.0/#introduction) to operate in the [Consumer Data Right](https://www.cdr.gov.au/):
- Identity Provider for [authentication and authorisation](https://consumerdatastandardsaustralia.github.io/standards-archives/standards-1.34.0/#security-profile). Compliant with OAuth and [FAPI 1.0 Advanced Profile](https://openid.net/specs/openid-financial-api-part-2-1_0.html).
- [Dynamic Client Registration](https://consumerdatastandardsaustralia.github.io/standards-archives/standards-1.34.0/#dcr-apis) to allow clients to register their Software Products.
- Data Recipient and Software Product metadata updates using the [Register APIs](https://consumerdatastandardsaustralia.github.io/standards-archives/standards-1.34.0/#register-apis).
- Industry specific data (one of)
- [Banking APIs](https://consumerdatastandardsaustralia.github.io/standards-archives/standards-1.33.0/#banking-apis).
- [Energy APIs](https://consumerdatastandardsaustralia.github.io/standards-archives/standards-1.33.0/#energy-apis)
- [Banking APIs](https://consumerdatastandardsaustralia.github.io/standards-archives/standards-1.34.0/#banking-apis).
- [Energy APIs](https://consumerdatastandardsaustralia.github.io/standards-archives/standards-1.34.0/#energy-apis)
- Industry agnostic data
- [Common APIs](https://consumerdatastandardsaustralia.github.io/standards-archives/standards-1.33.0/#common-apis).
- [Metrics and metadata update requests](https://consumerdatastandardsaustralia.github.io/standards-archives/standards-1.33.0/#admin-apis).
- [Common APIs](https://consumerdatastandardsaustralia.github.io/standards-archives/standards-1.34.0/#common-apis).
- [Metrics and metadata update requests](https://consumerdatastandardsaustralia.github.io/standards-archives/standards-1.34.0/#admin-apis).

The Mock Data Holder combined with the [Authorisation Server](https://github.com/ConsumerDataRight/authorisation-server) provides all of these functions for the Banking and Energy industries. The below diagram provides a view of the Mock Data Holder and and Authorisation Server when opened in an integrated development environment.

Expand Down
91 changes: 8 additions & 83 deletions Source/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -202,87 +202,12 @@ dotnet_diagnostic.SA1208.severity = none
# field should not follow class
dotnet_diagnostic.SA1201.severity = none

#Maintainability

# S2325: Methods and properties that don't access instance data should be static
######################################################
# Any project specific rules must go in this section #
######################################################
[Startup.cs]
# Make Configure and ConfigureServices static method
dotnet_diagnostic.S2325.severity = none

[*.cs]
# Disable xUnit1013 warning
dotnet_diagnostic.xUnit1013.severity = none
csharp_prefer_system_threading_lock = true:suggestion
#region should not be located within a code element
dotnet_diagnostic.SA1123.severity = none
dotnet_diagnostic.SA1601.severity = none
dotnet_diagnostic.SA1616.severity = none
dotnet_diagnostic.SA1108.severity = none

# A multi-line initializer in a C# code file should use a comma on the last line.
dotnet_diagnostic.SA1413.severity = none

[Meta.cs]
# Remove this empty class, write its code or make it an "interface".
dotnet_diagnostic.S2094.severity = none

[US15350_MDH_BankingAPI_GetTransactions.cs]
# Complete the task associated to this 'TODO' comment. (https://rules.sonarsource.com/csharp/RSPEC-1135)
dotnet_diagnostic.S1135.severity = none

[Account.cs]
# A closing square bracket within a C# statement is not spaced correctly.(There is an issue with identifying nullable array properties.)
dotnet_diagnostic.SA1011.severity = none

[Customer.cs]
# A closing square bracket within a C# statement is not spaced correctly.(There is an issue with identifying nullable array properties.)
dotnet_diagnostic.SA1011.severity = none

[Person.cs]
# A closing square bracket within a C# statement is not spaced correctly.(There is an issue with identifying nullable array properties.)
dotnet_diagnostic.SA1011.severity = none

[EnergyAccount.cs]
# Classes should not be empty
dotnet_diagnostic.S2094.severity = none
# A closing square bracket within a C# statement is not spaced correctly.(There is an issue with identifying nullable array properties.)
dotnet_diagnostic.SA1011.severity = none

[EnergyConcession.cs]
# A closing square bracket within a C# statement is not spaced correctly.(There is an issue with identifying nullable array properties.)
dotnet_diagnostic.SA1011.severity = none

[EnergyAccountConcession.cs]
# A closing square bracket within a C# statement is not spaced correctly.(There is an issue with identifying nullable array properties.)
dotnet_diagnostic.SA1011.severity = none

[EnergyAccountPlan.cs]
# A closing square bracket within a C# statement is not spaced correctly.(There is an issue with identifying nullable array properties.)
dotnet_diagnostic.SA1011.severity = none

[US27571_MDH_EnergyAPI_GetAccounts.cs]
# A closing square bracket within a C# statement is not spaced correctly.(There is an issue with identifying nullable array properties.)
dotnet_diagnostic.SA1011.severity = none

[US12975_MDH_BankingAPI_GetAccounts.cs]
# A closing square bracket within a C# statement is not spaced correctly.(There is an issue with identifying nullable array properties.)
dotnet_diagnostic.SA1011.severity = none

[CommonPerson.cs]
# A closing square bracket within a C# statement is not spaced correctly.(There is an issue with identifying nullable array properties.)
dotnet_diagnostic.SA1011.severity = none


[AesEncryptor.cs]
# A closing parenthesis within a C# statement is not spaced correctly.
dotnet_diagnostic.SA1009.severity = none
# Some cryptographic factory methods are obsolete
dotnet_diagnostic.SYSLIB0045.severity = none

# These are Auth Server files that needs removing once they are fixed. The issue happens when the Auth Server is copied to MDH for building.
[ClientClaims.{cs}]
dotnet_diagnostic.CS8618.severity = silent
[SoftwareProductConfiguration.{cs}]
dotnet_diagnostic.S1075.severity = silent
[ClientRepository.{cs}]
dotnet_diagnostic.S2139.severity = silent
[GrantRepository.{cs}]
dotnet_diagnostic.S2139.severity = silent
[*Tests.cs]
# Make Configure and ConfigureServices static method
dotnet_diagnostic.S2325.severity = none
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118">
<PackageReference Include="StyleCop.Analyzers.Unstable" Version="1.2.0.556">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace CDR.DataHolder.Banking.Domain.Entities
using System;

namespace CDR.DataHolder.Banking.Domain.Entities
{
public class Account : Shared.Domain.Entities.Account
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@ public enum ProductCategory
TermDeposits = 9,
TradeFinance = 10,
TransAndSavingsAccounts = 11,
TravelCards = 12
TravelCards = 12,
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ public async Task<bool> CanAccessAccount(string accountId)
/// <param name="transactionsFilter">Query filter.</param>
/// <param name="page">Page number.</param>
/// <param name="pageSize">Page size.</param>
/// <returns></returns>
public async Task<Page<AccountTransaction[]>> GetAccountTransactions(AccountTransactionsFilter transactionsFilter, int page, int pageSize)
{
if (!transactionsFilter.NewestTime.HasValue)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="AutoMapper" Version="13.0.1" />
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.2.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.7" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.7">
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.2.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.14" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.14">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.7" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.14" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="SonarAnalyzer.CSharp" Version="10.5.0.109200">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118">
<PackageReference Include="StyleCop.Analyzers.Unstable" Version="1.2.0.556">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
Loading
Loading