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

Upgrade to tonic 0.5 #21

Merged
merged 4 commits into from
Jul 11, 2021
Merged

Upgrade to tonic 0.5 #21

merged 4 commits into from
Jul 11, 2021

Conversation

yotamofek
Copy link
Contributor

No description provided.

Copy link
Contributor

@davidli2010 davidli2010 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your great job!

I think AuthLayer is not necessary. We can simply create AuthService through a constructor AuthService::new(channel: Channel, token: Option<Arc<HeaderValue>>). And then we can only depend on tower_service.

So we can just change the XxxClient::new(channel: Channel, interceptor: Option<Interceptor>) to XxxClient::new(channel: Channel, token: Option<Arc<HeaderValue>>), and create AuthService inside.

There is a simple principle that client mod can invoke rpc mod, but rpc mod can not invoke client mod. So I suggest do not define AuthService inside client, you can define it in a auth mod parallel with client.

@davidli2010 davidli2010 changed the title Update to tonic 0.5 Upgrade to tonic 0.5 Jul 11, 2021
@davidli2010 davidli2010 merged commit 029d6eb into etcdv3:master Jul 11, 2021
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

Successfully merging this pull request may close these issues.

2 participants