Skip to content

Commit b7b879b

Browse files
committed
Pyright
1 parent 8375a46 commit b7b879b

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

packages/api/src/microsoft/teams/api/clients/bot/token_client.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import inspect
77
from typing import Literal, Optional, Union
88

9+
from microsoft.teams.api.auth.credentials import ClientCredentials
910
from microsoft.teams.common.http import Client, ClientOptions
1011
from pydantic import BaseModel
1112

@@ -69,6 +70,10 @@ async def get(self, credentials: Credentials) -> GetBotTokenResponse:
6970
access_token=token,
7071
)
7172

73+
assert isinstance(credentials, ClientCredentials), (
74+
"Bot token client currently only supports Credentials with secrets."
75+
)
76+
7277
tenant_id = credentials.tenant_id or "botframework.com"
7378
res = await self.http.post(
7479
f"https://login.microsoftonline.com/{tenant_id}/oauth2/v2.0/token",
@@ -106,6 +111,10 @@ async def get_graph(self, credentials: Credentials) -> GetBotTokenResponse:
106111
access_token=token,
107112
)
108113

114+
assert isinstance(credentials, ClientCredentials), (
115+
"Bot token client currently only supports Credentials with secrets."
116+
)
117+
109118
tenant_id = credentials.tenant_id or "botframework.com"
110119
res = await self.http.post(
111120
f"https://login.microsoftonline.com/{tenant_id}/oauth2/v2.0/token",

0 commit comments

Comments
 (0)