Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Good for local development? #12

Closed
dgg opened this issue Mar 30, 2024 · 2 comments
Closed

Good for local development? #12

dgg opened this issue Mar 30, 2024 · 2 comments

Comments

@dgg
Copy link

dgg commented Mar 30, 2024

Hi,
My team is currently evaluating SpiceBb as an option for multi-tenant authorization for our new platform.
Some of the projects hosted is such platform will be written in C# and, naturally, we found your library.

We are trying to play around with SpiceDb (figuring out how to model different scenarios, exploring the APIs and such) and we are doing it running the SpiceDb container locally.

I am not very familiar with gRPC either, but it does not seem that I am able to connect to the local instance of SpiceDb (I am able to do so with a container-running zed using the --insecure flag).

This is the exception I am getting:

System.AggregateException: One or more errors occurred. (No address resolver configured for the scheme 'localhost'.)
 ---> System.InvalidOperationException: No address resolver configured for the scheme 'localhost'.
   at Grpc.Net.Client.GrpcChannel.GetResolverFactory(GrpcChannelOptions options)
   at Grpc.Net.Client.GrpcChannel..ctor(Uri address, GrpcChannelOptions channelOptions)
   at Grpc.Net.Client.GrpcChannel.ForAddress(Uri address, GrpcChannelOptions channelOptions)
   at Grpc.Net.Client.GrpcChannel.ForAddress(String address, GrpcChannelOptions channelOptions)
   at SpiceDb.Api.Core.CreateAuthenticatedChannelAsync(String address)

This is what I am using to connect to the local server (I am using a mapped 50052 port as I have something else in my computer running in 50051):

    var client = new SpiceDbClient("localhost:50052", "somerandomkeyhere", "prefix");

And this is the docker-compose section:

services:
  spicedb:
    image: authzed/spicedb:v1.30.0
    command: serve --grpc-preshared-key "somerandomkeyhere"
    ports:
      - 50052:50051
  spicecli:
    image: authzed/zed:v0.17.1

Can you verify that I should be able to execute your library against this local environment?

Thanks in advance

@tanczosm
Copy link
Contributor

tanczosm commented Mar 30, 2024 via email

@dgg
Copy link
Author

dgg commented Mar 30, 2024

That was a great pointer!

I was able to make it work using http://0.0.0.0:50052 (http is also important).

Thanks for your help

@dgg dgg closed this as completed Mar 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants