A microservice for storing associations between user IDs and DIDs for applications that want to use DID-Auth
- Clone git repo
git clone git@github.com:Sphereon/did-mapping-ms.git cd did-mapping-ms
- Setting up Mongo
- First start Mongo and create a new DB for use by DID Mapping
sudo service mongod start mongo > use did_mapping
- If Mongo is not running in the default location, configure DID Mapping with the correct Mongo information. Create an
application.properties
, copy and replace the following variables in<>
with your own values.spring.data.mongodb.host=<mongo-host> spring.data.mongodb.port=<mongo-host-port> spring.data.mongodb.database=did_mapping
- First start Mongo and create a new DB for use by DID Mapping
- Run tests, build jar, and run DID Mapping using:
mvn java -jar target/did-mapping-1.0-SNAPSHOT.jar
- Regenerate swagger json after modifications to the REST API or models. (This is also done when the generate-test-resources phase, which is in the default lifecycle, is executed.)
mvn -Pwrite-swagger-json
#####Environment settings Before Docker or Kubernetes profiles can be executed, you'll need some environment settings. The registry settings in the pom.xml can be overridden on the mvn command.
-Ddocker.registry.push=<hostname for container push registry>
-Ddocker.registry.pull=<hostname for container pull registry> (The default is docker.io)
When using Kubernetes you can us an existing secret to access the container registry (This will be used in the deployment descriptor)
-Ddocker.registry.push.secret-name=<secret name to access the conatiner registry>
When using Kubernetes, the mongo database settings can be overridden with:
-Dconfig.mongodb.hostname=mongo
-Dconfig.mongodb.port=27017
-Dconfig.mongodb.database=did_mapping
The server protocol, tcp ports and exposed ports can be overridden. The default is
-Dcontainer.enable-tomcat-ajp=false
-Dtcp.port.internal=8080
-Dtcp.port.exposed=8801
To switch to AJP mode
-Dcontainer.enable-tomcat-ajp=true
-Dtcp.port.internal=8009
-Dtcp.port.exposed=127.0.0.1:8096
- To build a docker image
mvn -Pf8-build
- To start a docker container
mvn -Pdocker-start
- To push the image to a remote registry
mvn -Pf8-push
- To apply the service to Kubernetes
mvn -Pf8-apply
- Itś possible to combine
mvn -Pf8-build -Pf8-push -Pf8-apply
By default, once the service is running, documentation and example API calls can be found at: