Skip to content

Commit 3f15cf4

Browse files
committed
Add ruff --unsafe-fixes
1 parent 0902102 commit 3f15cf4

File tree

5 files changed

+13
-8
lines changed

5 files changed

+13
-8
lines changed

src/a2a/client/auth/__init__.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
"""Client-side authentication components for the A2A Python SDK."""
22

3-
from .credentials import CredentialService, InMemoryContextCredentialStore
4-
from .interceptor import AuthInterceptor
3+
from a2a.client.auth.credentials import (
4+
CredentialService,
5+
InMemoryContextCredentialStore,
6+
)
7+
from a2a.client.auth.interceptor import AuthInterceptor
58

69

710
__all__ = [

src/a2a/client/auth/credentials.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class InMemoryContextCredentialStore(CredentialService):
2424
store and retrieve credentials...
2525
"""
2626

27-
def __init__(self):
27+
def __init__(self) -> None:
2828
# {session_id: {scheme_name: credential}}
2929
self._store: dict[str, dict[str, str]] = {}
3030

@@ -40,7 +40,7 @@ async def get_credentials(
4040

4141
async def set_credential(
4242
self, session_id: str, security_scheme_name: str, credential: str
43-
):
43+
) -> None:
4444
"""Method to populate the store."""
4545
if session_id not in self._store:
4646
self._store[session_id] = {}

src/a2a/client/auth/interceptor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ async def intercept(
5959
and scheme_def.scheme.lower() == 'bearer'
6060
) or isinstance(
6161
scheme_def,
62-
(OAuth2SecurityScheme, OpenIdConnectSecurityScheme),
62+
OAuth2SecurityScheme | OpenIdConnectSecurityScheme,
6363
):
6464
is_bearer_scheme = True
6565

src/a2a/client/auth/user.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class UnauthenticatedUser(User):
2121
"""A representation that no user has been authenticated in the request."""
2222

2323
@property
24-
def is_authenticated(self):
24+
def is_authenticated(self) -> bool:
2525
return False
2626

2727
@property

src/a2a/client/middleware.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
from abc import ABC, abstractmethod
22
from collections.abc import MutableMapping
3-
from typing import Any
3+
from typing import TYPE_CHECKING, Any
44

55
from pydantic import BaseModel, Field
66

7-
from a2a.types import AgentCard
7+
8+
if TYPE_CHECKING:
9+
from a2a.types import AgentCard
810

911

1012
class ClientCallContext(BaseModel):

0 commit comments

Comments
 (0)