Skip to content

Commit 56cfb04

Browse files
committed
test(plugin-auth): the account-event audit fixture hands the client as the transport peer
The fixture supplied its client through a forwarded header on a deployment that declares no trusted proxy. The library's reader now follows the client-address trust rule, which does not believe that header, so the fixture hands the address the rule does believe: the transport's peer address. Claude-Session: https://claude.ai/code/session_01UmqzD97e14iws6hmVhgZ5y Co-authored-by: Claude <noreply@anthropic.com>
1 parent 2604658 commit 56cfb04

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎packages/plugins/plugin-auth/src/auth-account-event-audit.test.ts‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,17 +56,20 @@ function deployment(config: Record<string, unknown> = {}) {
5656
return { engine, manager, events };
5757
}
5858

59+
// The client is the connection's peer address, handed over the way the auth
60+
// route hands the transport's peer: the address the client-address trust rule
61+
// (`client-address.ts`) establishes when no proxy is declared trusted.
5962
const post = (manager: AuthManager, path: string, body: unknown) =>
6063
manager.handleRequest(
6164
new Request(`${BASE}${path}`, {
6265
method: 'POST',
6366
headers: {
6467
'Content-Type': 'application/json',
65-
'x-forwarded-for': CLIENT_IP,
6668
'user-agent': CLIENT_UA,
6769
},
6870
body: JSON.stringify(body),
6971
}),
72+
{ remoteAddress: CLIENT_IP },
7073
);
7174

7275
async function signUp(manager: AuthManager): Promise<void> {

0 commit comments

Comments
 (0)