-
Couldn't load subscription status.
- Fork 138
multi app token workflow (started from allow to create clients with different dapr-api-token ) #856
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
base: main
Are you sure you want to change the base?
Conversation
…iginal env var DAPR_API_TOKEN if found Signed-off-by: Filinto Duran <[email protected]>
Signed-off-by: Filinto Duran <[email protected]>
Signed-off-by: Filinto Duran <[email protected]>
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.
Also add more information in the PR description 🙏
dapr/aio/clients/grpc/client.py
Outdated
| falls back to DAPR_API_TOKEN environment variable. | ||
| """ | ||
| DaprHealth.wait_until_ready() | ||
| self._api_token = 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.
Why don't set api_token to default to settings.DAPR_API_TOKEN, and use it throughout this init function?
| self._api_token = api_token | |
| api_token = api_token if api_token is not None else settings.DAPR_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.
sure, makes sense, I'll make changes in a commit as it covers more than just this line
| raise DaprInternalError(f'{error}') from error | ||
|
|
||
| self._logger = Logger('DaprWorkflowClient', logger_options) | ||
| self._api_token = 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.
Does this need to go to _api_token? Can't we just use api_token directly? I don't think it's used outside of this function
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.
the underscore prefix usually hints to tell people that the variable is internal (kind of private and tell people to not used outside, not part of the external api, even though anything in python is usually accessible if you want to) more than anything. like _logger there
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.
But the _logger is used in other places, the api_token doesn't leave this function.
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 see what you mean, like why make is it part of the instance of the object. true, let me check
Co-authored-by: Albert Callarisa <[email protected]> Signed-off-by: Filinto Duran <[email protected]>
Co-authored-by: Albert Callarisa <[email protected]> Signed-off-by: Filinto Duran <[email protected]>
Co-authored-by: Albert Callarisa <[email protected]> Signed-off-by: Filinto Duran <[email protected]>
Signed-off-by: Filinto Duran <[email protected]>
|
@acroca please take another look |
ext/dapr-ext-workflow/dapr/ext/workflow/dapr_workflow_client.py
Outdated
Show resolved
Hide resolved
Co-authored-by: Albert Callarisa <[email protected]> Signed-off-by: Filinto Duran <[email protected]>
Co-authored-by: Albert Callarisa <[email protected]> Signed-off-by: Filinto Duran <[email protected]>
Co-authored-by: Albert Callarisa <[email protected]> Signed-off-by: Filinto Duran <[email protected]>
Co-authored-by: Albert Callarisa <[email protected]> Signed-off-by: Filinto Duran <[email protected]>
Co-authored-by: Albert Callarisa <[email protected]> Signed-off-by: Filinto Duran <[email protected]>
Co-authored-by: Albert Callarisa <[email protected]> Signed-off-by: Filinto Duran <[email protected]>
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.
The validations have failed, please fix them 🙏
Signed-off-by: Filinto Duran <[email protected]>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #856 +/- ##
==========================================
+ Coverage 86.63% 87.61% +0.98%
==========================================
Files 84 94 +10
Lines 4473 6289 +1816
==========================================
+ Hits 3875 5510 +1635
- Misses 598 779 +181 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Description
Allow to create clients with different dapr-api-tokens in the same process
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: #[issue number]
Checklist
Please make sure you've completed the relevant tasks for this PR, out of the following list: