/bpn-did-resolution-service

Tractus-X Resolver Service for BPN <> DID resolution

Primary LanguageJavaApache License 2.0Apache-2.0

BPN-DID Resolution Service

Contributors Stargazers Apache 2.0 License Latest Release

The BPN-DID Resolution Service (BDRS) provides a directory of Business Partner Numbers (BPN) and their associated DIDs. The directory is used by dataspace participant agents to resolve a DID for a BPN.

The directory is requested via a RESTFul HTTPS API and is designed to be cached locally for resolution operations. When requesting the directory, the client must include a JWT with a presentation containing its MembershipCrediential for authentication.

Implementation

The BDRS is a collection of extensions to the EDC core runtime.

Variants

There are two general variants of BDRS:

  1. Production: named "bdrs-server", this distribution utilizes Postgres and Hashicorp Vault for data and secret retention. Please take a look at the helm chart README
  2. Testing: named "bdrs-server-memory", this distribution uses all in-memory components to lower the barrier of entry and the need for configuration when testing against BDRS

Interacting with BDRS

BDRS comes with two APIs:

  1. Management API: used to maintain directory listing entries. Should not be exposed without additional protection to the internet.
  2. Directory API: clients can obtain the BPN-DID resolution mapping directory as a whole. Clients should implement a reasonable strategy to cache the directory locally. Note that a valid VerifiablePresentation in JWT format, containing a valid MembershipCredential (also JWT format) must be provided as Bearer token in the Authorization header!

Run official Helm charts

checkout the Chart README

Build and run BDRS from source

  • Build sources (-x test skips the tests):

    ./gradlew build -x test
  • Run with java:

    java -jar <VM-PARAMS> runtimes/bdrs-server/build/libs/bdrs-server.jar
    java -jar <VM-PARAMS> runtimes/bdrs-server/build/libs/bdrs-server-memory.jar

    Note that configuration parameters have to be supplied as VM parameters or environment variables.

  • Run with Helm (recommended, assuming KinD):

    ./gradlew dockerize
    kind load docker-image bdrs-server:latest
    kind load docker-image bdrs-server-memory:latest
    
    helm install bdrs-server charts/bdrs-server \
      --set server.debug.enabled="true" \
      --set server.image.pullPolicy="Never" \
      --set server.image.tag="latest" \
      --set server.image.repository="bdrs-server" \
      -f path/to/your/values.yaml \
      --wait-for-jobs --timeout=120s --dependency-update

License

Distributed under the Apache 2.0 License. See LICENSE for more information.