Giter VIP home page Giter VIP logo

Comments (3)

josephschorr avatar josephschorr commented on June 15, 2024

The tests do so in a similar fashion here: https://github.com/authzed/authzed-java/blob/main/src/intTest/java/V1ClientTest.java#L54

What version of the client and of Java are you using?

from authzed-java.

JK-Chung avatar JK-Chung commented on June 15, 2024

Yes, the test code matches up with the README and my understanding of using the stub.

I'm using Java 17 and the 0.3.0 version of the JAR. Is the issue with PermissionsServiceBlockingStub class? On inspection, there is no withCallCredentials() method

    public static final class PermissionsServiceBlockingStub extends AbstractBlockingStub<PermissionsServiceBlockingStub> {
        private PermissionsServiceBlockingStub(Channel channel, CallOptions callOptions) {
            super(channel, callOptions);
        }

        protected PermissionsServiceBlockingStub build(Channel channel, CallOptions callOptions) {
            return new PermissionsServiceBlockingStub(channel, callOptions);
        }

        public Iterator<PermissionService.ReadRelationshipsResponse> readRelationships(PermissionService.ReadRelationshipsRequest request) {
            return ClientCalls.blockingServerStreamingCall(this.getChannel(), PermissionsServiceGrpc.getReadRelationshipsMethod(), this.getCallOptions(), request);
        }

        public PermissionService.WriteRelationshipsResponse writeRelationships(PermissionService.WriteRelationshipsRequest request) {
            return (PermissionService.WriteRelationshipsResponse)ClientCalls.blockingUnaryCall(this.getChannel(), PermissionsServiceGrpc.getWriteRelationshipsMethod(), this.getCallOptions(), request);
        }

        public PermissionService.DeleteRelationshipsResponse deleteRelationships(PermissionService.DeleteRelationshipsRequest request) {
            return (PermissionService.DeleteRelationshipsResponse)ClientCalls.blockingUnaryCall(this.getChannel(), PermissionsServiceGrpc.getDeleteRelationshipsMethod(), this.getCallOptions(), request);
        }

        public PermissionService.CheckPermissionResponse checkPermission(PermissionService.CheckPermissionRequest request) {
            return (PermissionService.CheckPermissionResponse)ClientCalls.blockingUnaryCall(this.getChannel(), PermissionsServiceGrpc.getCheckPermissionMethod(), this.getCallOptions(), request);
        }

        public PermissionService.ExpandPermissionTreeResponse expandPermissionTree(PermissionService.ExpandPermissionTreeRequest request) {
            return (PermissionService.ExpandPermissionTreeResponse)ClientCalls.blockingUnaryCall(this.getChannel(), PermissionsServiceGrpc.getExpandPermissionTreeMethod(), this.getCallOptions(), request);
        }

        public Iterator<PermissionService.LookupResourcesResponse> lookupResources(PermissionService.LookupResourcesRequest request) {
            return ClientCalls.blockingServerStreamingCall(this.getChannel(), PermissionsServiceGrpc.getLookupResourcesMethod(), this.getCallOptions(), request);
        }

        public Iterator<PermissionService.LookupSubjectsResponse> lookupSubjects(PermissionService.LookupSubjectsRequest request) {
            return ClientCalls.blockingServerStreamingCall(this.getChannel(), PermissionsServiceGrpc.getLookupSubjectsMethod(), this.getCallOptions(), request);
        }
    }

from authzed-java.

tafli avatar tafli commented on June 15, 2024

Same problem here.

To be able to use GRPC, additional imports are necessary (taken from GRPC Java example):

implementation "com.authzed.api:authzed:0.4.0"
implementation 'io.grpc:grpc-protobuf:1.54.0'
implementation 'io.grpc:grpc-stub:1.54.0'
compileOnly 'org.apache.tomcat:annotations-api:6.0.53'
runtimeOnly 'io.grpc:grpc-netty-shaded:1.54.0'

Please update this example with a working one. When checking this code out, it does not compile as no Authzed classes are found (V1ClientTest.java). After adding implementation "com.authzed.api:authzed:0.4.0" to the build.gradlefile as dependency, this is fixed too.

from authzed-java.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.