Skip to content

Commit

Permalink
feat: More work on DID Traits support.
Browse files Browse the repository at this point in the history
  • Loading branch information
peacekeeper committed Nov 24, 2024
1 parent f99772a commit 190e578
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,13 @@ public void configureLocalUniRegistrar(DriverConfigs driverConfigs, LocalUniRegi

Map<String, Driver> drivers = new LinkedHashMap<>();

for (DriverConfigs.DriverConfig dc : driverConfigs.getDrivers()) {
for (DriverConfigs.DriverConfig driverConfig : driverConfigs.getDrivers()) {

String method = dc.getMethod();
String url = dc.getUrl();
String propertiesEndpoint = dc.getPropertiesEndpoint();
String includeMethodParameter = dc.getIncludeMethodParameter();
String method = driverConfig.getMethod();
String url = driverConfig.getUrl();
String propertiesEndpoint = driverConfig.getPropertiesEndpoint();
String includeMethodParameter = driverConfig.getIncludeMethodParameter();
Map<String, Object> traits = driverConfig.getTraits();

if (method == null) throw new IllegalArgumentException("Missing 'method' entry in driver configuration.");
if (url == null) throw new IllegalArgumentException("Missing 'url' entry in driver configuration.");
Expand All @@ -146,6 +147,7 @@ public void configureLocalUniRegistrar(DriverConfigs driverConfigs, LocalUniRegi
driver.setDeactivateResourceUri(normalizeUri((url + servletMappings.getDeactivateResource()), false));
if ("true".equals(propertiesEndpoint)) driver.setPropertiesUri(normalizeUri((url + servletMappings.getProperties()), false));
if ("true".equals(includeMethodParameter)) driver.setIncludeMethodParameter(Boolean.valueOf(includeMethodParameter));
if (traits != null) driver.setTraits(traits);

// done

Expand Down
15 changes: 15 additions & 0 deletions uni-registrar-web/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,32 @@ uniregistrar:
- method: sov
url: http://driver-did-sov:9080/
propertiesEndpoint: 'true'
traits:
deactivatable: true
enumerable: true
historyAvailable: true
humanReadbale: false
- method: v1
url: http://driver-did-v1:9080/
propertiesEndpoint: 'true'
- method: key
url: http://driver-did-key:9080/
traits:
deactivatable: false
enumerable: false
historyAvailable: false
humanReadbale: false
- method: ion
url: http://driver-did-ion:9080/
propertiesEndpoint: 'true'
- method: web
url: http://driver-did-web:9080/
propertiesEndpoint: 'true'
traits:
deactivatable: true
enumerable: false
historyAvailable: false
humanReadbale: true
- method: ebsi
url: http://driver-did-ebsi:9080/
propertiesEndpoint: 'false'
Expand Down

0 comments on commit 190e578

Please sign in to comment.