mirror of
https://github.com/binaricat/Netcatty.git
synced 2026-11-16 20:11:08 +00:00
fix: honor SSH agent opt-out
This commit is contained in:
1 parent
7cb722a5c5
commit
0046291376
14 files changed
+61
-13
No files matched your search
@@ -9,6 +9,7 @@ const path = require("node:path");
|
||||
const { Duplex } = require("node:stream");
|
||||
|
||||
const {
|
||||
buildAuthHandler,
|
||||
getAvailableAgentSocket,
|
||||
getNativeOpenSshAgentSocket,
|
||||
cygwinAgentConnectable,
|
||||
@@ -18,6 +19,16 @@ const {
|
||||
resolveIdentityAgentPath,
|
||||
} = require("./sshAuthHelper.cjs");
|
||||
|
||||
test("explicit agent opt-out suppresses automatic socket fallback", () => {
|
||||
const auth = buildAuthHandler({
|
||||
username: "deploy",
|
||||
allowAgentFallback: false,
|
||||
sshAgentSocketOverride: "/tmp/agent.sock",
|
||||
});
|
||||
|
||||
assert.equal(auth.agent, null);
|
||||
});
|
||||
|
||||
test("IdentityAgent paths expand standard OpenSSH connection tokens", () => {
|
||||
const resolved = resolveIdentityAgentPath(
|
||||
"%d/.ssh/agent-%h-%p-%r-%u-%l-%L-%i-%%-%C.sock",
|
||||
|
||||
Reference in new issue
Block a user