feat(core): implement HTTP authentication support for A2A remote agents (#20510)

Co-authored-by: Adam Weidman <adamfweidman@google.com>
This commit is contained in:
Sandy Tao
2026-03-02 11:59:48 -08:00
committed by GitHub
parent 48412a068e
commit 446a4316c4
11 changed files with 565 additions and 27 deletions
@@ -439,6 +439,54 @@ auth:
});
});
it('should parse remote agent with Digest via raw value', async () => {
const filePath = await writeAgentMarkdown(`---
kind: remote
name: digest-agent
agent_card_url: https://example.com/card
auth:
type: http
scheme: Digest
value: username="admin", response="abc123"
---
`);
const result = await parseAgentMarkdown(filePath);
expect(result).toHaveLength(1);
expect(result[0]).toMatchObject({
kind: 'remote',
name: 'digest-agent',
auth: {
type: 'http',
scheme: 'Digest',
value: 'username="admin", response="abc123"',
},
});
});
it('should parse remote agent with generic raw auth value', async () => {
const filePath = await writeAgentMarkdown(`---
kind: remote
name: raw-agent
agent_card_url: https://example.com/card
auth:
type: http
scheme: CustomScheme
value: raw-token-value
---
`);
const result = await parseAgentMarkdown(filePath);
expect(result).toHaveLength(1);
expect(result[0]).toMatchObject({
kind: 'remote',
name: 'raw-agent',
auth: {
type: 'http',
scheme: 'CustomScheme',
value: 'raw-token-value',
},
});
});
it('should throw error for Bearer auth without token', async () => {
const filePath = await writeAgentMarkdown(`---
kind: remote