{"id":23066931,"url":"https://github.com/dvsa/cvs-tsk-cert-gen-init","last_synced_at":"2025-06-14T19:08:22.956Z","repository":{"id":37444837,"uuid":"171844792","full_name":"dvsa/cvs-tsk-cert-gen-init","owner":"dvsa","description":"Task to process test resultst DynamoDB Stream events and push them onto a queue for onward processing","archived":false,"fork":false,"pushed_at":"2025-06-03T09:55:53.000Z","size":1323,"stargazers_count":1,"open_issues_count":12,"forks_count":2,"subscribers_count":10,"default_branch":"develop","last_synced_at":"2025-06-03T15:39:26.693Z","etag":null,"topics":["app-dev","cvs-project"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dvsa.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-02-21T09:48:11.000Z","updated_at":"2024-10-16T08:50:40.000Z","dependencies_parsed_at":"2023-09-22T20:55:10.597Z","dependency_job_id":"ff00d661-2595-464e-8523-833eae8b8656","html_url":"https://github.com/dvsa/cvs-tsk-cert-gen-init","commit_stats":null,"previous_names":[],"tags_count":2760,"template":false,"template_full_name":null,"purl":"pkg:github/dvsa/cvs-tsk-cert-gen-init","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dvsa%2Fcvs-tsk-cert-gen-init","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dvsa%2Fcvs-tsk-cert-gen-init/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dvsa%2Fcvs-tsk-cert-gen-init/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dvsa%2Fcvs-tsk-cert-gen-init/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dvsa","download_url":"https://codeload.github.com/dvsa/cvs-tsk-cert-gen-init/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dvsa%2Fcvs-tsk-cert-gen-init/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259868583,"owners_count":22924236,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["app-dev","cvs-project"],"created_at":"2024-12-16T05:15:37.188Z","updated_at":"2025-06-14T19:08:22.924Z","avatar_url":"https://github.com/dvsa.png","language":"TypeScript","readme":"# cvs-tsk-cert-gen-init\n\n## Introduction\n\nThe cert gen service is a lambda which is used to marshall data before cert gen service task generates the test certificates when tests are submitted.\n\n## Dependencies\n\nThe project runs on node \u003e10 with typescript and serverless framework. For further details about project dependencies, please refer to the `package.json` file.\n[nvm](https://github.com/nvm-sh/nvm/blob/master/README.md) is used to managed node versions and configuration explicitly done per project using an `.npmrc` file.\n\n### Prerequisites\n\nPlease install and run the following securiy programs as part of your development process:\n\n- [git-secrets](https://github.com/awslabs/git-secrets)\n  After installing, do a one-time set up with `git secrets --register-aws`. Run with `git secrets --scan`.\n\nThese will be run as part of your projects hooks so you don't accidentally introduce any new security vulnerabilities.\n\nYou will also require Docker to run the service locally if you wish to mock external dependencies.\n\n## Architecture\n\n### End to end design\n\n[All in one view](https://wiki.dvsacloud.uk/pages/viewpage.action?pageId=79254695)\n\n### cert gen microservice\n\nMore information about technical designs can be found under the [cert gen](https://wiki.dvsacloud.uk/display/HVT/Certificate+Generation+Design) section.\n\n## Getting started\n\nSet up your nodejs environment running `nvm use` and once the dependencies are installed using `npm i`, you can run the scripts from `package.json` to build your project.\nThis code repository uses [serverless framework](https://www.serverless.com/framework/docs/) to mock AWS capabilities for local development.\n\n### Environmental variables\n\n- The `BRANCH` environment variable indicates in which environment is this application running. Not setting this variable will result in defaulting to `local`.\n\n### Scripts\n\n- Building without source maps - `npm run build`\n- Building with source maps - `npm run build:dev`\n- Building the docker containers - `npm run build:docker`\n\n### Running\n\nThe app can be started by running `npm run start:docker`.\n\n### Configuration\n\nThe configuration file can be found under `src/config/config.yml`.\nEnvironment variable injection is possible with the syntax:\n`${BRANCH}`, or you can specify a default value: `${BRANCH:local}`.\n\n#### SQS\n\nSQS contains configuration for the local environment or the AWS environment. Locally, you need to provide the `localhost` region and the SQS endpoint, which in this case is the address of a docker image. `apiVersion` and `queueName` need to be provided for both environments.\n\n```yml\nsqs:\n  local:\n    params:\n      region: localhost\n      endpoint: http://sqs:9324\n      apiVersion: \"2012-11-05\"\n    queueName: cert-gen-q\n  remote:\n    params:\n      apiVersion: \"2012-11-05\"\n    queueName: cert-gen-q\n```\n\n### Debugging\n\nThe following environmental variables can be given to your serverless scripts to trace and debug your service:\n\n```shell\nAWS_XRAY_CONTEXT_MISSING = LOG_ERROR\nSLS_DEBUG = *\nBRANCH = local\n```\n\n## Testing\n\n### Unit testing\n\nIn order to test, you need to run the following:\n\n```sh\nnpm run test # unit tests\n```\n\n### End to end\n\n- [Automation test repository](https://github.com/dvsa/cvs-auto-svc)\n- [Java](https://docs.oracle.com/en/java/javase/11/)\n- [Serenity Cucumber with Junit](https://serenity-bdd.github.io/theserenitybook/latest/junit-basic.html)\n\n## Infrastructure\n\nWe follow a [gitflow](https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow) approach for development.\nFor the CI/CD and automation please refer to the following pages for further details:\n\n- [Development process](https://wiki.dvsacloud.uk/display/HVT/CVS+Pipeline+Infrastructure)\n- [Pipeline](https://wiki.dvsacloud.uk/pages/viewpage.action?pageId=36870584)\n\n## Contributing\n\nPlease familiarise yourself with [commitlint](https://commitlint.js.org/#/) and [conventional commits conventions](https://www.conventionalcommits.org/en/v1.0.0-beta.2/) as a hook is in place to enforce standards.\n\n### Hooks and code standards\n\nThe projects has multiple hooks configured using [husky](https://github.com/typicode/husky#readme) which will execute the following scripts: `security-checks`, `audit`, `tslint`, `prepush`.\nThe codebase uses [typescript clean code standards](https://github.com/labs42io/clean-code-typescript) as well as sonarqube for static analysis.\n\nSonarQube is available locally, please follow the instructions below if you wish to run the service locally (brew is the preferred approach).\n\n### Static code analysis\n\n_Brew_ (recommended):\n\n- Install sonarqube using brew\n- Change `sonar.host.url` to point to localhost, by default, sonar runs on `http://localhost:9000`\n- run the sonar server `sonar start`, then perform your analysis `npm run sonar-scanner`\n\n_Manual_:\n\n- [Download sonarqube](https://www.sonarqube.org/downloads/)\n- Add sonar-scanner in environment variables in your profile file add the line: `export PATH=\u003cPATH_TO_SONAR_SCANNER\u003e/sonar-scanner-3.3.0.1492-macosx/bin:$PATH`\n- Start the SonarQube server: `cd \u003cPATH_TO_SONARQUBE_SERVER\u003e/bin/macosx-universal-64 ./sonar.sh start`\n- In the microservice folder run the command: `npm run sonar-scanner`\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdvsa%2Fcvs-tsk-cert-gen-init","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdvsa%2Fcvs-tsk-cert-gen-init","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdvsa%2Fcvs-tsk-cert-gen-init/lists"}