Skip to content

bird-wp07/local-module

Repository files navigation

Integration Documentation

This page is only the developer's documentation of the Local Module. If you are looking for the documentation about integrating and using the Local Module, please switch to Integration Documentation.

Developer Setup

Developer setup for UNIX systems (Windows/WSL, Linux, Mac).

  1. Clone repository, npm i
  2. Set up secrets
    • Store central service mTLS client cert/key file as cs-auth-mtls-client-certkey.p12.
    • Store central service mTLS server cert file as cs-auth-mtls-server-cert.pem.
    • Create a file named .env with the following contents and fill in the passphrase.
      WP07_LOCAL_MODULE_BASEURL=http://127.0.0.1:2048
      WP07_LOCAL_MODULE_LOGLEVEL=debug
      WP07_LOCAL_MODULE_LOGDIR=/tmp/wp07-local-module
      WP07_DSS_BASEURL=http://127.0.0.1:8080
      WP07_CS_BASEURL=http://46.83.201.35.bc.googleusercontent.com
      WP07_CS_ISSUER_ID=8d51fa75-b98e-4d8f-98f1-dee5d471a450
      WP07_CS_TOKEN_URL=https://225.96.234.35.bc.googleusercontent.com/realms/bird-cs-dev/protocol/openid-connect/token
      WP07_CS_CA_PEM=cs-auth-mtls-server-cert.pem
      WP07_CS_CLIENT_PFX=cs-auth-mtls-client-certkey.p12
      WP07_CS_CLIENT_PFX_PASSWORD=______________
      
    • Add the three files to the local ignore list .git/info/exclude. See src/settings/settings.ts for details about the configuration parameters.
  3. Test the setup by running containerized tests: npm run test0.

Useful commands

  • Start DSS: ./scripts/dss.sh run. See ./scripts/dss.run --help for.
  • Start local module: npm run start
  • Start local module in debug session: npm run start:debug
  • Run tests (may depend on DSS and local module): npm run test
  • Run self-contained tests from working tree: npm run test0
  • Run test in debug session: npm run test:debug

Directory Tree

.
├── .github/                        - github pipelines for linux and windows bundles
├── bundle/
│   └── win10-x64/                  - files contained in the windows bundle
├── dist/                           - compiled javascript output
├── docs/                           - user manual source files
├── generated/
│   └── version.ts                  - generated .ts source file exporting version
├── node_modules/                   - customary node modules direcory
├── scripts/                        - assorted scripts and helpers; see the files' header comments
├── src/                            - source code
│   ├── applogic/                   - application logic abstraction layer
│   ├── cs/                         - central service mini SDK
│   ├── dss/                        - DSS related mini SDK
│   ├── server/                     - HTTP API and server related sources
│   ├── settings/                   - runtime configuration
│   ├── utility/                    - utils and helpers
│   └── main.ts                     - main entrypoint of application
├── tests/                          - Tests source code
├── .env                            - config file to set or override envvars
├── cs-auth-mtls-client-certkey.p12 - mTLS client certificate and private key file
├── cs-auth-mtls-server-cert.pem    - mTLS server certificate file
├── package.json                    - customary package.json
├── package-lock.json               - customary package-lock.json
├── README.md                       - this README
└── tsconfig.json                   - customary tsconfig.json

Resources