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

Adds DAPR_GRPC_ENPOINT support to client #475

Merged
merged 2 commits into from
Dec 1, 2023

Conversation

JoshVanL
Copy link
Contributor

PR adds DAPR_GRPC_ENPOINT environment variable support to client.

Address parser respects http[s] schemes, and TLS query options, as per 0008-S-sidecar-endpoint-tls.md.

DAPR_GRPC_ENDPONT takes precedence over DAPR_GRPC_PORT.

PR adds `DAPR_GRPC_ENPOINT` environment variable support to client.

Address parser respects http[s] schemes, and TLS query options, as per
[0008-S-sidecar-endpoint-tls.md](https://github.com/dapr/proposals/blob/main/0008-S-sidecar-endpoint-tls.md).

`DAPR_GRPC_ENDPONT` takes precedence over `DAPR_GRPC_PORT`.

Signed-off-by: joshvanl <[email protected]>
@JoshVanL JoshVanL requested a review from a team as a code owner November 13, 2023 11:48
Copy link

codecov bot commented Nov 13, 2023

Codecov Report

Attention: 28 lines in your changes are missing coverage. Please review.

Comparison is base (ae8becf) 68.96% compared to head (d5e92fc) 69.71%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #475      +/-   ##
==========================================
+ Coverage   68.96%   69.71%   +0.74%     
==========================================
  Files          34       35       +1     
  Lines        2707     2843     +136     
==========================================
+ Hits         1867     1982     +115     
- Misses        732      746      +14     
- Partials      108      115       +7     
Files Coverage Δ
client/internal/parse.go 92.37% <92.37%> (ø)
client/client.go 65.46% <34.48%> (-4.79%) ⬇️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@yaron2 yaron2 merged commit 224a159 into dapr:main Dec 1, 2023
@mikeee
Copy link
Member

mikeee commented Dec 1, 2023

Are the grpc and grpcs schemas intentional? (They're not parsed)

@JoshVanL
Copy link
Contributor Author

JoshVanL commented Dec 1, 2023

@mikeee cpuld you elaborate?
The schema should be (hopefully!) following https://github.com/dapr/proposals/blob/main/0008-S-sidecar-endpoint-tls.md

@mikeee
Copy link
Member

mikeee commented Dec 1, 2023

In the parser lines 168-169 the grpc/s schemas are permitted yet not parsed as there is no handling for those schemas e.g. grpcs://localhost:443 would result in no target. (I understand this is not what the proposal includes - reading this I would be slightly confused if not for the switch statement not explicitly catching tbe rest of the valid schemas)

Comment on lines +168 to +169
"grpc",
"grpcs",
Copy link
Member

Choose a reason for hiding this comment

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

Although known, these weren't specified by the proposal and aren't handled in this function otherwise. Should they still be included?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks @mikeee, indeed these should be removed.

mikeee pushed a commit to mikeee/dapr_go-sdk that referenced this pull request Dec 17, 2023
* Adds `DAPR_GRPC_ENPOINT` support to client

PR adds `DAPR_GRPC_ENPOINT` environment variable support to client.

Address parser respects http[s] schemes, and TLS query options, as per
[0008-S-sidecar-endpoint-tls.md](https://github.com/dapr/proposals/blob/main/0008-S-sidecar-endpoint-tls.md).

`DAPR_GRPC_ENDPONT` takes precedence over `DAPR_GRPC_PORT`.

Signed-off-by: joshvanl <[email protected]>

* Remove errors.Join to have compatibility with Go 1.19

Signed-off-by: joshvanl <[email protected]>

---------

Signed-off-by: joshvanl <[email protected]>
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.

3 participants