Skip to content

A mock version of a Consumer Data Right Data Recipient Software Product that can be used in the development and testing of CDR solutions

License

Notifications You must be signed in to change notification settings

PayPalAustralia/mock-data-recipient

 
 

Repository files navigation

Consumer Data Right Logo

Consumer Data Standards 1.11.0 Conformance Test Suite 3.2 made-with-dotnet made-with-csharp MIT License Pull Requests Welcome

Consumer Data Right - Mock Data Recipient

This project includes source code, documentation and instructions for a Consumer Data Right (CDR) Mock Data Recipient.

This repository contains a mock implementation of a Mock Data Recipient and is offered to help the community in the development and testing of their CDR solutions.

Mock Data Recipient - Alignment

The Mock Data Recipient aligns to v1.11.0 of the Consumer Data Standards. The Mock Data Recipient passed v3.2 of the Conformance Test Suite for Data Recipients.

Getting Started

The Mock Data Recipient was built using the Mock Register and the Mock Data Holder. You can swap out any of the Mock Data Holder, Mock Data Register and Mock Data Recipient solutions with a solution of your own.

There are a number of ways that the artefacts within this project can be used:

  1. Build and deploy the source code
  2. Use the pre-built image
  3. Use the docker compose file to run a multi-container mock CDR Ecosystem

Build and deploy the source code

To get started, clone the source code.

git clone https://github.com/ConsumerDataRight/mock-data-recipient.git
Set your debug profile to CDR.DataRecipient.Web

If you would like to contribute features or fixes back to the Mock Data Recipient repository, consult the contributing guidelines.

Use the pre-built image

A version of the Mock Data Recipient is built into a single Docker image that is made available via docker hub.

The container can simply be run by pulling and running the latest image using the following Docker commands:

Pull the latest image

docker pull consumerdataright/mock-data-recipient

Run the Mock Recipient container

docker run -d -h mock-data-recipient -p 9001:9001 --name mock-data-recipient consumerdataright/mock-data-recipient

Certificate Management

Consult the Certificate Management documentation for more information about how certificates are used for the Mock Data Recipient.

Use the docker compose file to run a multi-container mock CDR Ecosystem

The docker compose file can be used to run multiple containers from the Mock CDR Ecosystem.

  1. Add the following to your hosts file, eg C:\Windows\System32\drivers\etc\hosts
127.0.0.1 mock-data-holder
127.0.0.1 mock-data-recipient
127.0.0.1 mock-register
  1. Flush the DNS cache, on Windows use:
ipconfig /flushdns
  1. Run the docker compose file
docker-compose up

Update the docker compose file if you would like to swap out one of the mock solutions with a solution of your own.

Mock Data Recipient - Architecture

The following diagram outlines the high level architecture of the Mock Data Recipient:

Mock Recipient - Architecture

Mock Data Recipient - Components

The Mock Data Recipient contains the following components:

  • Website & API
    • Hosted at https://localhost:9001
    • Contains the user interface for testing a variety of interactions with participants, including:
      • Get Data Holder Brands
      • Get SSA
      • Dynamic Client Registation
      • Consent and Authorisation
      • Consumer Data Sharing
      • PAR
    • Also contains the JWKS and CDR Arrangement Revocation endpoints.
  • SDK
    • Used internally within the Mock Data Recipient to simplify interactions with the Register and Data Holders.
  • Repository
    • An in memory SQLite repository is included that contains local data used within the Mock Data Recipient.
    • Includes the following collections:
      • data-holder-brands - populated when a response is received from the Register's Get Data Holder Brands API.
      • client-registrations - populated when a response is received from a successful DCR request to a Data Holder.
      • cdr-arrangements - populated after a successful consent and authorisation flow with a Data Holder.

Technology Stack

The following technologies have been used to build the Mock Data Recipient:

  • The source code has been written in C# using the .NET 5 framework.
  • The Repository utilises a SQLite instance.

Testing

The Mock Data Recipient has been built as a test harness to demonstrate the interactions between the Register and Data Holders. The Mock Data Recipient allows the end user to test the various interactions by changing input values, executing and viewing the response. The Mock Data Recipient requires a Mock Register and a Mock Data Holder to completely mimic the CDR Ecosystem. You can swap out any of the Mock Data Holder, Mock Data Register and Mock Data Recipient solutions with a solution of your own.

Contribute

We encourage contributions from the community. See our contributing guidelines.

Code of Conduct

This project has adopted the Contributor Covenant. For more information see the code of conduct.

License

MIT License

Notes

The Mock Data Recipient is provided as a development tool only. It conforms to the Consumer Data Standards and Register Design.

About

A mock version of a Consumer Data Right Data Recipient Software Product that can be used in the development and testing of CDR solutions

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 83.7%
  • HTML 13.7%
  • CSS 1.1%
  • JavaScript 0.5%
  • Batchfile 0.5%
  • Dockerfile 0.3%
  • Shell 0.2%