mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-26 13:04:49 -07:00
feat(core): implement HTTP authentication support for A2A remote agents (#20510)
Co-authored-by: Adam Weidman <adamfweidman@google.com>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user