Skip to content

Latest commit

 

History

History
136 lines (97 loc) · 10.6 KB

2.-Step-(Configuration).md

File metadata and controls

136 lines (97 loc) · 10.6 KB

To access the Mobility Data Space in a convenient way you have to install and configure the Dataspace Connector and the MDS Dataspace Connector UI.

Generally, two ways exist, to get the connector and its UI up and running: Either you download the source code and run it locally or you use docker-images and start everything via docker-compose. We recommend using docker-compose!

Expected audience of this tutorial: We assume, the reader of this tutorial to be familiar with software development and software deployment in corporate infrastructures. Thus, no introduction is given to setup the basics like Java, Docker, etc.

MDS Test environment

Docker approach

  1. Copy all files from deployment example repository folder Mobility-Data-Space/dsc-deployment-example/docker-test-environment:

    • docker-compose.yml
    • conf/bootstrap.properties
    • conf/brokerCatalog.jsonld
    • conf/config.json
    • conf/keystore.p12
    • conf/truststore.p12
  2. Adjust docker-compose.yml to your needs:

    • Rename the downloaded certificate p12-file to keystore.p12 if it is not already named correctly and copy it to the conf folder overriding the existing keystore.p12.
      Hint: If you need to use another file name, you can adjust the file name of keystore in config.json at ids:keyStore entry.
    • If run in an infrastructure with a reverse proxy, you might want to disable SERVER_SSL_ENABLED at docker-compose.yml as your reverse proxy most probably will terminate TLS.
    • Replace default passwords (SPRING_SECURITY_USER_NAME and CONNECTOR_USER as well as SPRING_SECURITY_USER_PASSWORD and CONNECTOR_PASSWORD) must match. Further information about how to configure Dataspace Connector can be found here and here Be aware that application.properties variable names must be camel cased for docker (see Spring Boot Docs)
    • Protect access to the UI via your infrastructure (e.g. IP restriction or add Basic Auth)!
  3. Adjust config.json

    • Set @id of JSON root to the URL where your connector's root will be available (e.g., "@id" : "https://ids.ivi-test-connector.mobilitydataspace.io" or "@id" : "https://localhost:8080")
    • Set @id of ids:accessURL to the URL where your connector's root will be available and append /api/ids/data (e.g., "@id" : "https://ids.ivi-test-connector.mobilitydataspace.io/api/ids/data" or "@id" : "https://localhost:8080/api/ids/data")
    • Set @id of ids:title to your desired connector name (e.g., "@id" : "DRM Datenraum Mobilität GmbH Dataspace Connector"
    • Set connector description(e.g., An MDS Datasapce Connector of DRM Datenraum Mobilität GmbH for demonstration purposes)
    • Set @id of ids:curator to the URL of the connector curator (e.g., https://mobility-dataspace.eu)
    • Set @id of ids:maintainer to the URL of the connector maintainer (e.g., https://sovity.de)
      Please note, that there is no logical link between the Dataspace connector's deploy mode TEST_DEPLOYMENT/PRODUCTIVE_DEPLOYMENT (see here and here) and the Mobility Data Space's test environment and productive environment. In both environments, you need to set the Dataspace Connector's deploy mode to PRODUCTIVE_DEPLOYMENT to register your connector at the Catalog.
  4. Start containers via console

  5. Stop via console docker-compose down

Source Code Approach for local testing

Dataspace Connector

  1. Install Java, Maven and Node.js v.14

  2. Download source code of the latest release of Dataspace Connector.

  3. Adjust Dataspace Connector's settings

    • Adjust src/main/resources/conf/config.json
      • Set @id of JSON root to the URL where your connector's root will be available (e.g., "@id" : "https://localhost:8080")
      • Set @id of ids:accessURL to the URL where your connector's root will be available and append /api/ids/data (e.g., "@id" : "https://localhost:8080/api/ids/data")
      • Set @id of ids:title to your desired connector name (e.g., "@id" : "DRM Datenraum Mobilität GmbH Dataspace Connector"
      • Set connector description (e.g., An MDS Datasapce Connector of DRM Datenraum Mobilität GmbH for demonstration purposes)
      • Set @id of ids:curator to the URL of the connector curator (e.g., https://mobility-dataspace.eu)
      • Set @id of ids:maintainer to the URL of the connector maintainer (e.g., https://sovity.de)
      • Set the ids:keyStore to the path of your received p12-file
      • Set @id of ids:connectorDeployMode to idsc:PRODUCTIVE_DEPLOYMENT
        Please note, that there is no logical link between the Dataspace connector's deploy mode TEST_DEPLOYMENT/PRODUCTIVE_DEPLOYMENT (see here and here) and the Mobility Data Space's test environment and productive environment. In both environments, you need to set the Dataspace Connector's deploy mode to PRODUCTIVE_DEPLOYMENT to register your connector at the Catalog.
    • Adjust src/main/resources/application.properties
      • Set Clearing House and DAPS properties:
        clearing.house.url=https://clearing.test.mobility-dataspace.eu/logs/messages/
        daps.url=https://daps.test.mobility-dataspace.eu
        daps.token.url=https://daps.test.mobility-dataspace.eu/token
        daps.key.url=https://daps.test.mobility-dataspace.eu/jwks.json
        daps.incoming.dat.default.wellknown=/jwks.json
        daps.whitelisted.url=https://daps.test.mobility-dataspace.eu
        
        Info: To ensure traceability and auditability of transactions in the MDS, we require our participants to use the Clearing House on the productive stage. Clearing House only logs metadata (transaction ID, timestamp).
    • You most probably run your code on a local machine without a public URL pointing to your machine (e.g. https://ids.ivi-test-connector.mobilitydataspace.io). In that case, you need to set referred.check=false in application.properties.
    • Replace src/main/resources/conf/keystore.p12 with your received keystore
    • Add bootstrap.properties and brokerCatalog.jsonld to src/main/resources/bootstrap and adjust bootstrap.path=./src/main/resources/bootstrap accordingly as well as enabling bootstrapping via bootstrap.enabled=true property.
  4. Start Dataspace Connector

    • Open a console and cd into source folder
    • mvn clean compile
    • mvn spring-boot:run
  5. Access the connector

    • Use credentials set as spring.security.user.name and spring.security.user.password of application.properties to log-in into Swagger UI: https://localhost:8080/api/docs

MDS Dataspace Connector UI

  1. Download source code of the latest release of MDS Dataspace Connector UI.

  2. Install the backend (src/backend folder): npm install

  3. Start the backend (src/backend folder): npm start

  4. Install the UI (root folder): npm install --no-audit

  5. Start the UI (root folder) npm start serve.

  6. Access MDS Dataspace Connector UI: http://localhost:8082 MDS Dataspace Connector UI

Verify Configuration

Using Advanced View >> Settings >> General of the UI, you can verify your configuration changes. Please ensure that this information is accurate and complete as these fields represent the connector in the MDS catalog. MDS Dataspace Connector UI Settings Page

In addition, you can access connectors actuator page at https://localhost:8080/actuator/info to verify if a valid DAT could be acquired.

Please note, that there is no logical link between the Test mode of the Dataspace Connector and the Mobility Data Space Test environment. You need to use the Productive mode of the Dataspace Connector to work in the MDS Test environment.

MDS Productive environment

Please follow steps for MDS Test environment above, but make use of example files for productive environment at Mobility-Data-Space/dsc-deployment-example/docker-productive-environment. Major difference of these files are, that MDS URLs of Broker, DAPS and Clearing House point to the productive environment.

Docker approach

As stated above, the productive environment is pretty the same setup as the test environment, but with differences regarding targeted infrastructure URLs.

  • Clearing House and DAPS environment variables are pointing to productive environment:
      CLEARING_HOUSE_URL=https://clearing.mobility-dataspace.eu/logs/messages/
      DAPS_URL=https://daps.mobility-dataspace.eu
      DAPS_TOKEN_URL=https://daps.mobility-dataspace.eu/token
      DAPS_KEY_URL=https://daps.mobility-dataspace.eu/jwks.json
      DAPS_INCOMING_DAT_DEFAULT_WELLKNOWN=/jwks.json
      DAPS_WHITELISTED_URL=https://daps.mobility-dataspace.eu
    
  • Be aware to use p12 generated for productive environment.

Source Code approach for productive environment

Stop, don't do that! Make use of Docker, Kubernetes, etc.