authzed/authzed-node

Cant get grpc client to connect

Closed this issue · 1 comments

For whatever reason, no matter what i try, i keep getting No connection established errors from the grpc client. Connecting with the cli and the same exact config works. I assume this is more of an issue with grpc-js than you guys but wondering if anyone had any wisdom. I may just use the spicedb protobufs to generate a new sdk with https://github.com/connectrpc/connect-es if this keeps causing trouble.

heres my code to make the client and connect

  const client = v1.NewClient('foobar', 'localhost:50052');
  await client.promises.readRelationships({
    optionalLimit: 0,
    relationshipFilter: {
      resourceType: 'user',
      optionalRelation: '',
      optionalResourceId: '',
    },
  });

and heres the context of the zed cli im using to successfully connect to a local spice db instance

CURRENT	NAME	ENDPOINT                                                          	TOKEN           	TLS CERT
   ✓   	dev 	localhost:50052                                                   	<redacted>      	insecure

forgot to explicitly specify no credentials!
const client = v1.NewClient('foobar', 'localhost:50052', ClientSecurity.INSECURE_LOCALHOST_ALLOWED);