Skip to content

Commit 5dfe0c4

Browse files
authored
Making token credential optional (#45)
Signed-off-by: Ryan Lettieri <[email protected]>
1 parent 70ee6b6 commit 5dfe0c4

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

durabletask-azuremanaged/durabletask/azuremanaged/client.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# Licensed under the MIT License.
33

44
from azure.core.credentials import TokenCredential
5+
from typing import Optional
56

67
from durabletask.azuremanaged.internal.durabletask_grpc_interceptor import \
78
DTSDefaultClientInterceptorImpl
@@ -13,7 +14,7 @@ class DurableTaskSchedulerClient(TaskHubGrpcClient):
1314
def __init__(self, *,
1415
host_address: str,
1516
taskhub: str,
16-
token_credential: TokenCredential,
17+
token_credential: Optional[TokenCredential],
1718
secure_channel: bool = True):
1819

1920
if not taskhub:

durabletask-azuremanaged/durabletask/azuremanaged/internal/durabletask_grpc_interceptor.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
# Licensed under the MIT License.
33

44
import grpc
5+
from typing import Optional
6+
57
from azure.core.credentials import TokenCredential
68

79
from durabletask.azuremanaged.internal.access_token_manager import \
@@ -15,7 +17,7 @@ class DTSDefaultClientInterceptorImpl (DefaultClientInterceptorImpl):
1517
StreamUnaryClientInterceptor and StreamStreamClientInterceptor from grpc to add an
1618
interceptor to add additional headers to all calls as needed."""
1719

18-
def __init__(self, token_credential: TokenCredential, taskhub_name: str):
20+
def __init__(self, token_credential: Optional[TokenCredential], taskhub_name: str):
1921
self._metadata = [("taskhub", taskhub_name)]
2022
super().__init__(self._metadata)
2123

durabletask-azuremanaged/durabletask/azuremanaged/worker.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# Licensed under the MIT License.
33

44
from azure.core.credentials import TokenCredential
5+
from typing import Optional
56

67
from durabletask.azuremanaged.internal.durabletask_grpc_interceptor import \
78
DTSDefaultClientInterceptorImpl
@@ -13,7 +14,7 @@ class DurableTaskSchedulerWorker(TaskHubGrpcWorker):
1314
def __init__(self, *,
1415
host_address: str,
1516
taskhub: str,
16-
token_credential: TokenCredential,
17+
token_credential: Optional[TokenCredential],
1718
secure_channel: bool = True):
1819

1920
if not taskhub:

0 commit comments

Comments
 (0)