Skip to content

Commit 7dd561f

Browse files
bug: Sync jsonrpc and rest implementation of authenticated agent card
1 parent 9193208 commit 7dd561f

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

src/a2a/server/request_handlers/jsonrpc_handler.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import logging
2-
32
from collections.abc import AsyncIterable, Callable
43

54
from a2a.server.context import ServerCallContext
@@ -49,7 +48,6 @@
4948
from a2a.utils.helpers import validate
5049
from a2a.utils.telemetry import SpanKind, trace_class
5150

52-
5351
logger = logging.getLogger(__name__)
5452

5553

@@ -425,14 +423,10 @@ async def get_authenticated_extended_card(
425423
Returns:
426424
A `GetAuthenticatedExtendedCardResponse` object containing the config or a JSON-RPC error.
427425
"""
428-
if (
429-
self.extended_agent_card is None
430-
and self.extended_card_modifier is None
431-
):
432-
return GetAuthenticatedExtendedCardResponse(
433-
root=JSONRPCErrorResponse(
434-
id=request.id,
435-
error=AuthenticatedExtendedCardNotConfiguredError(),
426+
if not self.agent_card.supports_authenticated_extended_card:
427+
raise ServerError(
428+
error=AuthenticatedExtendedCardNotConfiguredError(
429+
message='Authenticated card not supported'
436430
)
437431
)
438432

0 commit comments

Comments
 (0)