Skip to content

Commit

Permalink
Merge pull request decentralized-identity#304 from decentralized-iden…
Browse files Browse the repository at this point in the history
…tity/change-configurations-to-yml

Use yaml and annotation based configurations
  • Loading branch information
cihanss authored Jun 28, 2022
2 parents 2adfe5a + ae1ae8f commit 3be0385
Show file tree
Hide file tree
Showing 18 changed files with 464 additions and 505 deletions.
244 changes: 0 additions & 244 deletions config.json

This file was deleted.

2 changes: 0 additions & 2 deletions uni-resolver-web/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ MAINTAINER Markus Sabadello <[email protected]>
# build uni-resolver-web

ADD . /opt/universal-resolver
ADD config.json /opt/universal-resolver/uni-resolver-web/
RUN cd /opt/universal-resolver && mvn clean install -N
RUN cd /opt/universal-resolver/uni-resolver-core && mvn clean install -N
RUN cd /opt/universal-resolver/driver && mvn clean install -N
Expand All @@ -22,7 +21,6 @@ MAINTAINER Markus Sabadello <[email protected]>
WORKDIR /opt/universal-resolver/uni-resolver-web/

COPY --from=build /opt/universal-resolver/uni-resolver-web/target/*-exec.jar ./
COPY --from=build /opt/universal-resolver/uni-resolver-web/config.json ./

ENV uniresolver_web_spring_profiles_active=default

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.context.annotation.Bean;
import uniresolver.local.LocalUniResolver;

@SpringBootApplication
public class WebUniResolverApplication extends SpringBootServletInitializer {
Expand All @@ -16,4 +18,9 @@ public static void main(String[] args) {
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
return application.sources(WebUniResolverApplication.class);
}

@Bean(name = "UniResolver")
public LocalUniResolver localUniResolver() {
return new LocalUniResolver();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
package uniresolver.web.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

import java.util.List;
import java.util.StringJoiner;

@Configuration
@ConfigurationProperties("uniresolver")
public class DriverConfigs {

private List<DriverConfig> drivers;

public List<DriverConfig> getDrivers() {
return drivers;
}

public void setDrivers(List<DriverConfig> drivers) {
this.drivers = drivers;
}

public static class DriverConfig {

private String pattern;
private String url;
private String propertiesEndpoint;
private List<String> testIdentifiers;

public String getPattern() {
return pattern;
}

public void setPattern(String value) {
this.pattern = value;
}

public String getURL() {
return url;
}

public void setURL(String value) {
this.url = value;
}

public String getPropertiesEndpoint() {
return propertiesEndpoint;
}

public void setPropertiesEndpoint(String value) {
this.propertiesEndpoint = value;
}

public List<String> getTestIdentifiers() {
return testIdentifiers;
}

public void setTestIdentifiers(List<String> value) {
this.testIdentifiers = value;
}

@Override
public String toString() {
return new StringJoiner(", ", DriverConfig.class.getSimpleName() + "[", "]").add(
"pattern='" + pattern + "'")
.add("url='" + url + "'")
.add("propertiesEndpoint='" + propertiesEndpoint + "'")
.add("testIdentifiers=" + testIdentifiers)
.toString();
}
}
}
Loading

0 comments on commit 3be0385

Please sign in to comment.