Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions src/a2a/client/auth/interceptor.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,7 @@ async def before(self, args: BeforeArgs) -> None:
scheme_name, args.context
)
if credential and scheme_name in agent_card.security_schemes:
scheme = agent_card.security_schemes.get(scheme_name)
if not scheme:
continue
scheme = agent_card.security_schemes[scheme_name]

if args.context is None:
args.context = ClientCallContext()
Expand Down
3 changes: 1 addition & 2 deletions src/a2a/server/events/event_queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,5 +243,4 @@ async def clear_events(self, clear_child_queues: bool = True) -> None:
for child in self._children
]

if child_tasks:
await asyncio.gather(*child_tasks, return_exceptions=True)
await asyncio.gather(*child_tasks, return_exceptions=True)
5 changes: 1 addition & 4 deletions src/a2a/server/request_handlers/grpc_handler.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# ruff: noqa: N802
import contextlib
import logging

from abc import ABC, abstractmethod
Expand Down Expand Up @@ -74,9 +73,7 @@ class DefaultCallContextBuilder(CallContextBuilder):
def build(self, context: grpc.aio.ServicerContext) -> ServerCallContext:
"""Builds the ServerCallContext."""
user = UnauthenticatedUser()
state = {}
with contextlib.suppress(Exception):
state['grpc_context'] = context
state = {'grpc_context': context}
return ServerCallContext(
user=user,
state=state,
Expand Down
3 changes: 1 addition & 2 deletions src/a2a/server/routes/jsonrpc_dispatcher.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""JSON-RPC application for A2A server."""

import contextlib
import json
import logging
import traceback
Expand Down Expand Up @@ -154,7 +153,7 @@ def build(self, request: Request) -> ServerCallContext:
"""
user: A2AUser = UnauthenticatedUser()
state = {}
with contextlib.suppress(Exception):
if 'user' in request.scope:
user = StarletteUserProxy(request.user)
state['auth'] = request.auth
state['headers'] = dict(request.headers)
Expand Down
2 changes: 1 addition & 1 deletion src/a2a/utils/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def append_artifact_to_task(task: Task, event: TaskArtifactUpdateEvent) -> None:
"""
new_artifact_data: Artifact = event.artifact
artifact_id: str = new_artifact_data.artifact_id
append_parts: bool = event.append or False
append_parts: bool = event.append

existing_artifact: Artifact | None = None
existing_artifact_list_index: int | None = None
Expand Down
Loading