This demo project, developed and maintained by the Data Standards Body (DSB), provides a straightforward NodeJS server implementation that showcases the use of the js-holder-sdk middleware functions. It demonstrates how client requests can automatically trigger the generation of error objects and HTTP status codes that comply with published Consumer Data Standards (CDS).
This implementation serves as a practical example for developers to understand the application of the JS Holder SDK in a real-world scenario.
- Data Holder server Implementation: Seamlessly integrates the holder-sdk as an npm package and utilises the middleware functions effectively.
- Endpoint Configuration: Lists application API endpoints through an
endpoints.json
configuration file. - Error Handling: Simulates real-world scenarios to demonstrate comprehensive error handling, fully detailed in the JS Holder SDK GitHub repository.
Before you begin, ensure you have the following installed:
- Git, for cloning the repository.
- Node.js (Note: This demo project was tested with NodeJS v18.12.1.)
- npm (Node Package Manager) - included with Node.js installation.
-
Create a fork of this repository. To do this, click the "Fork" button on the top right corner of this page.
-
After forking the repository, clone it to your local machine. You can do this by running the following command in your terminal or command prompt:
git clone https://github.com/your-username/project-name.git
Replace
your-username
with your GitHub username andproject-name
with the name of your repository. -
Once the repository is cloned, navigate to the project directory by running:
cd project-name
Replace
project-name
with the name of the repository.
-
Build the Project:
npm run build
-
Start the Server:
npm start
Use the DSB Postman collection (/src/postman/MiddlewareDemo.postman_collection.json
) to test common scenarios, such as invalid headers.
Run the Postman collection with the environment file in src/postman/MiddleWare Demo.postman_environment.json
, which contains an JWT access token with scopes.
We welcome contributions from the community! If you'd like to contribute to this project, please follow these simple steps:
-
Create a new branch for your work from the
master
branch:git checkout -b feature/your-feature-name
-
Begin making your changes or contributions.
-
Follow the instructions in the project repository to run and test your changes locally.
-
Commit your changes with clear and concise commit messages.
-
Push your changes to your forked repository.
-
Open a pull request (PR) using the
master
branch in the original repository as the destination branch. Include a detailed description of your changes and the problem you are addressing. -
Engage in the discussion on your PR and make any necessary adjustments based on feedback from maintainers and other contributors.
-
Once your PR is approved and all tests pass, it will be merged into the project.
Encountered an issue? We're here to help. Please visit our issue reporting guidelines for submitting an issue.
Join our newsletter to receive the latest updates, release notes, and alerts. Subscribe here.
The artefact is released under the MIT License, which allows the community to use and modify it freely.
The artefacts in this repository are offered without warranty or liability, in accordance with the MIT licence.
The Data Standards Body (DSB) develops these artefacts in the course of its work, in order to perform quality assurance on the Australian Consumer Data Right Standards (Data Standards).
The DSB makes this repository, and its artefacts, public on a non-commercial basis in the interest of supporting the participants in the CDR ecosystem.
The resources of the DSB are primarily directed towards assisting the Data Standards Chair for developing the Data Standards.
Consequently, the development work provided on the artefacts in this repository is on a best-effort basis, and the DSB acknowledges the use of these tools alone is not sufficient for, nor should they be relied upon with respect to accreditation, conformance, or compliance purposes.