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

[Feature]Add svrType related fields in proto to protoc-gen-go-http and http transport #3301

Closed
MichealJl opened this issue Apr 23, 2024 · 3 comments
Labels

Comments

@MichealJl
Copy link

Please see the FAQ in our main README.md before submitting your issue.

What problem is the feature used to solve?

有些场景(如需要根据每个svr名称做不同模块的权限管理)中需要获取proto中的svr名称
如果是自己定义常量与transport中operation提取出来的srv名称对比,那么proto的srv名称发生变化时可能导致判断错误

我们是否能支持这个功能

Requirements description of the feature

在 Transport中添加svrType设置和获取的相关方法

image
image
image

References

@kratos-ci-bot kratos-ci-bot changed the title [Feature]protoc-gen-go-http和http transport中添加 proto中的svrType相关字段 [Feature]Add svrType related fields in proto to protoc-gen-go-http and http transport Apr 23, 2024
@shenqidebaozi
Copy link
Sponsor Member

This is not a good design. According to the philosophy of GRPC, idl ensures that client and server calls are correct. You should not directly modify the method name, as it will cause code incompatibility. The client and server cannot call properly.

@MichealJl
Copy link
Author

@shenqidebaozi

那抛开 方法被修改的场景不谈,就是单纯的想获取Svr名称可行么,目前是根据当前transport中的operation分割两次获取的

@kratos-ci-bot
Copy link
Collaborator

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


@shenqidebaozi

Putting aside the scenario where the method is modified, is it feasible to simply obtain the Svr name? Currently, it is obtained twice based on the operation in the current transport.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants