Core delivery C# ASP.NET backend template.
A Docker Compose template is in compose.yml.
A local environment with:
- Localstack for AWS services (S3, SQS)
- Redis
- MongoDB
- This service.
- A commented out frontend example.
docker compose up --build -dNote: running docker locally requires the following environment variables:
TRACESNT__BASEURL=traces-webservice-baseUrl
TRACESNT__USERNAME=your-traces-username
TRACESNT__AUTHENTICATIONKEY=your-traces-authentication-key
TRACESNT__WEBSERVICECLIENTID=your-traces-client-id
XAPIKEY=
# Cognito — for clients deployed outside CDP
AUTHENTICATION__COGNITO__AUTHORITY=https://cognito-idp.<region>.amazonaws.com/<user-pool-id>
AUTHENTICATION__COGNITO__SCOPE=<cognito-scope>
# STS — for CDP-internal services authenticating via IAM role
AUTHENTICATION__STS__AUTHORITY=https://<sts-oidc-issuer>
AUTHENTICATION__STS__SCOPE=<sts-scope>Both authentication authorities must be reachable at startup. See ADR-0004 for the full authentication design, including the IAM authorization requirement for STS clients.
A more extensive setup is available in github.com/DEFRA/cdp-local-environment
See above.
docker compose up -d mongodb
Alternatively install MongoDB locally:
- Install MongoDB on your local machine
- Start MongoDB:
sudo mongod --dbpath ~/mongodb-cdpIn CDP environments a MongoDB instance is already set up and the credentials exposed as enviromment variables.
To inspect the Database and Collections locally:
mongoshYou can use the CDP Terminal to access the environments' MongoDB.
Run the tests with:
Tests run by running a full WebApplication backed by Ephemeral MongoDB.
Tests do not use mocking of any sort and read and write from the in-memory database.
dotnet testRun CDP-Deployments application:
dotnet run --project Api --launch-profile DevelopmentExample SonarCloud configuration are available in the GitHub Action workflows.
We have added an example dependabot configuration file to the repository. You can enable it by renaming
the .github/example.dependabot.yml to .github/dependabot.yml
The Open Government Licence (OGL) was developed by the Controller of Her Majesty's Stationery Office (HMSO) to enable information providers in the public sector to license the use and re-use of their information under a common open licence.
It is designed to encourage use and re-use of information freely and flexibly, with only a few conditions.