-
Notifications
You must be signed in to change notification settings - Fork 88
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 Actor ID validation #539
Conversation
Signed-off-by: heunghingwan <[email protected]>
Signed-off-by: heunghingwan <[email protected]>
Add empty checking after some reading in dapr/dapr#6461
|
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.
Thank you for adding a test!!! Almost there, just a small change :)
Signed-off-by: heunghingwan <[email protected]>
Can we still change |
Signed-off-by: heunghingwan <[email protected]>
Yes, it will be more versatile when importing in a javascript-only application |
Perfect! But please use the multi line if instead of single one if (!id) {
...
} |
Signed-off-by: heunghingwan <[email protected]>
@heunghingwan were you able to test your scenario from the issue with this PR?
Since we are decoding back in |
You are right, maybe add a getURISafeId function, or encoded in ActorClientHTTP.ts, to provide unencoded id for grpc use? |
Signed-off-by: heunghingwan <[email protected]>
Signed-off-by: heunghingwan <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #539 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 1 1
Lines 6 6
Branches 1 1
=========================================
Hits 6 6 ☔ View full report in Codecov by Sentry. |
@XavierGeerinck one issue I see with this change is, we are introducing a parity between HTTP and gRPC actor clients. HTTP will use a sanitized actor ID, and gRPC won't. This means there will be interop issues b/w the two protocols. I would propose to modify gRPC's behavior too and keep it consistent. Thoughts? |
It should not behave differently, actor ID in gRPC is transmitted as-is, actor ID in HTTP should be decoded in core |
@heunghingwan I see, it should be fine in that case, thanks for your contribution! |
Description
Throw when actor id contain '/'
Issue reference
issue this PR will close: #537
Checklist
Please make sure you've completed the relevant tasks for this PR, out of the following list: