Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v2.1.0 release #103

Merged
merged 7 commits into from
Aug 21, 2024
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
133 changes: 57 additions & 76 deletions .azuredevops/pipelines/build-v2.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
# Build pipeline v2 (Containerised)
schedules:
- cron: '0 2 * * 0'
displayName: 'Run at 2:00 AM every Sunday (UTC)'
always: true
branches:
include:
- develop

trigger:
- develop
- main
Expand Down Expand Up @@ -68,16 +75,6 @@ steps:
repository: mock-register-integration-tests
tags: latest

# # Build mock-register-for-testing
# - task: Docker@2
# displayName: Build mock-register-for-testing image
# inputs:
# command: build
# Dockerfile: ./Source/Dockerfile.for-testing
# buildContext: ./Source
# repository: mock-register-for-testing
# tags: latest

# List docker images
- task: Docker@2
displayName: List Docker images
Expand All @@ -86,21 +83,16 @@ steps:
command: images

# Run unit tests
- task: DockerCompose@0
displayName: Unit Tests - Up
inputs:
action: Run a Docker Compose command
dockerComposeFile: Source/docker-compose.UnitTests.yml
dockerComposeCommand: up --abort-on-container-exit --exit-code-from mock-register-unit-tests
- script: |
docker compose --file $(Build.SourcesDirectory)/Source/docker-compose.UnitTests.yml up --abort-on-container-exit --exit-code-from mock-register-unit-tests
displayName: 'Unit Tests - Up'
condition: always()

# Remove unit tests
- task: DockerCompose@0
displayName: Unit Tests - Down
condition: always()
inputs:
action: Run a Docker Compose command
dockerComposeFile: Source/docker-compose.UnitTests.yml
dockerComposeCommand: down
- script: |
docker compose --file $(Build.SourcesDirectory)/Source/docker-compose.UnitTests.yml down
displayName: 'Unit Tests - Down'
condition: always()

# Login to ACR
- task: Docker@2
Expand All @@ -120,24 +112,16 @@ steps:
#****************************************************************************************************************
# Run integration tests
#****************************************************************************************************************
- task: DockerCompose@0
displayName: Integration Tests - Up
- script: |
docker compose --file $(Build.SourcesDirectory)/Source/docker-compose.IntegrationTests.yml up --abort-on-container-exit --exit-code-from mock-register-integration-tests
displayName: 'Integration Tests - Up'
condition: always()
inputs:
action: Run a Docker Compose command
dockerComposeFile: Source/docker-compose.IntegrationTests.yml
dockerComposeFileArgs: |
TEST_FILTER=Category!=CTSONLY
dockerComposeCommand: up --abort-on-container-exit --exit-code-from mock-register-integration-tests

# Remove integration tests
- task: DockerCompose@0
displayName: Integration Tests - Down
- script: |
docker compose --file $(Build.SourcesDirectory)/Source/docker-compose.IntegrationTests.yml down
displayName: 'Integration Tests - Down'
condition: always()
inputs:
action: Run a Docker Compose command
dockerComposeFile: Source/docker-compose.IntegrationTests.yml
dockerComposeCommand: down

# Run trx formatter to output .MD and .CSV
- script: |
Expand All @@ -146,7 +130,9 @@ steps:
-v=$(Build.SourcesDirectory)/Source/_temp/mock-register-integration-tests/testresults/formatted/:/app/out/:rw \
$(AcrBaseUrl).azurecr.io/trx-formatter -i results.trx -t "MR" --outputprefix "MR" -o out/
displayName: 'Run trx-formatter'
condition: always()
condition: always()
env:
TEST_FILTER: "Category!=CTSONLY"

# Publish mock-register integration tests results
- publish: Source/_temp/mock-register-integration-tests/testresults
Expand All @@ -162,45 +148,34 @@ steps:
testResultsFormat: 'VSTest' # Options: JUnit, NUnit, VSTest, xUnit, cTest
testResultsFiles: '**/results.trx'
publishRunAttachments: true # Optional

#****************************************************************************************************************
# Run integration tests For CTS Only tests
#****************************************************************************************************************
- task: DockerCompose@0
displayName: Integration Tests Tests For CTS Only - Up
- script: |
docker compose --file $(Build.SourcesDirectory)/Source/docker-compose.IntegrationTests.yml up --abort-on-container-exit --exit-code-from mock-register-integration-tests
displayName: 'Integration Tests Tests For CTS Only - Up'
condition: always()
inputs:
action: Run a Docker Compose command
dockerComposeFile: Source/docker-compose.IntegrationTests.yml
dockerComposeFileArgs: |
TEST_FILTER=Category=CTSONLY
CtsSettings__AzureAd__TokenEndpointUrl=$(CtsSettings__AzureAd__TokenEndpointUrl)
CtsSettings__AzureAd__ClientId=$(CtsSettings__AzureAd__ClientId)
CtsSettings__AzureAd__ClientSecret=$(CtsSettings__AzureAd__ClientSecret)
CtsSettings__AzureAd__Scope=$(CtsSettings__AzureAd__Scope)
CtsSettings__AzureAd__GrantType=$(CtsSettings__AzureAd__GrantType)
CtsSettings__AzureAd__UnauthorisedClientId=$(CtsSettings__AzureAd__UnauthorisedClientId)
CtsSettings__AzureAd__UnauthorisedClientSecret=$(CtsSettings__AzureAd__UnauthorisedClientSecret)
IdentityProvider_Downstream_BaseUrl=$(IdentityProvider_Downstream_BaseUrl)
Authorization__Issuer=$(Authorization__Issuer)
Authorization__ClientId=$(Authorization__ClientId)
Authorization__Scope=$(Authorization__Scope)
BasePathExpression=$(BasePathExpression)
BasePath=$(BasePath)
PublicHostName=$(CtsPublicHostNameUrl)
SecureHostName=$(CtsSecureHostNameUrl)
Certificate__CertThumbprintNameHttpHeaderName=X-SSLClientCertThumbprint
Certificate__CertCommonNameHttpHeaderName=X-SSLClientCertCN
dockerComposeCommand: up --abort-on-container-exit --exit-code-from mock-register-integration-tests
env:
TEST_FILTER: "Category=CTSONLY"
CtsSettings__AzureAd__TokenEndpointUrl: '$(CtsSettings__AzureAd__TokenEndpointUrl)'
CtsSettings__AzureAd__ClientId: '$(CtsSettings__AzureAd__ClientId)'
CtsSettings__AzureAd__ClientSecret: '$(CtsSettings__AzureAd__ClientSecret)'
CtsSettings__AzureAd__Scope: '$(CtsSettings__AzureAd__Scope)'
CtsSettings__AzureAd__GrantType: '$(CtsSettings__AzureAd__GrantType)'
CtsSettings__AzureAd__UnauthorisedClientId: '$(CtsSettings__AzureAd__UnauthorisedClientId)'
CtsSettings__AzureAd__UnauthorisedClientSecret: '$(CtsSettings__AzureAd__UnauthorisedClientSecret)'
IdentityProvider_Downstream_BaseUrl: '$(IdentityProvider_Downstream_BaseUrl)'
Authorization__Issuer: '$(Authorization__Issuer)'
Authorization__ClientId: '$(Authorization__ClientId)'
Authorization__Scope: '$(Authorization__Scope)'
BasePathExpression: '$(BasePathExpression)'
BasePath: '$(BasePath)'
PublicHostName: '$(CtsPublicHostNameUrl)'
SecureHostName: '$(CtsSecureHostNameUrl)'
Certificate__CertThumbprintNameHttpHeaderName: 'X-SSLClientCertThumbprint'
Certificate__CertCommonNameHttpHeaderName: 'X-SSLClientCertCN'

# Remove integration tests For CTS Only tests
- task: DockerCompose@0
displayName: Integration Tests For CTS Only - Down
condition: always()
inputs:
action: Run a Docker Compose command
dockerComposeFile: Source/docker-compose.IntegrationTests.yml
dockerComposeCommand: down

# Run trx formatter to output .MD and .CSV
- script: |
docker run \
Expand All @@ -210,6 +185,12 @@ steps:
displayName: 'Run trx-formatter'
condition: always()

# Remove integration tests For CTS Only tests
- script: |
docker compose --file $(Build.SourcesDirectory)/Source/docker-compose.IntegrationTests.yml down
displayName: 'Integration Tests For CTS Only - Down'
condition: always()

# Publish mock-register integration tests results
- publish: Source/_temp/mock-register-integration-tests/testresults
displayName: Publish MockRegister CTS Integration tests
Expand Down Expand Up @@ -257,18 +238,18 @@ steps:
artifact: Mock-Register - Unit tests

- task: UseDotNet@2
displayName: 'Use .NET 6 sdk'
displayName: 'Use .NET 8 sdk'
condition: always()
inputs:
packageType: sdk
version: '6.0.x'
version: '8.0.x'
performMultiLevelLookup: true

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

- task: CmdLine@2
displayName: 'Check dotnet-ef version'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:
- name: Autobuild
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell
# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
Expand Down
14 changes: 6 additions & 8 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ on:
- '.github/pull_request_template.md'
- '.github/stale.yml'
- 'LICENSE'
- 'Postman/**'
pull_request:
branches: [main, develop]
types: [opened, synchronize, reopened]
Expand All @@ -25,7 +24,6 @@ on:
- '.github/pull_request_template.md'
- '.github/stale.yml'
- 'LICENSE'
- 'Postman/**'

env:
DOCKER_IMAGE: consumerdataright/mock-register
Expand All @@ -36,11 +34,11 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Setup Docker Metadata
id: meta
uses: docker/metadata-action@v3
uses: docker/metadata-action@v5
with:
# list of Docker images to use as base name for tags
images: |
Expand All @@ -54,21 +52,21 @@ jobs:
type=semver,pattern={{major}}

- name: Setup Docker QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v3

- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v3

- name: Login to DockerHub
if: ${{ github.repository_owner == 'ConsumerDataRight' && github.event_name != 'pull_request' }}
uses: docker/login-action@v1
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push Docker image
id: docker_build
uses: docker/build-push-action@v2
uses: docker/build-push-action@v6
with:
context: ./Source
file: ./Source/Dockerfile
Expand Down
10 changes: 4 additions & 6 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ on:
- '.github/pull_request_template.md'
- '.github/stale.yml'
- 'LICENSE'
- 'Postman/**'
pull_request:
branches: [ main, develop ]
types: [opened, synchronize, reopened]
Expand All @@ -23,7 +22,6 @@ on:
- '.github/pull_request_template.md'
- '.github/stale.yml'
- 'LICENSE'
- 'Postman/**'

env:
buildConfiguration: 'Release'
Expand Down Expand Up @@ -67,22 +65,22 @@ jobs:
# Run unit tests
- name: Run unit tests
run: |
docker-compose -f ./mock-register/Source/docker-compose.UnitTests.yml up --abort-on-container-exit --exit-code-from mock-register-unit-tests
docker compose -f ./mock-register/Source/docker-compose.UnitTests.yml up --abort-on-container-exit --exit-code-from mock-register-unit-tests

# Remove unit tests
- name: Remove unit tests
run: |
docker-compose -f ./mock-register/Source/docker-compose.UnitTests.yml down
docker compose -f ./mock-register/Source/docker-compose.UnitTests.yml down

# Run integration tests
- name: Run integration tests
run: |
docker-compose -f ./mock-register/Source/docker-compose.IntegrationTests.yml up --abort-on-container-exit --exit-code-from mock-register-integration-tests
docker compose -f ./mock-register/Source/docker-compose.IntegrationTests.yml up --abort-on-container-exit --exit-code-from mock-register-integration-tests

# Remove integration tests
- name: Remove integration tests
run: |
docker-compose -f ./mock-register/Source/docker-compose.IntegrationTests.yml down
docker compose -f ./mock-register/Source/docker-compose.IntegrationTests.yml down

# Archive unit test results
- name: Archive unit test results
Expand Down
29 changes: 29 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,35 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [2.1.0] - 2024-08-16
### Changed
- Updated NuGet packages

## [2.0.0] - 2024-06-12
### Changed
- Replaced Postman collections with a Polyglot Notebook solution
- Migrated from .NET 6 to .NET 8
- Migrated docker compose from v1 to v2
- Added SSL Server Validation capability with switched off by default
- Added custom User-Agent header for request filtering on GetClientJwks

## [1.4.0] - 2024-03-13
### Changed
- Updated NuGet packages to avoid vulnerabilities

### Fixed
- Location for log file in appsettings file is fixed - [Issue 65](https://github.com/ConsumerDataRight/mock-register/issues/65)

## [1.3.4] - 2024-02-14
### Fixed
- lastUpdated field fixed to populate the correct value
- Remove the old Scope "cdr-register:bank:read" references
- Added property code_challenge_methods_supported in Mock Register

## [1.3.3] - 2024-02-01
### Fixed
- Audience validations for token endpoint have been fixed

## [1.3.2] - 2023-11-29
### Changed
- Refactored code and fixed code smells
Expand Down
2 changes: 1 addition & 1 deletion Help/container/HELP.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Example of accepting the `ACCEPT_EULA` environment variable of the SQL Server co
```
mssql:
container_name: sql1
image: 'mcr.microsoft.com/mssql/server:2019-latest'
image: 'mcr.microsoft.com/mssql/server:2022-latest'
ports:
- '1433:1433'
environment:
Expand Down
8 changes: 4 additions & 4 deletions Help/faq/HowToUpdateRegisterHostname.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ However, there are fields in the Open ID Disovery Document that are still pointi

In order to change this, the following configuration items need to be updated:

- Edit `CDR.Register.Admin.API\appsettings.Production.json`, and update:
- Edit `CDR.Register.Admin.API\appsettings.Release.json`, and update:

```
"IdentityServerTokenUri": "https://{updated-hostname}:7001/idp/connect/token",
Expand All @@ -23,7 +23,7 @@ For e.g.:
"IdentityServerTokenUri": "https://cdr.register:7001/idp/connect/token",
```

- Edit `CDR.Register.Discovery.API\appsettings.Production.json`, and update:
- Edit `CDR.Register.Discovery.API\appsettings.Release.json`, and update:

```
"IdentityServerUrl": "https://{updated-hostname}:7000/idp",
Expand All @@ -36,7 +36,7 @@ For e.g.:
"IdentityServerIssuer": "https://cdr.register:7000/idp",
```

- Edit `CDR.Register.IdentityServer\appsettings.Production.json`, and update:
- Edit `CDR.Register.IdentityServer\appsettings.Release.json`, and update:

```
"IssuerUri": "https://{updated-hostname}:7000/idp",
Expand All @@ -51,7 +51,7 @@ For e.g.:
"TokenUri": "https://cdr.register:7001/idp/connect/token",
```

- Edit `CDR.Register.SSA.API\appsettings.Production.json`, and update:
- Edit `CDR.Register.SSA.API\appsettings.Release.json`, and update:

```
"IdentityServerUrl": "https://{updated-hostname}:7000/idp",
Expand Down
Loading
Loading