diff --git a/sdk/src/main/java/io/opentdf/platform/sdk/SDK.java b/sdk/src/main/java/io/opentdf/platform/sdk/SDK.java index d1c91fcc..ba1c8082 100644 --- a/sdk/src/main/java/io/opentdf/platform/sdk/SDK.java +++ b/sdk/src/main/java/io/opentdf/platform/sdk/SDK.java @@ -74,6 +74,8 @@ public interface Services extends AutoCloseable { AuthorizationServiceClientInterface authorization(); + io.opentdf.platform.authorization.v2.AuthorizationServiceClientInterface authorizationV2(); + KeyAccessServerRegistryServiceClientInterface kasRegistry(); WellKnownServiceClientInterface wellknown(); diff --git a/sdk/src/main/java/io/opentdf/platform/sdk/SDKBuilder.java b/sdk/src/main/java/io/opentdf/platform/sdk/SDKBuilder.java index c88b3875..698953f0 100644 --- a/sdk/src/main/java/io/opentdf/platform/sdk/SDKBuilder.java +++ b/sdk/src/main/java/io/opentdf/platform/sdk/SDKBuilder.java @@ -275,6 +275,7 @@ ServicesAndInternals buildServices() { var subjectMappingService = new SubjectMappingServiceClient(client); var resourceMappingService = new ResourceMappingServiceClient(client); var authorizationService = new AuthorizationServiceClient(client); + var authorizationServiceV2 = new io.opentdf.platform.authorization.v2.AuthorizationServiceClient(client); var kasRegistryService = new KeyAccessServerRegistryServiceClient(client); var wellKnownService = new WellKnownServiceClient(client); @@ -311,6 +312,11 @@ public AuthorizationServiceClient authorization() { return authorizationService; } + @Override + public io.opentdf.platform.authorization.v2.AuthorizationServiceClient authorizationV2() { + return authorizationServiceV2; + } + @Override public KeyAccessServerRegistryServiceClient kasRegistry() { return kasRegistryService; diff --git a/sdk/src/test/java/io/opentdf/platform/sdk/FakeServices.java b/sdk/src/test/java/io/opentdf/platform/sdk/FakeServices.java index 2851b22b..019d8d16 100644 --- a/sdk/src/test/java/io/opentdf/platform/sdk/FakeServices.java +++ b/sdk/src/test/java/io/opentdf/platform/sdk/FakeServices.java @@ -13,6 +13,7 @@ public class FakeServices implements SDK.Services { private final AuthorizationServiceClientInterface authorizationService; + private final io.opentdf.platform.authorization.v2.AuthorizationServiceClientInterface authorizationServiceV2; private final AttributesServiceClientInterface attributesService; private final NamespaceServiceClientInterface namespaceService; private final SubjectMappingServiceClientInterface subjectMappingService; @@ -23,6 +24,7 @@ public class FakeServices implements SDK.Services { public FakeServices( AuthorizationServiceClientInterface authorizationService, + io.opentdf.platform.authorization.v2.AuthorizationServiceClientInterface authorizationServiceV2, AttributesServiceClientInterface attributesService, NamespaceServiceClientInterface namespaceService, SubjectMappingServiceClientInterface subjectMappingService, @@ -31,6 +33,7 @@ public FakeServices( WellKnownServiceClientInterface wellKnownServiceClient, SDK.KAS kas) { this.authorizationService = authorizationService; + this.authorizationServiceV2 = authorizationServiceV2; this.attributesService = attributesService; this.namespaceService = namespaceService; this.subjectMappingService = subjectMappingService; @@ -40,6 +43,11 @@ public FakeServices( this.kas = kas; } + @Override + public io.opentdf.platform.authorization.v2.AuthorizationServiceClientInterface authorizationV2() { + return Objects.requireNonNull(authorizationServiceV2); + } + @Override public AuthorizationServiceClientInterface authorization() { return Objects.requireNonNull(authorizationService); diff --git a/sdk/src/test/java/io/opentdf/platform/sdk/FakeServicesBuilder.java b/sdk/src/test/java/io/opentdf/platform/sdk/FakeServicesBuilder.java index 558aee3b..51f389f1 100644 --- a/sdk/src/test/java/io/opentdf/platform/sdk/FakeServicesBuilder.java +++ b/sdk/src/test/java/io/opentdf/platform/sdk/FakeServicesBuilder.java @@ -10,6 +10,7 @@ public class FakeServicesBuilder { private AuthorizationServiceClientInterface authorizationService; + private io.opentdf.platform.authorization.v2.AuthorizationServiceClientInterface authorizationServiceV2; private AttributesServiceClientInterface attributesService; private NamespaceServiceClientInterface namespaceService; private SubjectMappingServiceClientInterface subjectMappingService; @@ -23,6 +24,11 @@ public FakeServicesBuilder setAuthorizationService(AuthorizationServiceClientInt return this; } + public FakeServicesBuilder setAuthorizationServiceV2(io.opentdf.platform.authorization.v2.AuthorizationServiceClientInterface authorizationServiceV2) { + this.authorizationServiceV2 = authorizationServiceV2; + return this; + } + public FakeServicesBuilder setAttributesService(AttributesServiceClientInterface attributesService) { this.attributesService = attributesService; return this; @@ -59,7 +65,7 @@ public FakeServicesBuilder setKas(SDK.KAS kas) { } public FakeServices build() { - return new FakeServices(authorizationService, attributesService, namespaceService, subjectMappingService, + return new FakeServices(authorizationService, authorizationServiceV2, attributesService, namespaceService, subjectMappingService, resourceMappingService, keyAccessServerRegistryServiceFutureStub, wellKnownServiceClient, kas); } } \ No newline at end of file diff --git a/sdk/src/test/java/io/opentdf/platform/sdk/SDKBuilderTest.java b/sdk/src/test/java/io/opentdf/platform/sdk/SDKBuilderTest.java index a0a3c01a..3a07c17b 100644 --- a/sdk/src/test/java/io/opentdf/platform/sdk/SDKBuilderTest.java +++ b/sdk/src/test/java/io/opentdf/platform/sdk/SDKBuilderTest.java @@ -268,6 +268,9 @@ public ServerCall.Listener interceptCall(ServerCall