This repository has been archived by the owner on Mar 31, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: configure connector on start-up
* feat: added deserialization of catalogs to DeserializationService * fix: getAllCatalogsWithOfferedResources uses the connector's uri from config.json now Required for updating the configuration model during startup (bootstrapping) * feat: TemplateBuilder can build catalogs now * feat: MappingUtils can now map catalogs and offered resources * chore: refactored MappingUtils * feat: TemplateUtils can now be used for contract templates and offered resource templates * feat: added a bootstrapping base path to application.properties * feat: added missing CatalogTemplate * feat: added bootstrap configuration performs registration of ids catalogs (and included elements) during startup and optional registration at broker(s) * test: added test data for bootstrapping * fix: added bootstrapConfiguration mockBean to some tests to deactivate bootstrapping * docs: replaced ampersand in javadoc * docs: added license headers * fix: changes based on spotbug report * fix: changes for checkstyle * docs: added documentation for bootstrapping * chore: checkstyle fix * fix: performing changes requested by review * fix: performing changes requested by review * docs: fix subpage order * docs: update CHANGELOG.md * feat: add username/password/accessUrl/value for artifacts to bootstrapping * chore: update debug message * chore: add valid contract rule to bootstrap file * feat: changed idsId to bootstrapId and removed it from additional map * chore: remove invalid attributes from bootrapping files * fix: catch exception for empty contract dates * chore: change test bootstrap.properties * fix: fix bugs regarding ids:target in bootstrapped contract offers, empty bootstrapId, and resourceEndpoints in resources created by MappingUtils * fix: change tests to match changed code * docs: added missing @throw entries to javadoc * fix: incorporate changes required by review * fix: additional change for changes required by review * chore: checkstyle fix * chore: fix NPE when contract start or end not set * style: fix typo * chore: remove unchecked warning on BootstrapConfig * chore: remove unused import * chore: make local vars final in BootstrapConfig * chore: remove unused code in BootstrapConfig * docs: update bootstrapping.md * refactor: start with code cleanup of BootstrapConfig * chore: code clean up * chore: move methods to BootstrapUtils * refactor: move bootstrap into own package * style: fix checkstyle * refactor: simplify flow of BootstrapConfig::bootstrap * refactor: move BootstrapUtils into own package * docs: update bootstrapping.md * docs: remove empty values and add context to contracts * chore: add context to bootstrap data * chore: keep db open when bootstrapping * chore: dont close db when app terminates * style: remove unused code * docs: add package-info * chore: close http connections * chore: move broker operations into own class * chore: simplify broker messaging * chore: remove unnessarry warnings * chore: update changelog * chore: add license header * test: add broker test * chore: remove generic function parameter * docs: add lines for broker registration * fix: inverted check of optional * chore: add data for broker registration to bootstrapping data * fix: bootstrapping no longer exits application when broker registration fails Add BootstrapConfiguration as MockBean to various tests to save some time during tests Fix BrokerServiceTest * docs: add missing @context element to bootstrapping example * refactor: clean up exception handling and remove BrokerService::getMultipartPart * chore: change log level for failed registration * docs: update CHANGELOG.md * release: increase version to 5.2.0 * chore: update Chart.yaml * chore: update swagger ui properties * chore: add pretty print to swagger properties * test: fix BrokerServiceTest * refactor: remove unused imports Co-authored-by: Pampus, Julia <[email protected]> Co-authored-by: Brian-Frederik Jahnke <[email protected]> Co-authored-by: Brian-Frederik Jahnke <[email protected]> Co-authored-by: Julia Pampus <[email protected]>
- Loading branch information
1 parent
e360035
commit a55dc02
Showing
62 changed files
with
2,645 additions
and
244 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,178 @@ | ||
--- | ||
layout: default | ||
title: Bootstrapping | ||
nav_order: 3 | ||
description: "" | ||
permalink: /Deployment/Bootstrapping | ||
parent: Deployment | ||
--- | ||
|
||
# Bootstrapping | ||
{: .fs-9 } | ||
|
||
Load resources during startup and register them at an IDS Broker. | ||
{: .fs-6 .fw-300 } | ||
|
||
--- | ||
|
||
In this section, the registration of resources during the startup is described. | ||
|
||
### Registering Elements at the Connector | ||
|
||
During the startup of the Dataspace Connector, the bootstrapping path that is specified in | ||
`application.properties` will be scanned for `*.jsonld` and `bootstrap.properties` files. The search | ||
includes all subdirectories found in the base path. | ||
|
||
Each `jsonld`-file contains the JSON-LD representation of an IDS catalog. These representations will | ||
be loaded and registered at the connector. This includes all elements that are part of the catalog, | ||
except requested resources. The IDs used for the IDS catalog are used to prevent duplicates among | ||
multiple startups. | ||
|
||
The `bootstrap.properties` files contain additional data that is not present in the IDS Information | ||
Model representations. This includes credentials, URLs, and values for artifacts as well as | ||
information on which resources should be registered at IDS Brokers. If multiple | ||
`bootstrap.properties` files are found, all of them will be loaded and merged. If there are | ||
collisions, these will be logged and the first found value will be kept. | ||
|
||
An example for a valid catalog that can be used for bootstrapping is shown below. Corresponding | ||
sample files are provided at `test/resources/bootstrap`. | ||
|
||
```json | ||
{ | ||
"@context" : { | ||
"ids" : "https://w3id.org/idsa/core/", | ||
"idsc" : "https://w3id.org/idsa/code/" | ||
}, | ||
"@type": "ids:ResourceCatalog", | ||
"@id": "https://w3id.org/idsa/autogen/resourceCatalog/4a1fbd8c-8f23-4cc0-871d-9d26596b00c9", | ||
"ids:offeredResource": [ | ||
{ | ||
"@type": "ids:Resource", | ||
"@id": "https://w3id.org/idsa/autogen/resource/e32c5397-f71c-47b5-a384-c9c4cf568117", | ||
"ids:language": [ | ||
{ | ||
"@id": "idsc:EN" | ||
} | ||
], | ||
"ids:description": [ | ||
{ | ||
"@value": "This is an example resource", | ||
"@language": "EN" | ||
} | ||
], | ||
"ids:version": "3", | ||
"ids:title": [ | ||
{ | ||
"@value": "Example Another Resource", | ||
"@language": "EN" | ||
} | ||
], | ||
"ids:publisher": "https://example.com", | ||
"ids:sovereign": "https://example.com", | ||
"ids:representation": [ | ||
{ | ||
"@type": "ids:Representation", | ||
"@id": "https://w3id.org/idsa/autogen/representation/f74ab1ad-3a1b-4508-aada-4859dcfa7349", | ||
"ids:instance": [ | ||
{ | ||
"@type": "ids:Artifact", | ||
"@id": "https://w3id.org/idsa/autogen/artifact/d5b1cd4e-2a5a-47c2-86c5-003c6a11ce69", | ||
"ids:fileName": "exampleFile.xml", | ||
"ids:duration": 12512351, | ||
"ids:creationDate": "2016-10-03T15:10:40.000Z", | ||
"ids:byteSize": 425314, | ||
"ids:checkSum": "120ECEF25E5D487BF68B5F709644D219" | ||
} | ||
], | ||
"ids:language": { | ||
"properties": null, | ||
"@id": "idsc:EN" | ||
}, | ||
"ids:created": "2016-10-03T15:10:40.000Z", | ||
"ids:mediaType": { | ||
"@type": "ids:IANAMediaType", | ||
"@id": "https://w3id.org/idsa/autogen/iANAMediaType/07e5f54e-4e85-4df7-94d3-a7e8b225f1cb", | ||
"ids:filenameExtension": "xml" | ||
}, | ||
"ids:representationStandard": "https://example.com", | ||
"ids:shapesGraph": "https://example.com", | ||
"ids:modified": "2016-10-03T15:10:40.000Z" | ||
} | ||
], | ||
"ids:resourceEndpoint": [ | ||
{ | ||
"@type": "ids:ConnectorEndpoint", | ||
"@id": "https://w3id.org/idsa/autogen/connectorEndpoint/4458078e-c2f2-4d9f-afbe-54e9daa4c1b8", | ||
"ids:accessURL": "https://example.com" | ||
} | ||
], | ||
"ids:standardLicense": "https://example.com", | ||
"ids:contractOffer": [ | ||
{ | ||
"@type": "ids:ContractOffer", | ||
"@id": "https://w3id.org/idsa/autogen/contractOffer/1d982c8a-c5ae-4c19-9a26-6815e9540fc8", | ||
"ids:permission": [ | ||
{ | ||
"@type": "ids:Permission", | ||
"@id": "https://w3id.org/idsa/autogen/permission/a3c12cd0-5022-484d-8fb0-0676351de2da", | ||
"ids:description": [ | ||
{ | ||
"@value": "provide-access", | ||
"@type": "http://www.w3.org/2001/XMLSchema#string" | ||
} | ||
], | ||
"ids:title": [ | ||
{ | ||
"@value": "Allow Data Usage", | ||
"@type": "http://www.w3.org/2001/XMLSchema#string" | ||
} | ||
], | ||
"ids:action": [ | ||
{ | ||
"@id": "idsc:USE" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
], | ||
"ids:keyword": [ | ||
{ | ||
"@value": "EXAMPLE", | ||
"@language": "EN" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
|
||
``` | ||
|
||
An example for a valid `bootstrap.properties` file can be found below. | ||
|
||
```properties | ||
#artifact.accessUrl.https\://w3id.org/idsa/autogen/artifact/d5b1cd4e-2a5a-47c2-86c5-003c6a11ce69= | ||
#artifact.username.https\://w3id.org/idsa/autogen/artifact/d5b1cd4e-2a5a-47c2-86c5-003c6a11ce69= | ||
#artifact.password.https\://w3id.org/idsa/autogen/artifact/d5b1cd4e-2a5a-47c2-86c5-003c6a11ce69= | ||
artifact.value.https\://w3id.org/idsa/autogen/artifact/d5b1cd4e-2a5a-47c2-86c5-003c6a11ce69=Example Value | ||
broker.register.https\://w3id.org/idsa/autogen/resource/d5b1cd4e-2a5a-47c2-86c5-003c6a11ce69=https://broker.ids.isst.fraunhofer.de/infrastructure | ||
``` | ||
|
||
### Registering Elements at the IDS Broker | ||
Each resource that has been registered during the bootstrapping process can be registered at an | ||
IDS Broker. It is possible to register different resources at different brokers, but each resource | ||
can only be registered at one broker once. The registration of a resource at a broker implicitly | ||
registers the connector itself at the broker. | ||
|
||
In order to register a resource at the broker, an entry with the following structure must be placed | ||
in a `bootstrap.properties` file: | ||
|
||
```properties | ||
broker.register.<RESOURCE_ID>=<BROKER_ENDPOINT> | ||
``` | ||
|
||
An example for the first resource of the example IDS catalog can be found below. | ||
|
||
```properties | ||
broker.register.https\://w3id.org/idsa/autogen/resource/e32c5397-f71c-47b5-a384-c9c4cf568117=https://broker.ids.isst.fraunhofer.de/infrastructure | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -85,7 +85,7 @@ | |
|
||
<properties> | ||
<!-- General --> | ||
<revision>5.1.2</revision> | ||
<revision>5.2.0</revision> | ||
<email>[email protected]</email> | ||
|
||
<!-- Build info --> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.