Skip to content

Commit 89b141b

Browse files
authored
fix: pass ServerCallContext to getAuthenticatedExtendedAgentCard for REST (#274)
# Description Follow-up for #142: authenticated agent card logic relies on context to determine authentication status. `src/server/transports/rest/rest_transport_handler.ts` is not exported, so adding a required parameter is fine. Re #137
1 parent 23cd42e commit 89b141b

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/server/express/rest_handler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ export function restHandler(options: RestHandlerOptions): RequestHandler {
268268
'/v1/card',
269269
asyncHandler(async (req, res) => {
270270
const context = await buildContext(req);
271-
const result = await restTransportHandler.getAuthenticatedExtendedAgentCard();
271+
const result = await restTransportHandler.getAuthenticatedExtendedAgentCard(context);
272272
sendResponse(res, HTTP_STATUS.OK, context, result);
273273
})
274274
);

src/server/transports/rest/rest_transport_handler.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,8 @@ export class RestTransportHandler {
146146
/**
147147
* Gets the authenticated extended agent card.
148148
*/
149-
async getAuthenticatedExtendedAgentCard(): Promise<AgentCard> {
150-
return this.requestHandler.getAuthenticatedExtendedAgentCard();
149+
async getAuthenticatedExtendedAgentCard(context: ServerCallContext): Promise<AgentCard> {
150+
return this.requestHandler.getAuthenticatedExtendedAgentCard(context);
151151
}
152152

153153
/**

0 commit comments

Comments
 (0)