Skip to content

Commit a1da9c6

Browse files
authored
v1.2.0 release
2 parents b91897b + bb9f526 commit a1da9c6

File tree

119 files changed

+5850
-1434
lines changed

Some content is hidden

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

119 files changed

+5850
-1434
lines changed

.azuredevops/pipelines/build-v2.yml

Lines changed: 346 additions & 305 deletions
Large diffs are not rendered by default.

.github/workflows/docker.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ jobs:
7171
uses: docker/build-push-action@v2
7272
with:
7373
context: ./Source
74-
file: ./Source/Dockerfile.for-testing
74+
file: ./Source/Dockerfile
7575
platforms: linux/amd64,linux/arm64
7676
push: ${{ github.repository_owner == 'ConsumerDataRight' && github.event_name != 'pull_request' }}
7777
tags: ${{ steps.meta.outputs.tags }}

.github/workflows/dotnet.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ jobs:
9191
# Build mock-data-recipient image
9292
- name: Build the mock-data-recipient image
9393
run: |
94-
docker build ./mock-data-recipient/Source --file ./mock-data-recipient/Source/Dockerfile.for-testing --tag mock-data-recipient:latest
94+
docker build ./mock-data-recipient/Source --file ./mock-data-recipient/Source/Dockerfile --tag mock-data-recipient:latest
9595
9696
# Build mock-data-recipient-integration-tests image
9797
- name: Build the mock-data-recipient-integration-tests image

CHANGELOG.md

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

77
## [Unreleased]
88

9+
## [1.2.0] - 2023-03-21
10+
### Changed
11+
- Updated to be compliant with FAPI 1.0 phase 3.
12+
- Dynamic Client Registration Azure Function updated to be compliant with FAPI 1.0 phase 3.
13+
- Home page html content to reflect latest version
14+
15+
## [1.1.3] - 2022-11-24
16+
### Fixed
17+
- Add body to post requests. [Sandbox Issue 15](https://github.com/ConsumerDataRight/sandbox/issues/15)
18+
19+
## [1.1.2] - 2022-10-27
20+
### Fixed
21+
- Fixed data conversion error when saving Cdr Arrangement. [Sandbox Issue 14](https://github.com/ConsumerDataRight/sandbox/issues/14)
22+
23+
## [1.1.1] - 2022-10-19
24+
### Fixed
25+
- Send redirect_uris as an array instead of string when performing background Dynamic Client Registration requests. [Issue 50](https://github.com/ConsumerDataRight/mock-data-recipient/issues/50)
26+
- Changed CdrArrangement.ClientId database column data type from UniqueIdentifier to nvarchar(100).
27+
- Intermittent issue where redirect_uri in consent and PAR JWT is null. [Sandbox Issue 11](https://github.com/ConsumerDataRight/sandbox/issues/11)
28+
- mtls_endpoint_aliases not used as per RFC 8705 in PAR and token exchange. [Sandbox Issue 12](https://github.com/ConsumerDataRight/sandbox/issues/12)
29+
930
## [1.1.0] - 2022-10-05
1031
### Added
1132
- Logging middleware to create a centralised list of all API requests and responses
@@ -67,4 +88,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6788
## [0.1.0] - 2021-10-01
6889

6990
### Added
70-
- First release of the Mock Data Recipient.
91+
- First release of the Mock Data Recipient.

Help/container/HELP.md

Lines changed: 130 additions & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -1,107 +1,130 @@
1-
<h2>Use the pre-built image for this solution</h2>
2-
3-
<br />
4-
<p>1. Pull the latest image from <a href="https://hub.docker.com/r/consumerdataright/mock-data-recipient" title="Download the from docker hub here" alt="Download the from docker hub here">Docker Hub</a></p>
5-
6-
<span style="display:inline-block;margin-left:1em;">
7-
docker pull consumerdataright/mock-data-recipient
8-
</span>
9-
10-
<br />
11-
<p>2. Run the Mock Data Recipient container</p>
12-
13-
<span style="display:inline-block;margin-left:1em;">
14-
docker run -d -h mock-data-recipient -p 9001:9001 --add-host=host.docker.internal:host-gateway --name mock-data-recipient consumerdataright/mock-data-recipient
15-
<br \><br \>
16-
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:2019-latest
17-
<br \><br \>
18-
Please note - This docker compose file utilises the Microsoft SQL Server Image from Docker Hub.<br \>
19-
The Microsoft EULA for the Microsoft SQL Server Image must be accepted to continue.<br \>
20-
See the Microsoft SQL Server Image on Docker Hub for more information.<br \>
21-
Using the above command from a MS Windows command prompt will run the database.<br \>
22-
</span>
23-
24-
<br />
25-
<p>3. Use the docker compose file to run a multi-container mock CDR Ecosystem.</p>
26-
27-
<span style="display:inline-block;margin-left:1em;">
28-
The <a href="../../Source/DockerCompose/docker-compose.yml" title="/DockerCompose/docker-compose.yml" alt="Use the docker compose file located here - /DockerCompose/docker-compose.yml">docker compose file</a> can be used to run multiple containers from the Mock CDR Ecosystem, by starting the <a href="https://hub.docker.com/editions/community/docker-ce-desktop-windows" title="Docker Desktop for Windows" alt="Docker Desktop for Windows">docker desktop</a>
29-
(if using a non MS Windows environment, you will need to add this route to the network), this will be added to your hosts file and is used for inter container connectivity via your host IP Address, eg C:\Windows\System32\drivers\etc\hosts
30-
</span>
31-
32-
<br />
33-
34-
<span style="display:inline-block;margin-left:1em;">
35-
###.###.###.### host.docker.internal
36-
</span>
37-
38-
<br />
39-
40-
[<img src="./images/docker-desktop.png" height='300' width='625' alt="MS Docker Desktop"/>](./images/docker-desktop.png)
41-
42-
<p>4. Execute the <a href="../../Source/DockerCompose/docker-compose.yml" title="/DockerCompose/docker-compose.yml" alt="Use the docker compose file located here - /DockerCompose/docker-compose.yml">docker compose file</a>, the default configuration is to run all mock solutions and executing the comand below will run all the solutions.
43-
</p>
44-
45-
<span style="display:inline-block;margin-left:1em;margin-bottom:10px;">
46-
docker-compose up
47-
</span>
48-
<br />
49-
<br />
50-
51-
<span style="display:inline-block;margin-left:1em;margin-bottom:16px;">
52-
Please note - This docker compose file utilises the Microsoft SQL Server Image from Docker Hub.<br \>
53-
The Microsoft EULA for the Microsoft SQL Server Image must be accepted to continue.<br \>
54-
Replace this unset ACCEPT_MSSQL_EULA variable with a Y if you accept the EULA. eg ACCEPT_EULA=Y<br \>
55-
See the Microsoft SQL Server Image on Docker Hub for more information.<br \>
56-
</span>
57-
58-
[<img src="./images/containers-running.png" height='300' width='625' alt="Containers Running"/>](./images/containers-running.png)
59-
60-
<span style="display:inline-block;margin-left:1em;margin-top:10px">
61-
Should you wish to switch out your own solution, remark the relevant code out of this file.<br \>
62-
In this example we will be simulating the switching out of our Mock Data Recipient, we are using the<br \>
63-
database connection string Server=host.docker.internal and the endpoints shown below to<br \>
64-
connect to the running containers, this will result in the Mock Data Recipient running in MS Visual Studio,<br \>
65-
connected to the Mock Register and the Mock Data Holder running in docker.<br \>
66-
For details on how to run a Mock solution in MS Visual Studio
67-
see <a href="../debugging/HELP.md" title="Debug Help Guide" alt="View the Debug Help Guide.">help guide</a>
68-
</span>
69-
<br />
70-
<br />
71-
72-
[<img src="./images/mdr-switch-out-settings.png" height='300' width='625' alt="Mock Data Recipient switched out settings"/>](./images/mdr-switch-out-settings.png)
73-
74-
<span style="display:inline-block;margin-left:1em;margin-top:10px;margin-bottom:10px;">
75-
How to build your own image instead of downloading it from docker hub.<br \>
76-
navigate to .\mock-data-recipient\Source<br \>
77-
open a command prompt and execute the following;<br \>
78-
docker build -f Dockerfile.container -t mock-data-recipient .<br \>
79-
docker run -d -h mdr-host -p 9001:9001 --add-host=host.docker.internal:host-gateway --name mock-data-recipient mock-data-recipient<br \><br \>
80-
Please note - By default, the container above will be using a MS SQL database container, using this command from a MS Windows command prompt will run the database,<br \>
81-
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:2019-latest
82-
</span>
83-
84-
<span style="display:inline-block;margin-left:1em;margin-top:10px;margin-bottom:10px;">
85-
You can connect to the MS SQL database container from MS Sql Server Management Studio (SSMS) using
86-
the following settings; <br />
87-
Server type: Database Engine <br />
88-
Server name: localhost <br />
89-
Authentication: SQL Server Authentication <br />
90-
Login: sa <br />
91-
Password: Pa{}w0rd2019 <br />
92-
</span>
93-
<br />
94-
95-
[<img src="./images/ssms-login-error.png" height='300' width='400' alt="SSMS Login Error"/>](./images/ssms-login-error.png)
96-
97-
<p>
98-
(Please note - if the above error occurs whilst trying to connect to the MS SQL container, the SQL Server Service MUST BE STOPPED, you can do this from SQL Server Manager)
99-
</p>
100-
101-
<p>5. The running solution</p>
102-
103-
<span style="display:inline-block;margin-left:1em;margin-bottom:1em;">
104-
Our switched out Mock Data Recipient solution will now be running.
105-
</span>
106-
107-
[<img src="./images/mdr-switch-out-running.png" height='300' width='625' alt="The Mock Data Recipient solution"/>](./images/mdr-switch-out-running.png)
1+
# Use the pre-built image
2+
3+
The Mock Data Recipient image is available on [Docker Hub](https://hub.docker.com/r/consumerdataright/mock-data-recipient).
4+
5+
There are a number of ways that this image can be used.
6+
7+
## Pull the Mock Data Recipient image from Docker Hub
8+
9+
Run the following command to pull the latest image from Docker Hub:
10+
11+
```
12+
docker pull consumerdataright/mock-data-recipient
13+
```
14+
15+
You can also pull a specific image by supplying a tag, such as the name of the branch ("main" or "develop") or a release number:
16+
17+
```
18+
# Pull the image from the main branch
19+
docker pull consumerdataright/mock-data-recipient:main
20+
21+
# Pull the 0.5.0 version of the image
22+
docker pull consumerdataright/mock-data-recipient:0.5.0
23+
```
24+
25+
## Run a multi-container Mock CDR Ecosystem
26+
27+
Multiple containers can be run concurrently to simulate a CDR ecosystem. The [Mock Register](https://github.com/ConsumerDataRight/mock-register), [Mock Data Holder](https://github.com/ConsumerDataRight/mock-data-holder), [Mock Data Holder Energy](https://github.com/ConsumerDataRight/mock-data-holder-energy) and [Mock Data Recipient](https://github.com/ConsumerDataRight/mock-data-recipient) containers can be run by using the `docker-compose.yml` file.
28+
29+
The Mock CDR Ecosystem relies on SQL Server for data persistence so the container has a dependency on the SQL Server container image provided by Microsoft.
30+
31+
In order to run the Mock CDR Ecosystem and related SQL Server instance, use the provided `docker-compose.yml` file.
32+
33+
```
34+
# Navigate to the Source directory where the docker-compose.yml file is located.
35+
cd .\Source\DockerCompose
36+
37+
# Run the Mock CDR Ecosystem and SQL Server containers.
38+
docker-compose up -d
39+
40+
# When finished, stop the containers.
41+
docker-compose down
42+
```
43+
### Note: EULA for SQL Server
44+
The `docker-compose.yml` file utilises the Microsoft SQL Server Image from Docker Hub. The Microsoft EULA for the Microsoft SQL Server Image must be accepted to continue.
45+
Set the `ACCEPT_EULA` environment variable to `Y` within the `docker-compose.yml` if you accept the EULA.
46+
See the [Microsoft SQL Server Image](https://hub.docker.com/_/microsoft-mssql-server) on Docker Hub for more information.
47+
48+
Example of accepting the `ACCEPT_EULA` environment variable of the SQL Server container.
49+
```
50+
mssql:
51+
container_name: sql1
52+
image: 'mcr.microsoft.com/mssql/server:2019-latest'
53+
ports:
54+
- '1433:1433'
55+
environment:
56+
- ACCEPT_EULA=Y
57+
```
58+
59+
### Note: Mock host names
60+
61+
Each Mock solution has a default host name, as per below:
62+
63+
| Mock solution | Default host name |
64+
|-------------------------|-------------------------|
65+
| Mock Register | mock-register |
66+
| Mock Data Holder | mock-data-holder |
67+
| Mock Data Holder Energy | mock-data-holder-energy |
68+
| Mock Data Recipient | mock-data-recipient |
69+
70+
To resolve these host names, each of these host names can be registered in the local machine's `hosts` file (located in C:\Windows\System32\drivers\etc\).
71+
72+
```
73+
127.0.0.1 mock-register
74+
127.0.0.1 mock-data-holder
75+
127.0.0.1 mock-data-holder-energy
76+
127.0.0.1 mock-data-recipient
77+
127.0.0.1 mssql
78+
```
79+
80+
### Switching out a container in the multi-container Mock CDR Ecosystem with your own solution
81+
82+
You can switch out one of the mock solutions running in the multi-container Mock CDR Ecosystem with a mock solution running in MS Visual Studio or with your own solution.
83+
84+
Within the `docker-compose.yml` file, comment out the solution that you do not want to be started. E.g. The Mock Data Recipient:
85+
86+
[<img src="./images/mdr-switch-out-compose-comment.png" width='625' alt="Compose file with MDR commented out."/>](./images/mdr-switch-out-compose-comment.png)
87+
88+
Start the Mock CDR Ecosystem using the docker compose file.
89+
```
90+
# Run the Mock CDR Ecosystem containers.
91+
docker-compose -f docker-compose.yml up -d
92+
```
93+
94+
In this example we will be switching out our Mock Data Recipient.
95+
Clone the [Mock Data Recipient](https://github.com/ConsumerDataRight/mock-data-recipient) repository from GitHub and open the solution in MS Visual Studio.
96+
97+
Build and run the Mock Data Recipient in MS Visual Studio. Our switched out Mock Data Recipient solution will now be running. This will result in the Mock Data Recipient running in MS Visual Studio, connected to the Mock Register and the Mock Data Holders running in docker.
98+
99+
[<img src="./images/mdr-switch-out-running.png" width='625' alt="The Mock Data Recipient solution"/>](./images/mdr-switch-out-running.png)
100+
101+
For more details on how to run a mock solution in MS Visual Studio see [help guide](../debugging/HELP.md).
102+
103+
## Build your own Mock Data Recipient docker image
104+
A Mock Data Recipient Docker image can also be built and run as a Docker container using your local source code.
105+
106+
Build the new docker image.
107+
```
108+
docker build -f Dockerfile -t mock-data-recipient .
109+
```
110+
Run the SQL Server image.
111+
```
112+
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:2019-latest
113+
```
114+
Run the new docker image.
115+
```
116+
docker run -d -h mock-data-recipient -p 9001:9001 --add-host=mssql:host-gateway --name mock-data-recipient mock-data-recipient
117+
```
118+
119+
### Connecting to the MS SQL database container
120+
You can connect to the MS SQL database container from MS SQL Server Management Studio (SSMS) using the following settings:
121+
```
122+
Server type: Database Engine
123+
Server name: mssql
124+
Authentication: SQL Server Authentication
125+
Login: sa
126+
Password: Pa{}w0rd2019
127+
```
128+
129+
## Host on your own infrastructure
130+
The mock solutions can also be hosted on your own infrastructure, such as virtual machines or kubernetes clusters, in your private data centre or in the public cloud.
-46.8 KB
Binary file not shown.
-68.6 KB
Binary file not shown.
-38.5 KB
Binary file not shown.
90.9 KB
Loading
169 KB
Loading

0 commit comments

Comments
 (0)