Skip to content

Commit

Permalink
v1.1.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
CDR-AndrewG authored Oct 5, 2022
2 parents 112980e + cce8a97 commit 8967725
Show file tree
Hide file tree
Showing 68 changed files with 4,714 additions and 688 deletions.
41 changes: 28 additions & 13 deletions .azuredevops/pipelines/build-v2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,29 @@ steps:
condition: always()
artifact: Mock-Register - Unit tests

# Login to ACR
- task: Docker@2
displayName: Login to ACR
condition: always()
inputs:
command: login
containerRegistry: <<yourContainerRegistryName>>

# Run trx formatter to output .MD and .CSV
- script: |
docker run \
-v=$(Build.SourcesDirectory)/Source/_temp/mock-register-integration-tests/testresults/results.trx:/app/results.trx:ro \
-v=$(Build.SourcesDirectory)/Source/_temp/mock-register-integration-tests/testresults/formatted/:/app/out/:rw \
<<yourContainerRegistryName>>.azurecr.io/trx-formatter -i results.trx -t "MR" --outputprefix "MR" -o out/
displayName: 'Run trx-formatter'
condition: always()

# Publish mock-register integration tests results
- publish: Source/_temp/mock-register-integration-tests/testresults
displayName: Publish MockRegister Integration tests
condition: always()
artifact: Mock-Register - Integration tests

# TODO - MJS - Run formatter over TRX to produce formatted report suitable for attaching to Devops US & publish as artifact

- task: UseDotNet@2
displayName: 'Use .NET 6 sdk'
condition: always()
Expand Down Expand Up @@ -174,36 +189,36 @@ steps:
#buildConfiguration: # Optional
#publishRunAttachments: true # Optional

- task: Docker@2
displayName: Login to ACR
inputs:
command: login
containerRegistry: acrcdrsandboxdev
# - task: Docker@2
# displayName: Login to ACR
# inputs:
# command: login
# containerRegistry: <<yourContainerRegistryName>>

- task: Docker@2
displayName: 'Re-Tag Mock Register container image with :branch-name'
inputs:
containerRegistry: acrcdrsandboxdev
containerRegistry: <<yourContainerRegistryName>>
repository: 'mock-register'
command: tag
arguments: 'mock-register-for-testing acrcdrsandboxdev.azurecr.io/mock-register:$(Build.SourceBranchName)'
arguments: 'mock-register-for-testing <<yourContainerRegistryName>>.azurecr.io/mock-register:$(Build.SourceBranchName)'

- task: Docker@2
displayName: 'Re-Tag Register API image with :latest (for develop branch only)'
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/develop'))
inputs:
containerRegistry: acrcdrsandboxdev
containerRegistry: <<yourContainerRegistryName>>
repository: 'mock-register'
command: tag
arguments: 'mock-register-for-testing acrcdrsandboxdev.azurecr.io/mock-register:latest'
arguments: 'mock-register-for-testing <<yourContainerRegistryName>>.azurecr.io/mock-register:latest'

- task: CmdLine@2
displayName: 'Push Register container image with :branch-name tag to ACR'
inputs:
script: 'docker push acrcdrsandboxdev.azurecr.io/mock-register:$(Build.SourceBranchName)'
script: 'docker push <<yourContainerRegistryName>>.azurecr.io/mock-register:$(Build.SourceBranchName)'

- task: CmdLine@2
displayName: 'Push Register container image with :latest tag to ACR (develop branch only)'
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/develop'))
inputs:
script: 'docker push acrcdrsandboxdev.azurecr.io/mock-register:latest'
script: 'docker push <<yourContainerRegistryName>>.azurecr.io/mock-register:latest'
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.sh text eol=lf # linux line-endings
14 changes: 11 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [1.1.0] - 2022-10-05
### Added
- Logging middleware to create a centralised list of all API requests and responses

### Changed
- Get SSA x-v 1 and 2 now only return banking scopes. x-v 3 still returns banking and energy scopes
- Transactional database tables updated to temporal tables

### Fixed
- Issue occuring when using docker compose eco system. [Issue 52](https://github.com/ConsumerDataRight/mock-data-recipient/issues/52)

## [1.0.1] - 2022-08-30
### Changed
- Removed CDR.Register.IdentityServer project that relied on Identity Server 4 and replaced with CDR.Register.Infosec project.
Expand All @@ -15,9 +26,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fixed incorrect element in Get Data Holder Brands response. [Issue 1](https://github.com/ConsumerDataRight/sandbox/issues/1)
- Fixed issue with authorisation scopes for latest version of authenticated register APIs. Get Data Holder Brands and Get SSA.

### Changed
- Removed CDR.Register.IdentityServer project that relied on Identity Server 4 and replaced with CDR.Register.Infosec project.

## [1.0.0] - 2022-07-22
### Changed
- First version of the Mock Register deployed into the CDR Sandbox.
Expand Down
4 changes: 2 additions & 2 deletions Postman/mock-register.postman_collection.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
![Consumer Data Right Logo](https://raw.githubusercontent.com/ConsumerDataRight/mock-register/main/cdr-logo.png)

[![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)
[![Consumer Data Standards v1.18.0](https://img.shields.io/badge/Consumer%20Data%20Standards-v1.18.0-blue.svg)](https://consumerdatastandardsaustralia.github.io/standards/#introduction)
[![made-with-dotnet](https://img.shields.io/badge/Made%20with-.NET-1f425Ff.svg)](https://dotnet.microsoft.com/)
[![made-with-csharp](https://img.shields.io/badge/Made%20with-C%23-1f425Ff.svg)](https://docs.microsoft.com/en-us/dotnet/csharp/)
[![MIT License](https://img.shields.io/github/license/ConsumerDataRight/mock-register)](./LICENSE)
Expand All @@ -12,7 +12,7 @@ This project includes source code, documentation and instructions for the Consum
The ACCC operates the CDR Register within the CDR ecosystem. This repository contains a mock implementation of the Mock Register and is offered to help the community in the development and testing of their CDR solutions.

## Mock Register - Alignment
The Mock Register aligns to [v1.17.0](https://consumerdatastandardsaustralia.github.io/standards/#introduction) of the [Consumer Data Standards](https://consumerdatastandardsaustralia.github.io/standards/#introduction).
The Mock Register aligns to [v1.18.0](https://consumerdatastandardsaustralia.github.io/standards/#introduction) of the [Consumer Data Standards](https://consumerdatastandardsaustralia.github.io/standards/#introduction).

## Getting Started
There are a number of ways that the artefacts within this project can be used:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<StartupObject></StartupObject>
<Version>1.0.1</Version>
<FileVersion>1.0.1</FileVersion>
<AssemblyVersion>1.0.1</AssemblyVersion>
<Version>1.1.0</Version>
<FileVersion>1.1.0</FileVersion>
<AssemblyVersion>1.1.0</AssemblyVersion>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Version>1.0.1</Version>
<FileVersion>1.0.1</FileVersion>
<AssemblyVersion>1.0.1</AssemblyVersion>
<Version>1.1.0</Version>
<FileVersion>1.1.0</FileVersion>
<AssemblyVersion>1.1.0</AssemblyVersion>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<IsPackable>false</IsPackable>
<Version>1.0.1</Version>
<FileVersion>1.0.1</FileVersion>
<AssemblyVersion>1.0.1</AssemblyVersion>
<Version>1.1.0</Version>
<FileVersion>1.1.0</FileVersion>
<AssemblyVersion>1.1.0</AssemblyVersion>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Version>1.0.1</Version>
<FileVersion>1.0.1</FileVersion>
<AssemblyVersion>1.0.1</AssemblyVersion>
<Version>1.1.0</Version>
<FileVersion>1.1.0</FileVersion>
<AssemblyVersion>1.1.0</AssemblyVersion>
</PropertyGroup>

<ItemGroup>
Expand Down
20 changes: 20 additions & 0 deletions Source/CDR.Register.API.Logger/CDR.Register.API.Logger.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Version>1.1.0</Version>
<FileVersion>1.1.0</FileVersion>
<AssemblyVersion>1.1.0</AssemblyVersion>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="5.0.9" />
<PackageReference Include="Microsoft.IO.RecyclableMemoryStream" Version="2.2.0" />
<PackageReference Include="Serilog.AspNetCore" Version="4.1.0" />
<PackageReference Include="Serilog.Settings.Configuration" Version="3.3.0" />
<PackageReference Include="Serilog.Sinks.MSSqlServer" Version="5.7.1" />
</ItemGroup>

</Project>
9 changes: 9 additions & 0 deletions Source/CDR.Register.API.Logger/IRequestResponseLogger.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace CDR.Register.API.Logger
{
using Serilog;

public interface IRequestResponseLogger
{
ILogger Log { get; }
}
}
13 changes: 13 additions & 0 deletions Source/CDR.Register.API.Logger/LoggerExtensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
namespace CDR.Register.API.Logger
{
using Microsoft.Extensions.DependencyInjection;

public static class LoggerExtensions
{
public static IServiceCollection AddRequestResponseLogging(this IServiceCollection services)
{
services.AddSingleton<IRequestResponseLogger, RequestResponseLogger>();
return services;
}
}
}
55 changes: 55 additions & 0 deletions Source/CDR.Register.API.Logger/RequestResponseLogger.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
namespace CDR.Register.API.Logger
{
using System.Diagnostics;
using Microsoft.Extensions.Configuration;
using Serilog;
using Serilog.Core;

public class RequestResponseLogger : IRequestResponseLogger, IDisposable
{
private readonly Logger _logger;
private readonly IConfiguration _configuration;

public ILogger Log { get { return _logger; } }

public RequestResponseLogger(IConfiguration configuration)
{

_configuration = configuration;

_logger = new LoggerConfiguration()
.ReadFrom.Configuration(configuration, sectionName: "SerilogRequestResponseLogger")
.Enrich.WithProperty("RequestMethod", "")
.Enrich.WithProperty("RequestBody", "")
.Enrich.WithProperty("RequestHeaders", "")
.Enrich.WithProperty("RequestPath", "")
.Enrich.WithProperty("RequestQueryString", "")
.Enrich.WithProperty("StatusCode", "")
.Enrich.WithProperty("ElapsedTime", "")
.Enrich.WithProperty("ResponseHeaders", "")
.Enrich.WithProperty("ResponseBody", "")
.Enrich.WithProperty("RequestHost", "")
.Enrich.WithProperty("RequestIpAddress", "")
.Enrich.WithProperty("ClientId", "")
.Enrich.WithProperty("SoftwareId", "")
.Enrich.WithProperty("DataHolderBrandId", "")
.Enrich.WithProperty("FapiInteractionId", "")
.CreateLogger();
}

public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}

protected virtual void Dispose(bool disposing)
{
if (disposing)
{
Serilog.Log.CloseAndFlush();
}

}
}
}
Loading

0 comments on commit 8967725

Please sign in to comment.