Skip to content

Commit b91897b

Browse files
authored
v1.1.0 release
2 parents bb98baa + 5e0fd7e commit b91897b

File tree

49 files changed

+1740
-585
lines changed

Some content is hidden

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

49 files changed

+1740
-585
lines changed

.azuredevops/pipelines/build-v2.yml

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,12 +243,38 @@ steps:
243243
condition: always()
244244
artifact: Mock-Data-Recipient - Unit tests
245245

246+
# Login to ACR
247+
- task: Docker@2
248+
displayName: Login to ACR
249+
condition: always()
250+
inputs:
251+
command: login
252+
containerRegistry: <<yourContainerRegistryName>>
253+
254+
# Run trx formatter to output .MD and .CSV
255+
- script: |
256+
docker run \
257+
-v=$(Build.SourcesDirectory)/sb-mock-data-recipient/Source/_temp/mock-data-recipient-integration-tests/testresults/results.trx:/app/results.trx:ro \
258+
-v=$(Build.SourcesDirectory)/sb-mock-data-recipient/Source/_temp/mock-data-recipient-integration-tests/testresults/formatted/:/app/out/:rw \
259+
<<yourContainerRegistryName>>.azurecr.io/trx-formatter -i results.trx -t "MDR" --outputprefix "MDR" -o out/
260+
displayName: 'Run trx-formatter'
261+
condition: always()
262+
246263
# Publish mock-data-recipient integration tests results
247264
- publish: $(Build.SourcesDirectory)/sb-mock-data-recipient/Source/_temp/mock-data-recipient-integration-tests/testresults
248265
displayName: Publish integration tests
249266
condition: always()
250267
artifact: Mock-Data-Recipient - Integration tests
251268

269+
# Run trx formatter to output .MD and .CSV
270+
- script: |
271+
docker run \
272+
-v=$(Build.SourcesDirectory)/sb-mock-data-recipient/Source/_temp/mock-data-recipient-e2e-tests/testresults/results.trx:/app/results.trx:ro \
273+
-v=$(Build.SourcesDirectory)/sb-mock-data-recipient/Source/_temp/mock-data-recipient-e2e-tests/testresults/formatted/:/app/out/:rw \
274+
<<yourContainerRegistryName>>.azurecr.io/trx-formatter -i results.trx -t "MDR-E2E" --outputprefix "MDR-E2E" -o out/
275+
displayName: 'Run trx-formatter'
276+
condition: always()
277+
252278
# Publish mock-data-recipient e2e tests results
253279
- publish: $(Build.SourcesDirectory)/sb-mock-data-recipient/Source/_temp/mock-data-recipient-e2e-tests/testresults
254280
displayName: Publish e2e tests
@@ -301,4 +327,4 @@ steps:
301327
# #testRunTitle: # Optional
302328
# #buildPlatform: # Optional
303329
# #buildConfiguration: # Optional
304-
# #publishRunAttachments: true # Optional
330+
# #publishRunAttachments: true # Optional

CHANGELOG.md

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

77
## [Unreleased]
88

9+
## [1.1.0] - 2022-10-05
10+
### Added
11+
- Logging middleware to create a centralised list of all API requests and responses
12+
13+
### Changed
14+
- Primary key constraints for registrations. Now combines Client Id and Data Holder Brand Id as the unique constraint.
15+
916
## [1.0.1] - 2022-08-30
1017
### Changed
1118
- Updated arrangement revocation to match CDS v1.18. Configuration added based on the date to make functionality available or unavailable.

Source/CDR.DCR/CDR.DCR.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
<TargetFramework>net6.0</TargetFramework>
44
<AzureFunctionsVersion>v4</AzureFunctionsVersion>
55
<_FunctionsSkipCleanOutput>true</_FunctionsSkipCleanOutput>
6+
<Version>1.1.0</Version>
7+
<FileVersion>1.1.0</FileVersion>
8+
<AssemblyVersion>1.1.0</AssemblyVersion>
69
</PropertyGroup>
710
<ItemGroup>
811
<PackageReference Include="Azure.Storage.Queues" Version="12.11.0" />
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net6.0</TargetFramework>
5+
<ImplicitUsings>enable</ImplicitUsings>
6+
<Nullable>enable</Nullable>
7+
<Version>1.1.0</Version>
8+
<FileVersion>1.1.0</FileVersion>
9+
<AssemblyVersion>1.1.0</AssemblyVersion>
10+
</PropertyGroup>
11+
12+
<ItemGroup>
13+
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="5.0.9" />
14+
<PackageReference Include="Microsoft.IO.RecyclableMemoryStream" Version="2.2.0" />
15+
<PackageReference Include="Serilog.AspNetCore" Version="4.1.0" />
16+
<PackageReference Include="Serilog.Settings.Configuration" Version="3.3.0" />
17+
<PackageReference Include="Serilog.Sinks.MSSqlServer" Version="5.7.1" />
18+
</ItemGroup>
19+
20+
</Project>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
namespace CDR.DataRecipient.API.Logger
2+
{
3+
using Serilog;
4+
5+
public interface IRequestResponseLogger
6+
{
7+
ILogger Log { get; }
8+
}
9+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
namespace CDR.DataRecipient.API.Logger
2+
{
3+
using Microsoft.Extensions.DependencyInjection;
4+
5+
public static class LoggerExtensions
6+
{
7+
public static IServiceCollection AddRequestResponseLogging(this IServiceCollection services)
8+
{
9+
services.AddSingleton<IRequestResponseLogger, RequestResponseLogger>();
10+
return services;
11+
}
12+
}
13+
}
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
namespace CDR.DataRecipient.API.Logger
2+
{
3+
using System.Diagnostics;
4+
using Microsoft.Extensions.Configuration;
5+
using Serilog;
6+
using Serilog.Core;
7+
8+
public class RequestResponseLogger : IRequestResponseLogger, IDisposable
9+
{
10+
private readonly Logger _logger;
11+
private readonly IConfiguration _configuration;
12+
13+
public ILogger Log { get { return _logger; } }
14+
15+
public RequestResponseLogger(IConfiguration configuration)
16+
{
17+
18+
_configuration = configuration;
19+
20+
_logger = new LoggerConfiguration()
21+
.ReadFrom.Configuration(configuration, sectionName: "SerilogRequestResponseLogger")
22+
.Enrich.WithProperty("RequestMethod", "")
23+
.Enrich.WithProperty("RequestBody", "")
24+
.Enrich.WithProperty("RequestHeaders", "")
25+
.Enrich.WithProperty("RequestPath", "")
26+
.Enrich.WithProperty("RequestQueryString", "")
27+
.Enrich.WithProperty("StatusCode", "")
28+
.Enrich.WithProperty("ElapsedTime", "")
29+
.Enrich.WithProperty("ResponseHeaders", "")
30+
.Enrich.WithProperty("ResponseBody", "")
31+
.Enrich.WithProperty("RequestHost", "")
32+
.Enrich.WithProperty("RequestIpAddress", "")
33+
.Enrich.WithProperty("ClientId", "")
34+
.Enrich.WithProperty("SoftwareId", "")
35+
.Enrich.WithProperty("FapiInteractionId", "")
36+
.CreateLogger();
37+
}
38+
39+
public void Dispose()
40+
{
41+
Dispose(true);
42+
GC.SuppressFinalize(this);
43+
}
44+
45+
protected virtual void Dispose(bool disposing)
46+
{
47+
if (disposing)
48+
{
49+
Serilog.Log.CloseAndFlush();
50+
}
51+
52+
}
53+
}
54+
}

0 commit comments

Comments
 (0)