use of org.eclipse.dataspaceconnector.spi.system.ServiceExtension in project edc-showcase by microsoft.
the class TestExtensions method identityServiceExtension.
public static ServiceExtension identityServiceExtension() {
return new ServiceExtension() {
@Override
public Set<String> provides() {
return Set.of(IdentityService.FEATURE);
}
@Override
public Set<String> requires() {
return Set.of(VerifiableCredentialProvider.FEATURE, IonClient.FEATURE, IdentityHubClient.FEATURE, DidPublicKeyResolver.FEATURE);
}
@Override
public void initialize(ServiceExtensionContext context) {
var verifiableCredentialProvider = context.getService(VerifiableCredentialProvider.class);
var ionClient = context.getService(IonClient.class);
var idHubclient = context.getService(IdentityHubClient.class);
DidPublicKeyResolver publicKeyResolver = context.getService(DidPublicKeyResolver.class);
var resolverRegistry = new DidResolverRegistryImpl();
var identityService = new DistributedIdentityService(verifiableCredentialProvider, ionClient, new IdentityHubCredentialsVerifier(idHubclient, MONITOR, "did:ion:test"), MONITOR);
context.registerService(IdentityService.class, identityService);
}
};
}
use of org.eclipse.dataspaceconnector.spi.system.ServiceExtension in project edc-showcase by microsoft.
the class TestExtensions method keyResolvers.
public static ServiceExtension keyResolvers(PrivateKeyResolver privateKeyResolver) {
return new ServiceExtension() {
@Override
public Set<String> provides() {
return Set.of(DidPublicKeyResolver.FEATURE);
}
@Override
public Set<String> requires() {
return Set.of(IonClient.FEATURE);
}
@Override
public void initialize(ServiceExtensionContext context) {
var ionClient = context.getService(IonClient.class);
context.registerService(PrivateKeyResolver.class, privateKeyResolver);
context.registerService(DidPublicKeyResolver.class, new DefaultDidPublicKeyResolver(ionClient));
}
};
}
use of org.eclipse.dataspaceconnector.spi.system.ServiceExtension in project DataSpaceConnector by eclipse-dataspaceconnector.
the class StartPhaseTest method start.
@Test
void start() {
ServiceExtension extension = mock(ServiceExtension.class);
var rp = new StartPhase(new Phase(injector, container, context, monitor) {
});
when(container.getInjectionTarget()).thenReturn(extension);
rp.start();
verify(extension).start();
verify(extension).name();
verifyNoMoreInteractions(extension);
}
use of org.eclipse.dataspaceconnector.spi.system.ServiceExtension in project DataSpaceConnector by eclipse-dataspaceconnector.
the class HttpProvisionerExtensionEndToEndTest method setup.
@BeforeEach
void setup(EdcExtension extension) {
extension.setConfiguration(Map.of("web.http.data.port", String.valueOf(dataPort), "web.http.data.path", "/api/v1/data"));
delegate = mock(Interceptor.class);
var httpClient = testOkHttpClient().newBuilder().addInterceptor(delegate).build();
extension.registerServiceMock(TransferWaitStrategy.class, () -> 1);
extension.registerSystemExtension(ServiceExtension.class, new HttpProvisionerExtension(httpClient));
extension.registerSystemExtension(ServiceExtension.class, new DummyCallbackUrlExtension());
extension.setConfiguration(PROVISIONER_CONFIG);
extension.registerSystemExtension(ServiceExtension.class, new ServiceExtension() {
@Inject
private AssetLoader // needed for on-demand dependency resolution
loader;
});
}
use of org.eclipse.dataspaceconnector.spi.system.ServiceExtension in project edc-showcase by microsoft.
the class TestExtensions method identityHubClientExtension.
public static ServiceExtension identityHubClientExtension(IdentityHubClient hubclient) {
return new ServiceExtension() {
@Override
public Set<String> provides() {
return Set.of(CredentialsVerifier.FEATURE, IdentityHubClient.FEATURE);
}
@Override
public void initialize(ServiceExtensionContext context) {
context.registerService(CredentialsVerifier.class, new IdentityHubCredentialsVerifier(hubclient, MONITOR, "did:ion:test"));
context.registerService(IdentityHubClient.class, hubclient);
}
};
}
Aggregations