This is an API server meant to be a backend for issuing Verifiable Credentials
For dev use you'll need node.js, mkcert and docker-compose
Configure SSL certs for the local docker instances, you should only have to do this once
- Run
mkcert -install
to install a local CA - Generate SSL certs with
mkcert -cert-file ~/certs/127.0.0.1.nip.io.crt -key-file ~/certs/127.0.0.1.nip.io.key '*.127.0.0.1.nip.io'
- Run
echo export NODE_EXTRA_CA_CERTS="$(mkcert -CAROOT)/rootCA.pem" | tee -a ~/.bashrc ~/.zshrc && exec $0
to add the local CA to your environment
Now you can build and start the server by:
- Build and start the server using
docker-compose up --build
, if you get an error that a port is in use you're probably already running a web server or db on your machine, you'll have to either stop it or adjust the ports used by this project indocker-compose.override.yml
- As the server starts for the first time it will generate an admin token for you, note it down as it's not possible to retrieve it after this point
- Once the server is up and running you can get to it's interactive documentation at https://credadmin.127.0.0.1.nip.io/api-docs/swagger
- Click the
Authorize
button near the top of the page and enterBearer xyz
wherexyz
is the admin token you noted earlier
All configuration is done through environment variables.
Variable | Default | Description |
---|---|---|
CA_DB_CONNECTION_URL | Database connection URL | |
CA_JWT_SECRET | secret | Secret used when signing JWTs for user auth |
OIDC_COMPARE | sub | OIDC userInfo field to compare to externalIds |
OIDC_ISSUER_URL | URL of OIDC server | |
OIDC_USERINFO_PATH | /userinfo | Path to the userinfo endpoint of OIDC server |
PORT | 3000 | Port to listen for http requests on |
PUBLIC_URL | Publicly reachable URL for this server | |
TEMPLATE_URL | local://templates | URL to retrieve templates from using @tweedegolf/storage-abstraction" |