-
Notifications
You must be signed in to change notification settings - Fork 207
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
Fix bi-di subscription to support dapr-api-token #1142
Conversation
@@ -59,7 +59,7 @@ public ActorClient(ResiliencyOptions resiliencyOptions) { | |||
* @param overrideProperties Override properties. | |||
*/ | |||
public ActorClient(Properties overrideProperties) { | |||
this(buildManagedChannel(overrideProperties), null); | |||
this(buildManagedChannel(overrideProperties), null, overrideProperties.getValue(Properties.API_TOKEN)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also needed to fix how properties override work in some cases because it was not handling overrides correctly for Dapr API Token. Now, it works too and all ITs require sidecar calls to have dapr-api-token header.
@@ -425,7 +474,8 @@ private <T> Subscription<T> buildSubscription( | |||
SubscriptionListener<T> listener, | |||
TypeRef<T> type, | |||
DaprProtos.SubscribeTopicEventsRequestAlpha1 request) { | |||
Subscription<T> subscription = new Subscription<>(this.asyncStub, request, listener, response -> { | |||
var interceptedStub = this.grpcInterceptors.intercept(this.asyncStub); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the fix for streaming subscription to handle Dapr API token header.
Signed-off-by: Artur Souza <asouza.pro@gmail.com>
Signed-off-by: Artur Souza <asouza.pro@gmail.com>
Signed-off-by: Artur Souza <asouza.pro@gmail.com>
Signed-off-by: Artur Souza <asouza.pro@gmail.com>
Changes lgtm, but I see some build failures - might be flaky |
I have been fixing those for the past few days. Almost there. |
Signed-off-by: Artur Souza <asouza.pro@gmail.com>
I think that was the last one. Waiting for the run now. |
Description
Fix bi-di subscription to support dapr-api-token
Issue reference
We strive to have all PR being opened based on an issue, where the problem or feature have been discussed prior to implementation.
Please reference the issue this PR will close: #1072
Checklist
Please make sure you've completed the relevant tasks for this PR, out of the following list: