MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / constructor

Method constructor

src/fileSystem/sftp.js:31–52  ·  view source on GitHub ↗

* * @param {String} hostname * @param {Number} port * @param {String} username * @param {{password?: String, passPhrase?: String, keyFile?: String}} authentication

(hostname, port = 22, username, authentication)

Source from the content-addressed store, hash-verified

29 * @param {{password?: String, passPhrase?: String, keyFile?: String}} authentication
30 */
31 constructor(hostname, port = 22, username, authentication) {
32 this.#hostname = hostname;
33 this.#port = port;
34 this.#username = username;
35 this.#authenticationType = !!authentication.keyFile ? "key" : "password";
36 this.#keyFile = authentication.keyFile;
37 this.#passPhrase = authentication.passPhrase;
38 this.#password = authentication.password;
39 this.#base = Url.formate({
40 protocol: "sftp:",
41 hostname: this.#hostname,
42 port: this.#port,
43 username: this.#username,
44 password: this.#password,
45 query: {
46 passPhrase: this.#passPhrase,
47 keyFile: this.#keyFile,
48 },
49 });
50
51 this.#connectionID = `${this.#username}@${this.#hostname}`;
52 }
53
54 setPath(path) {
55 this.#path = path;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected