Skip to content

Commit 863f0ab

Browse files
jescaladafabiovincenzi
authored andcommitted
chore: add debug logs
For easier debugging based on our meeting - don't forget to remove this later!
1 parent 0b53906 commit 863f0ab

3 files changed

Lines changed: 15 additions & 0 deletions

File tree

src/proxy/ssh/AgentForwarding.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,15 @@ export class LazySSHAgent extends BaseAgent {
6969
}
7070

7171
const identities = await agentProxy.getIdentities();
72+
console.log('[LazyAgent] Identities:', identities);
73+
console.log('--------------------------------');
74+
console.log('[LazyAgent] AgentProxy client details: ', {
75+
agentChannel: this.client.agentChannel,
76+
agentProxy: this.client.agentProxy,
77+
agentForwardingEnabled: this.client.agentForwardingEnabled,
78+
clientIp: this.client.clientIp,
79+
authenticatedUser: this.client.authenticatedUser,
80+
});
7281

7382
// ssh2's AgentContext.init() calls parseKey() on every key we return.
7483
// We need to return the raw pubKeyBlob Buffer, which parseKey() can parse

src/proxy/ssh/AgentProxy.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,8 @@ export class SSHAgentProxy extends EventEmitter {
146146
throw new Error(`Unexpected response type: ${responseType}`);
147147
}
148148

149+
console.log('[AgentProxy] Identities response length: ', response.length);
150+
149151
return this.parseIdentities(response);
150152
}
151153

src/proxy/ssh/server.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,10 @@ export class SSHServer {
185185

186186
if (ctx.method === 'publickey') {
187187
const keyString = `${ctx.key.algo} ${ctx.key.data.toString('base64')}`;
188+
console.log(
189+
'[SSH] Attempting to find user by SSH key: ',
190+
JSON.stringify(keyString, null, 2),
191+
);
188192

189193
(db as any)
190194
.findUserBySSHKey(keyString)

0 commit comments

Comments
 (0)