From 521df9a29da602746c2ce5ac39e021d7b878e7f3 Mon Sep 17 00:00:00 2001 From: Jakub Zych Date: Fri, 23 Oct 2026 21:20:46 +0200 Subject: [PATCH] test: TestJournalPromptWrites grants record the consented administrator pier now gives a backend subject only to a grant whose consented administrator (pact.MCPGrant.BackendUserID) is the one linked; the fake verifier's grants name the linked backend user. --- mcp_prompt_writes_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mcp_prompt_writes_test.go b/mcp_prompt_writes_test.go index f4bd8b2..e8f9d7d 100644 --- a/mcp_prompt_writes_test.go +++ b/mcp_prompt_writes_test.go @@ -43,7 +43,8 @@ func (h *servingHost) ServeHTTP(w http.ResponseWriter, r *http.Request) { } // promptGrants verifies two OAuth grants of one linked user: read only and -// read+write, both with the backend scope. +// read+write, both with the backend scope and consented for the linked +// backend user 1 (pact.MCPGrant.BackendUserID). type promptGrants struct{} func (promptGrants) MCPVerifyToken(_ context.Context, raw string) (pact.MCPGrant, error) { @@ -51,7 +52,7 @@ func (promptGrants) MCPVerifyToken(_ context.Context, raw string) (pact.MCPGrant if scopes == nil { return pact.MCPGrant{}, pact.ErrMCPTokenInvalid } - return pact.MCPGrant{UserID: 5, ClientID: "agent", TokenID: 9, Scopes: scopes, ExpiresAt: time.Now().Add(time.Hour)}, nil + return pact.MCPGrant{UserID: 5, ClientID: "agent", TokenID: 9, Scopes: scopes, ExpiresAt: time.Now().Add(time.Hour), BackendUserID: 1}, nil } func (promptGrants) MCPResource() string { return "https://app.example.test/mcp" }