fix(mcp): audit record keeps legacy name/index alias targets
A caller using the #38 aliases (name for repo, index for number) left no target in the tools/call audit record. Refs #64 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -121,3 +121,15 @@ func TestToolsCallAuditOmitsArgumentValuesOtherThanTarget(t *testing.T) {
|
||||
assert.NotContains(t, string(raw), sentinel)
|
||||
assert.Contains(t, recs[0], "args_bytes")
|
||||
}
|
||||
|
||||
// #38 keeps `name` (for repo) and `index` (for number) as legacy aliases; a
|
||||
// caller using them must still leave a target in the audit record.
|
||||
func TestToolsCallAuditRecordsLegacyAliasTargets(t *testing.T) {
|
||||
recs := captureAudit(t, func() {
|
||||
callTool(t, auditServer(auditStubTool{name: "issue_close"}), "issue_close",
|
||||
map[string]any{"owner": "mathias", "name": "infra", "index": 7})
|
||||
})
|
||||
require.Len(t, recs, 1)
|
||||
assert.Equal(t, "infra", recs[0]["name"])
|
||||
assert.EqualValues(t, 7, recs[0]["index"])
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user