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

Add client example #20

Closed
Jonathan-Landeed opened this issue Sep 5, 2024 · 1 comment
Closed

Add client example #20

Jonathan-Landeed opened this issue Sep 5, 2024 · 1 comment

Comments

@Jonathan-Landeed
Copy link

A client example of best practices would be good. I assume we're supposed to use an interceptor to add auth headers, but right now the only interceptor example in the connectrpc docs is using req.Spec().IsClient magic. This project just moves the server-side portion of the interceptor to middleware to avoid unauthenticated resource usage, correct?

@emcfarlane
Copy link
Collaborator

Hi @Jonathan-Landeed, yes thats correct. To avoid unmarshalling messages and any extra work the authnetication is done above the connectrpc handler layer. There are some API changes being worked on (see #9) but will update the examples when these land. The best place to see usage is in the godocs https://pkg.go.dev/connectrpc.com/authn#example-package-BasicAuth

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