You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2022/11/26 07:43:30 UTC

[GitHub] [dubbo] zhouyu00 opened a new issue, #11033: dubbo token 消费者无法获取并传递到服务提供者,其他主动添加的隐式参数也无法传递到服务提供者

zhouyu00 opened a new issue, #11033:
URL: https://github.com/apache/dubbo/issues/11033

   <!-- If you need to report a security issue please visit https://github.com/apache/dubbo/security/policy -->
   
   - [ ] I have searched the [issues](https://github.com/apache/dubbo/issues) of this repository and believe that this is not a duplicate.
   
   ### Environment
   
   * Dubbo version: 3.1.0
   * Operating System version: windows10
   * Java version: 11
   
   ### Steps to reproduce this issue
   希望使用dubbo token 来鉴权
   1. 在服务提供者的实现注解上开启token
   ```
   @DubboService(protocol = "rest", validation = "true", token = "true")
   public class AdMaterialController implements AdMaterialControllerI_Test {
       @Autowired
       private AdMaterialQueryService adMaterialQueryService;
       @Override
       public AdResponse edit(AdMaterialEdit req) {
           AdResponse<AdMaterialDto> resp = adMaterialQueryService.edit(req);
           return resp;
       }
   
   }
   ```
   2.查看nacos,元数据中有token
   
   ### Expected Behavior
   
   ![Screenshot_121](https://user-images.githubusercontent.com/11349435/204077860-13dd87bc-aea0-4954-b4f9-3844883b2171.png)
   remoteToken为Null
   
   后续 主动主动向RpcContext上下文中添加隐式参数,跟踪发现走的是
   org.apache.dubbo.rpc.proxy.AbstractProxyInvoker 调用时根本没有使用隐式参数
   ```
   Object value = doInvoke(proxy, invocation.getMethodName(), invocation.getParameterTypes(), invocation.getArguments());
   ```
   ### Actual Behavior
   


-- 
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: notifications-unsubscribe@dubbo.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] AlbumenJ commented on issue #11033: dubbo token 消费者无法获取并传递到服务提供者,其他主动添加的隐式参数也无法传递到服务提供者

Posted by GitBox <gi...@apache.org>.
AlbumenJ commented on issue #11033:
URL: https://github.com/apache/dubbo/issues/11033#issuecomment-1367790706

   Fix in #11144


-- 
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: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] AlbumenJ commented on issue #11033: dubbo token 消费者无法获取并传递到服务提供者,其他主动添加的隐式参数也无法传递到服务提供者

Posted by GitBox <gi...@apache.org>.
AlbumenJ commented on issue #11033:
URL: https://github.com/apache/dubbo/issues/11033#issuecomment-1328426877

   org.apache.dubbo.rpc.protocol.rest.RpcContextFilter 会传递参数,但是这块的设计可能有问题,没有从 invocation 去取参数


-- 
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: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] AlbumenJ commented on issue #11033: dubbo token 消费者无法获取并传递到服务提供者,其他主动添加的隐式参数也无法传递到服务提供者

Posted by GitBox <gi...@apache.org>.
AlbumenJ commented on issue #11033:
URL: https://github.com/apache/dubbo/issues/11033#issuecomment-1347845238

   > 现在 rest 的到获取隐式参数时已经没有invocation 了 需要重RpcContext上设置进去 没有进入的原因是他不像dubbo 一样设置token 参数 然后provider 端也没有读取头部的隐藏参数
   
   rest protocol 的可以从 invocation 里面覆盖写入一次 RpcContext


-- 
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: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] ShenFeng312 commented on issue #11033: dubbo token 消费者无法获取并传递到服务提供者,其他主动添加的隐式参数也无法传递到服务提供者

Posted by GitBox <gi...@apache.org>.
ShenFeng312 commented on issue #11033:
URL: https://github.com/apache/dubbo/issues/11033#issuecomment-1344388636

   我在修复这个问题 但是发现几个其他的问题
   RpcContxt里的 内容好像和RpcInvocation 里的不是同一个对象  他们的修改互补影响 这个是正常的吗
   @AlbumenJ 


-- 
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: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] zhouyu00 commented on issue #11033: dubbo token 消费者无法获取并传递到服务提供者,其他主动添加的隐式参数也无法传递到服务提供者

Posted by GitBox <gi...@apache.org>.
zhouyu00 commented on issue #11033:
URL: https://github.com/apache/dubbo/issues/11033#issuecomment-1328005913

   刚刚又看了,难道就是dubbo-rest 没有实现隐式参数的传递?


-- 
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: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] ShenFeng312 commented on issue #11033: dubbo token 消费者无法获取并传递到服务提供者,其他主动添加的隐式参数也无法传递到服务提供者

Posted by GitBox <gi...@apache.org>.
ShenFeng312 commented on issue #11033:
URL: https://github.com/apache/dubbo/issues/11033#issuecomment-1347681129

   现在 rest 的到获取隐式参数时已经没有invocation 了  需要重RpcContext上设置进去  没有进入的原因是他不像dubbo 一样设置token 参数  然后provider 端也没有读取头部的隐藏参数


-- 
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: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] AlbumenJ commented on issue #11033: dubbo token 消费者无法获取并传递到服务提供者,其他主动添加的隐式参数也无法传递到服务提供者

Posted by GitBox <gi...@apache.org>.
AlbumenJ commented on issue #11033:
URL: https://github.com/apache/dubbo/issues/11033#issuecomment-1345998841

   > 我在修复这个问题 但是发现几个其他的问题 RpcContxt里的 内容好像和RpcInvocation 里的不是同一个对象 他们的修改互不影响 这个是正常的吗 @AlbumenJ
   
   框架侧的设计是推荐用户使用 RpcContext,框架内使用 invocation 传递。RpcContext 在最外侧的 Filter 会转换进 invocation。理论上数据是应该以 invocation 为准的


-- 
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: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Re: [I] dubbo token 消费者无法获取并传递到服务提供者,其他主动添加的隐式参数也无法传递到服务提供者 [dubbo]

Posted by "CrazyHZM (via GitHub)" <gi...@apache.org>.
CrazyHZM closed issue #11033: dubbo token 消费者无法获取并传递到服务提供者,其他主动添加的隐式参数也无法传递到服务提供者
URL: https://github.com/apache/dubbo/issues/11033


-- 
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: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org