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

Accept URIs with scheme, add default SSL options for https, deprecate URLs without scheme #357

Merged
merged 16 commits into from
Apr 6, 2024

Conversation

v0idpwn
Copy link
Contributor

@v0idpwn v0idpwn commented Apr 4, 2024

This commit changes how addresses are handled by GRPC.Stub.connect/2.

First, by accepting URIs with scheme. Before, `http://localhost:50051" would
cause a crash.

Second, by using the URI scheme to automatically set a GRPC credential if no
GRPC credentials were provided. If we were to remove this part, we could at
least validate that a GRPC credential was provided when the scheme is https.

Finally, by deprecating receiving URLs without scheme, such as localhost:50051.
This isn't strictly necessary, but in my opinion makes things more consistent when
we want to support both local sockets and remote urls.

Edit: the deprecation part was removed after review.

… URLs without scheme

This commit changes how addresses are handled by GRPC.Stub.connect/2.

First, by accepting URIs with scheme. Before, `http://localhost:50051" would
cause a crash.

Second, by using the URI scheme to automatically set a GRPC credential if no
GRPC credentials were provided. If we were to remove this part, we could at
least validate that a GRPC credential was provided when the scheme is https.

Finally, by deprecating receiving URLs without scheme, such as `localhost:50051`.
This isn't strictly necessary, but in my opinion makes things more consistent when
we want to support both local sockets and remote urls.
lib/grpc/stub.ex Outdated Show resolved Hide resolved
@v0idpwn
Copy link
Contributor Author

v0idpwn commented Apr 5, 2024

Pushed a few commits doing (I believe) all suggestions :)

lib/grpc/stub.ex Outdated Show resolved Hide resolved
Copy link
Contributor

@polvalente polvalente left a comment

Choose a reason for hiding this comment

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

Only 1 question left :)

Makes all examples in the documentation include `http` or `https`.
Changes tests to avoid using deprecated code.
@polvalente polvalente merged commit f8c8b17 into elixir-grpc:master Apr 6, 2024
16 checks passed
@v0idpwn v0idpwn deleted the feat/accept-uri branch April 6, 2024 00:15
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.

2 participants