Skip to content
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
6 changes: 3 additions & 3 deletions java/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ dependencies {
implementation 'com.google.protobuf:protobuf-java-util:3.19.1'
implementation group: 'net.java.dev.jna', name: 'jna', version: '5.8.0'

implementation 'io.grpc:protoc-gen-grpc-java:1.42.1'
implementation 'io.grpc:grpc-netty-shaded:1.42.1'
implementation 'io.grpc:grpc-protobuf:1.42.1'
implementation 'io.grpc:grpc-stub:1.42.1'
implementation 'ky.korins:blake3_3:2.9.0'
implementation 'io.grpc:grpc-stub:1.42.1' // This has to match the version of protoc-gen-grpc-java used in `sdk/devops/generate_proto_files.py`
// https://mvnrepository.com/artifact/io.github.rctcwyvrn/blake3
implementation 'io.github.rctcwyvrn:blake3:1.3'
implementation 'io.leonard:base58:0.0.2'
compileOnly 'org.apache.tomcat:annotations-api:6.0.53' // necessary for Java 9+

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import com.google.protobuf.ByteString;
import com.google.protobuf.InvalidProtocolBufferException;
import com.google.protobuf.Message;
import ky.korins.blake3.Blake3;
import io.github.rctcwyvrn.blake3.Blake3;
import trinsic.okapi.DidException;
import trinsic.okapi.Oberon;
import trinsic.okapi.security.v1.Security;
Expand All @@ -21,7 +21,9 @@ public String GetAuthHeader(Account.AccountProfile accountProfile, Message messa

// compute the hash of the request and return the result
var bytes = message.toByteArray();
var messageHash = Blake3.newHasher().update(bytes).done(64);
var hasher = Blake3.newInstance();
hasher.update(bytes);
var messageHash = hasher.digest(64);

var nonce = CommonOuterClass.Nonce.newBuilder()
.setTimestamp(Instant.now().toEpochMilli())
Expand Down
5 changes: 3 additions & 2 deletions java/src/main/java/trinsic/services/ServiceBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.google.protobuf.InvalidProtocolBufferException;
import com.google.protobuf.Message;
import io.grpc.Channel;
import io.grpc.ManagedChannel;
import io.grpc.Metadata;
import trinsic.TrinsicUtilities;
Expand All @@ -15,7 +16,7 @@ public abstract class ServiceBase {
private Account.AccountProfile profile = null;
private CommonOuterClass.ServerConfig configuration = null;
private ManagedChannel channel = null;
private ISecurityProvider securityProvider = new OberonSecurityProvider();
private final ISecurityProvider securityProvider = new OberonSecurityProvider();

protected ServiceBase(Account.AccountProfile accountProfile, CommonOuterClass.ServerConfig serverConfig) {
this.profile = accountProfile;
Expand Down Expand Up @@ -50,7 +51,7 @@ public CommonOuterClass.ServerConfig getConfiguration() {
return this.configuration;
}

public ManagedChannel getChannel() {
public Channel getChannel() {
return this.channel;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
/**
*/
@javax.annotation.Generated(
value = "by gRPC proto compiler (version 1.41.0)",
value = "by gRPC proto compiler (version 1.42.1)",
comments = "Source: services/account/v1/account.proto")
@io.grpc.stub.annotations.GrpcGenerated
public final class AccountServiceGrpc {

private AccountServiceGrpc() {}

public static final String SERVICE_NAME = "services.account.v1.trinsic.services.AccountService";
public static final String SERVICE_NAME = "services.account.v1.AccountService";

// Static method descriptors that strictly reflect the proto.
private static volatile io.grpc.MethodDescriptor<trinsic.services.account.v1.Account.SignInRequest,
Expand Down Expand Up @@ -499,7 +499,7 @@ public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() {

@java.lang.Override
public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() {
return getFileDescriptor().findServiceByName("trinsic.services.AccountService");
return getFileDescriptor().findServiceByName("AccountService");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/**
*/
@javax.annotation.Generated(
value = "by gRPC proto compiler (version 1.41.0)",
value = "by gRPC proto compiler (version 1.42.1)",
comments = "Source: services/common/v1/common.proto")
@io.grpc.stub.annotations.GrpcGenerated
public final class CommonGrpc {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/**
*/
@javax.annotation.Generated(
value = "by gRPC proto compiler (version 1.41.0)",
value = "by gRPC proto compiler (version 1.42.1)",
comments = "Source: services/provider/v1/provider.proto")
@io.grpc.stub.annotations.GrpcGenerated
public final class ProviderGrpc {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/**
*/
@javax.annotation.Generated(
value = "by gRPC proto compiler (version 1.41.0)",
value = "by gRPC proto compiler (version 1.42.1)",
comments = "Source: services/trust-registry/v1/trust-registry.proto")
@io.grpc.stub.annotations.GrpcGenerated
public final class TrustRegistryGrpc {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
/**
*/
@javax.annotation.Generated(
value = "by gRPC proto compiler (version 1.41.0)",
value = "by gRPC proto compiler (version 1.42.1)",
comments = "Source: services/universal-wallet/v1/universal-wallet.proto")
@io.grpc.stub.annotations.GrpcGenerated
public final class WalletServiceGrpc {

private WalletServiceGrpc() {}

public static final String SERVICE_NAME = "services.universalwallet.v1.trinsic.services.WalletService";
public static final String SERVICE_NAME = "services.universalwallet.v1.WalletService";

// Static method descriptors that strictly reflect the proto.
private static volatile io.grpc.MethodDescriptor<trinsic.services.universalwallet.v1.UniversalWallet.SearchRequest,
Expand Down Expand Up @@ -414,7 +414,7 @@ public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() {

@java.lang.Override
public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() {
return getFileDescriptor().findServiceByName("trinsic.services.WalletService");
return getFileDescriptor().findServiceByName("WalletService");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/**
*/
@javax.annotation.Generated(
value = "by gRPC proto compiler (version 1.41.0)",
value = "by gRPC proto compiler (version 1.42.1)",
comments = "Source: services/verifiable-credentials/templates/v1/templates.proto")
@io.grpc.stub.annotations.GrpcGenerated
public final class CredentialTemplatesGrpc {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/**
*/
@javax.annotation.Generated(
value = "by gRPC proto compiler (version 1.41.0)",
value = "by gRPC proto compiler (version 1.42.1)",
comments = "Source: services/verifiable-credentials/v1/verifiable-credentials.proto")
@io.grpc.stub.annotations.GrpcGenerated
public final class CredentialGrpc {
Expand Down
4 changes: 2 additions & 2 deletions java/src/test/java/TrinsicServicesTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
class TrinsicServicesTest {

@Test
public void testServiceBaseSetProfile() throws InterruptedException {
public void testServiceBaseSetProfile() {
var accountService = new AccountService(null, TrinsicUtilities.getTestServerConfig());

Assertions.assertThrows(IllegalArgumentException.class, () -> accountService.buildMetadata(null));
Expand Down Expand Up @@ -59,6 +59,6 @@ private void createAndShutdownChannel(String myAddress) throws MalformedURLExcep

@Test
public void testTrinsicServiceDemo() throws IOException, DidException {
new VaccineDemo().run();
VaccineDemo.run();
}
}
5 changes: 5 additions & 0 deletions java/src/test/java/VaccineDemo.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public static void main(String[] args) throws IOException, DidException {
public static void run() throws IOException, DidException {
// createService() {
var serverConfig = TrinsicUtilities.getTestServerConfig();
System.out.println("Connecting to:\n" + serverConfig);
var accountService = new AccountService(null, serverConfig);
// }

Expand Down Expand Up @@ -82,6 +83,10 @@ public static void run() throws IOException, DidException {
System.out.println("Verification result: " + isValid);
Assertions.assertTrue(isValid);
// }

accountService.shutdown();
credentialsService.shutdown();
walletService.shutdown();
}

// pathData() {
Expand Down
2 changes: 0 additions & 2 deletions python/trinsic/proto/services/account/v1/__init__.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.