Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/21/21 verifier maven #34

Merged
merged 3 commits into from
Jul 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion extensions/identity-hub-verifier/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,13 @@ dependencies {
testImplementation("${edcGroup}:junit:${edcVersion}")
testImplementation("org.junit.jupiter:junit-jupiter-api:${jupiterVersion}")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:${jupiterVersion}")
}
}

publishing {
publications {
create<MavenPublication>("identity-hub-credentials-verifier") {
artifactId = "identity-hub-credentials-verifier"
from(components["java"])
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@
@Requires({ DidPublicKeyResolver.class })
public class CredentialsVerifierExtension implements ServiceExtension {

@EdcSetting
private static final String HUB_URL_SETTING = "edc.identity.hub.url";

@Inject
private OkHttpClient httpClient;

Expand Down Expand Up @@ -71,11 +68,6 @@ public JwtCredentialsVerifier createJwtVerifier(ServiceExtensionContext context)

@Provider
public CredentialsVerifier createCredentialsVerifier(ServiceExtensionContext context) {
var hubUrl = context.getSetting(HUB_URL_SETTING, null);
if (hubUrl == null) {
throw new EdcException(format("Mandatory setting '(%s)' missing", HUB_URL_SETTING));
}

algattik marked this conversation as resolved.
Show resolved Hide resolved
var client = new IdentityHubClientImpl(httpClient, typeManager.getMapper(), monitor);
var verifiableCredentialsJwtService = new VerifiableCredentialsJwtServiceImpl(typeManager.getMapper());
return new IdentityHubCredentialsVerifier(client, monitor, jwtCredentialsVerifier, verifiableCredentialsJwtService);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ void setUp(EdcExtension extension) {
identityHubClient = new IdentityHubClientImpl(TestUtils.testOkHttpClient(), new ObjectMapper(), new ConsoleMonitor());
publicKeyResolver = mock(DidPublicKeyResolverImpl.class);
extension.registerServiceMock(DidPublicKeyResolver.class, publicKeyResolver);
extension.setConfiguration(Map.of("web.http.port", String.valueOf(PORT), "edc.identity.hub.url", API_URL));
extension.setConfiguration(Map.of("web.http.port", String.valueOf(PORT)));
}

@Test
Expand Down