-
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
feat: Support for the DAPR_HTTP_ENDPOINT
and DAPR_GRPC_ENDPOINT
environment variables. Adds support for DAPR_API_TOKEN to gRPC client
#519
Merged
Merged
Changes from 22 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
aaf074c
feat: Adds endpoint parsing
elena-kolevska 49ab722
Adds support for the DAPR_HTTP_ENDPOINT environment variable
elena-kolevska 0aaa913
Adds tests for endpoint environment variables (HTTP only)
elena-kolevska 6fd90c5
test: Adds tests for endpoint environment variables (HTTP only)
elena-kolevska 8f26003
Merge branch 'tls-support' of github.com:elena-kolevska/js-sdk into t…
elena-kolevska a29bc66
fix(style) Linter fixes
elena-kolevska 6d175a2
Adds support for dapr-api-token metadata
elena-kolevska d009132
Adds support for the DAPR_GRPC_ENDPOINT environment variable
elena-kolevska e63f270
Fixes linter issues
elena-kolevska 0e5672d
Fixes linter issues
elena-kolevska dc482b9
Only add api token interceptor if it’s specified
elena-kolevska e0fd4a3
Reorganises the code a bit
elena-kolevska 08407db
Runs pretty-fix
elena-kolevska 6e16458
Adds test for scheme prefix removal for grpc
elena-kolevska 2f1a277
Apply suggestions from code review
elena-kolevska 959ea7b
Apply suggestions from code review
elena-kolevska afb2eaf
Adds examples for the parseEndpoint function
elena-kolevska 1d731d1
Adds tests for the dapr-api-token metadata in gRPC calls
elena-kolevska 342a5a8
Updates after review
elena-kolevska 9226112
docs: Adds info and examples about the new environment variables to t…
elena-kolevska 605c587
Addresses review comments
elena-kolevska 94f271e
Small formatting fix
elena-kolevska 3b27c23
Fixes docs
elena-kolevska File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Are we showing here that this is the equivalent of setting the environment variable?
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.
Yes, this is how we can instantiate the client when we have
DAPR_GRPC_ENDPOINT
set. I noticed I had a copy/paste error for the HTTP example above though, so I fixed that. Basically, we don't need to pass constructor arguments for host and port when we have the env variables set.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 wonder if
DAPR_GRPC_ENDPOINT
is set, should we also by-default use communication protocol GRPC. Also while instantiating theDaprClient
, should we clearly log if we used env var to figure out host/port/protocol.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.
Good point! I can add a log.
Regarding the automatic setting of the protocol, I think we can't do it, because, as per the proposal we can have both
DAPR_GRPC_ENDPOINT
andDAPR_HTTP_ENDPOINT
set at the same time.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.
Right (and maybe this can be added to the proposal to unify SDK implementations), so if
DAPR_GRPC_ENDPOINT
is set, set protocol to gRPCDAPR_HTTP_ENDPOINT
is set, set protocol to HTTPPS, we can track this separately as well.