-
Notifications
You must be signed in to change notification settings - Fork 138
multi app token workflow #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 🙏
| # -*- coding: utf-8 -*- | ||
|
|
||
| """ | ||
| Copyright 2024 The Dapr Authors |
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.
| Copyright 2024 The Dapr Authors | |
| Copyright 2025 The Dapr Authors |
| 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 |
| """ | ||
| self._client = DaprHttpClient(message_serializer, timeout, headers_callback, retry_policy) | ||
| self._client = DaprHttpClient( | ||
| message_serializer, timeout, headers_callback, retry_policy, 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.
I like kv arguments, but for consistency...
| message_serializer, timeout, headers_callback, retry_policy, api_token=api_token | |
| message_serializer, timeout, headers_callback, retry_policy, api_token |
| class DaprHealth: | ||
| @staticmethod | ||
| def wait_until_ready(): | ||
| def wait_until_ready(api_token: str = None): |
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.
| def wait_until_ready(api_token: str = None): | |
| def wait_until_ready(api_token: Optional[str] = None): |
| 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
Description
Please explain the changes you've made
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: