xborder commented on PR #2651: URL: https://github.com/apache/arrow-adbc/pull/2651#issuecomment-2783914235
> maybe we can use https://pkg.go.dev/golang.org/x/oauth2@v0.28.0/clientcredentials#Config instead and just call https://pkg.go.dev/golang.org/x/oauth2@v0.28.0/clientcredentials#Config.TokenSource > > If we do that, then most of this code can be entirely removed in favor of just using https://pkg.go.dev/google.golang.org/grpc/credentials/oauth#TokenSource and https://pkg.go.dev/google.golang.org/grpc#WithPerRPCCredentials which would manage the oauth flow for us entirely as long as we can construct the token source which performs refreshes as necessary (as per the clientcredentials config above) > > Essentially, SetOptions can create the TokenSource and then `getFlightClient` just adds the token source as a dialoption via `WithPerRPCCredentials`. That would be much more convenient and less work/code for us to maintain @zeroshade I was not aware of that, thank you for bringing this up. While I was testing this proposal I realized that [TokenSource](https://pkg.go.dev/google.golang.org/grpc/credentials/oauth#TokenSource) requires [transport security](https://github.com/grpc/grpc-go/blob/cdbdb759dd67c89544f9081f854c284493b5461c/credentials/oauth/oauth.go#L55). I think this conflicts with development and how to run tests making it mandatory to use tls. What alternatives do I have here? The options I see: * [grpc-go](https://github.com/grpc/grpc-go/tree/master/examples/features/encryption) seems to have some test certs for its examples. Would it make sense to have this for these tests? * Implement the [PerRPCCredentials](https://pkg.go.dev/google.golang.org/grpc@v1.71.1/credentials#PerRPCCredentials). I think the implementation would not be that much different. Just more aligned with DialOption. Any suggestion? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org