Skip to content

Commit

Permalink
fix: compile errors
Browse files Browse the repository at this point in the history
  • Loading branch information
paullatzelsperger committed May 26, 2023
1 parent bca6df0 commit 7d663d1
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import org.eclipse.edc.runtime.metamodel.annotation.Inject;
import org.eclipse.edc.spi.system.ServiceExtension;
import org.eclipse.edc.spi.system.ServiceExtensionContext;
import org.eclipse.edc.spi.types.TypeManager;

/**
* Extension for handling parsing and encoding verifiable credential in JWT format.
Expand All @@ -31,13 +32,16 @@ public class JwtCredentialsExtension implements ServiceExtension {
@Inject
private CredentialEnvelopeTransformerRegistry transformerRegistry;

@Inject
private TypeManager typeManager;

@Override
public String name() {
return NAME;
}

@Override
public void initialize(ServiceExtensionContext context) {
transformerRegistry.register(new JwtCredentialEnvelopeTransformer(context.getTypeManager().getMapper()));
transformerRegistry.register(new JwtCredentialEnvelopeTransformer(typeManager.getMapper()));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import org.eclipse.edc.spi.monitor.Monitor;
import org.eclipse.edc.spi.system.ServiceExtension;
import org.eclipse.edc.spi.system.ServiceExtensionContext;
import org.eclipse.edc.spi.types.TypeManager;

import static org.eclipse.edc.identityhub.credentials.jwt.JwtCredentialConstants.DATA_FORMAT;

Expand All @@ -39,6 +40,9 @@ public class JwtCredentialsVerifierExtension implements ServiceExtension {
@Inject
private CredentialEnvelopeVerifierRegistry verifierRegistry;

@Inject
private TypeManager typeManager;

@Override
public String name() {
return "JWT Credentials Verifier";
Expand All @@ -48,6 +52,6 @@ public String name() {
public void initialize(ServiceExtensionContext context) {
var jwtVerifier = new DidJwtCredentialsVerifier(didPublicKeyResolver, monitor);
context.registerService(JwtCredentialsVerifier.class, jwtVerifier);
verifierRegistry.register(DATA_FORMAT, new JwtCredentialEnvelopeVerifier(jwtVerifier, context.getTypeManager().getMapper()));
verifierRegistry.register(DATA_FORMAT, new JwtCredentialEnvelopeVerifier(jwtVerifier, typeManager.getMapper()));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import org.eclipse.edc.spi.system.ServiceExtension;
import org.eclipse.edc.spi.system.ServiceExtensionContext;
import org.eclipse.edc.spi.system.health.HealthCheckService;
import org.eclipse.edc.spi.types.TypeManager;

/**
* Extension that provides a {@link org.eclipse.edc.identityhub.store.spi.IdentityHubStore} with CosmosDB as backend storage
Expand All @@ -42,6 +43,8 @@ public class CosmosIdentityHubStoreExtension implements ServiceExtension {
private Vault vault;
@Inject
private CosmosClientProvider clientProvider;
@Inject
private TypeManager typeManager;

private CosmosDbApi cosmosDbApi;

Expand All @@ -53,7 +56,7 @@ public String name() {
@Override
public void initialize(ServiceExtensionContext context) {
context.getService(HealthCheckService.class).addReadinessProvider(() -> cosmosDbApi.get().forComponent(name()));
context.getTypeManager().registerTypes(IdentityHubRecordDocument.class);
typeManager.registerTypes(IdentityHubRecordDocument.class);
}


Expand All @@ -62,6 +65,6 @@ public IdentityHubStore identityHubStore(ServiceExtensionContext context) {
var configuration = new CosmosIdentityHubStoreConfig(context);
var client = clientProvider.createClient(vault, configuration);
cosmosDbApi = new CosmosDbApiImpl(configuration, client);
return new CosmosIdentityHubStore(cosmosDbApi, configuration.getPartitionKey(), context.getTypeManager().getMapper(), retryPolicy);
return new CosmosIdentityHubStore(cosmosDbApi, configuration.getPartitionKey(), typeManager.getMapper(), retryPolicy);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import org.eclipse.edc.runtime.metamodel.annotation.Setting;
import org.eclipse.edc.spi.system.ServiceExtension;
import org.eclipse.edc.spi.system.ServiceExtensionContext;
import org.eclipse.edc.spi.types.TypeManager;
import org.eclipse.edc.transaction.datasource.spi.DataSourceRegistry;
import org.eclipse.edc.transaction.spi.TransactionContext;

Expand All @@ -46,16 +47,20 @@ public class SqlIdentityHubStoreExtension implements ServiceExtension {
private DataSourceRegistry dataSourceRegistry;
@Inject
private TransactionContext trxContext;
@Inject
private TypeManager typeManager;

@Override
public String name() {
return NAME;
}



@Provider
public IdentityHubStore identityHubStore(ServiceExtensionContext context) {
var s = Objects.requireNonNullElse(statements, new BaseSqlIdentityHubStatements());
var dataSource = context.getSetting(DATASOURCE_NAME_SETTING, DEFAULT_DATASOURCE_NAME);
return new SqlIdentityHubStore(dataSourceRegistry, dataSource, trxContext, s, context.getTypeManager().getMapper());
return new SqlIdentityHubStore(dataSourceRegistry, dataSource, trxContext, s, typeManager.getMapper());
}
}

0 comments on commit 7d663d1

Please sign in to comment.