Skip to content

Commit 0a65b52

Browse files
Merge pull request google#1866 from hironow:hironow/type-fix-for-static
PiperOrigin-RevId: 782040553
2 parents 0a9e67d + 843b791 commit 0a65b52

6 files changed

Lines changed: 15 additions & 15 deletions

File tree

‎src/google/adk/auth/auth_handler.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@
3030
try:
3131
from authlib.integrations.requests_client import OAuth2Session
3232

33-
AUTHLIB_AVIALABLE = True
33+
AUTHLIB_AVAILABLE = True
3434
except ImportError:
35-
AUTHLIB_AVIALABLE = False
35+
AUTHLIB_AVAILABLE = False
3636

3737

3838
class AuthHandler:
@@ -146,7 +146,7 @@ def generate_auth_uri(
146146
ValueError: If the authorization endpoint is not configured in the auth
147147
scheme.
148148
"""
149-
if not AUTHLIB_AVIALABLE:
149+
if not AUTHLIB_AVAILABLE:
150150
return (
151151
self.auth_config.raw_auth_credential.model_copy(deep=True)
152152
if self.auth_config.raw_auth_credential

‎src/google/adk/auth/exchanger/oauth2_credential_exchanger.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@
3333
try:
3434
from authlib.integrations.requests_client import OAuth2Session
3535

36-
AUTHLIB_AVIALABLE = True
36+
AUTHLIB_AVAILABLE = True
3737
except ImportError:
38-
AUTHLIB_AVIALABLE = False
38+
AUTHLIB_AVAILABLE = False
3939

4040
logger = logging.getLogger("google_adk." + __name__)
4141

@@ -68,7 +68,7 @@ async def exchange(
6868
"auth_scheme is required for OAuth2 credential exchange"
6969
)
7070

71-
if not AUTHLIB_AVIALABLE:
71+
if not AUTHLIB_AVAILABLE:
7272
# If authlib is not available, we cannot exchange the credential.
7373
# We return the original credential without exchange.
7474
# The client using this tool can decide to exchange the credential

‎src/google/adk/auth/oauth2_credential_util.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@
2929
from authlib.integrations.requests_client import OAuth2Session
3030
from authlib.oauth2.rfc6749 import OAuth2Token
3131

32-
AUTHLIB_AVIALABLE = True
32+
AUTHLIB_AVAILABLE = True
3333
except ImportError:
34-
AUTHLIB_AVIALABLE = False
34+
AUTHLIB_AVAILABLE = False
3535

3636

3737
logger = logging.getLogger("google_adk." + __name__)

‎src/google/adk/auth/refresher/oauth2_credential_refresher.py‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@
3434
try:
3535
from authlib.oauth2.rfc6749 import OAuth2Token
3636

37-
AUTHLIB_AVIALABLE = True
37+
AUTHLIB_AVAILABLE = True
3838
except ImportError:
39-
AUTHLIB_AVIALABLE = False
39+
AUTHLIB_AVAILABLE = False
4040

4141
logger = logging.getLogger("google_adk." + __name__)
4242

@@ -63,7 +63,7 @@ async def is_refresh_needed(
6363

6464
# Handle regular OAuth2 credentials
6565
if auth_credential.oauth2:
66-
if not AUTHLIB_AVIALABLE:
66+
if not AUTHLIB_AVAILABLE:
6767
return False
6868

6969
return OAuth2Token({
@@ -93,7 +93,7 @@ async def refresh(
9393

9494
# Handle regular OAuth2 credentials
9595
if auth_credential.oauth2 and auth_scheme:
96-
if not AUTHLIB_AVIALABLE:
96+
if not AUTHLIB_AVAILABLE:
9797
return auth_credential
9898

9999
if not auth_credential.oauth2:

‎tests/unittests/auth/exchanger/test_oauth2_credential_exchanger.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,9 +208,9 @@ async def test_exchange_authlib_not_available(self):
208208

209209
exchanger = OAuth2CredentialExchanger()
210210

211-
# Mock AUTHLIB_AVIALABLE to False
211+
# Mock AUTHLIB_AVAILABLE to False
212212
with patch(
213-
"google.adk.auth.exchanger.oauth2_credential_exchanger.AUTHLIB_AVIALABLE",
213+
"google.adk.auth.exchanger.oauth2_credential_exchanger.AUTHLIB_AVAILABLE",
214214
False,
215215
):
216216
result = await exchanger.exchange(credential, scheme)

‎tests/unittests/auth/test_auth_handler.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ async def test_token_exchange_not_supported(
456456
self, auth_config_with_auth_code, monkeypatch
457457
):
458458
"""Test when token exchange is not supported."""
459-
monkeypatch.setattr("google.adk.auth.auth_handler.AUTHLIB_AVIALABLE", False)
459+
monkeypatch.setattr("google.adk.auth.auth_handler.AUTHLIB_AVAILABLE", False)
460460

461461
handler = AuthHandler(auth_config_with_auth_code)
462462
result = await handler.exchange_auth_token()

0 commit comments

Comments
 (0)