({ name, storageType, url })
| 367 | } |
| 368 | }, |
| 369 | edit({ name, storageType, url }) { |
| 370 | let { username, password, hostname, port, query } = URLParse(url, true); |
| 371 | |
| 372 | if (username) { |
| 373 | username = decodeURIComponent(username); |
| 374 | } |
| 375 | |
| 376 | if (password) { |
| 377 | password = decodeURIComponent(password); |
| 378 | } |
| 379 | |
| 380 | if (storageType === "ftp") { |
| 381 | let { security, mode } = query; |
| 382 | if (security) { |
| 383 | security = decodeURIComponent(security); |
| 384 | } |
| 385 | |
| 386 | if (mode) { |
| 387 | mode = decodeURIComponent(mode); |
| 388 | } |
| 389 | |
| 390 | return this.addFtp( |
| 391 | username, |
| 392 | password, |
| 393 | hostname, |
| 394 | name, |
| 395 | port, |
| 396 | security, |
| 397 | mode, |
| 398 | ); |
| 399 | } |
| 400 | |
| 401 | if (storageType === "sftp") { |
| 402 | let { passPhrase, keyFile } = query; |
| 403 | if (passPhrase) { |
| 404 | passPhrase = decodeURIComponent(passPhrase); |
| 405 | } |
| 406 | |
| 407 | if (keyFile) { |
| 408 | keyFile = decodeURIComponent(keyFile); |
| 409 | } |
| 410 | |
| 411 | return this.addSftp( |
| 412 | hostname, |
| 413 | username, |
| 414 | keyFile, |
| 415 | password, |
| 416 | passPhrase, |
| 417 | port, |
| 418 | name, |
| 419 | password ? "password" : "key", |
| 420 | ); |
| 421 | } |
| 422 | |
| 423 | return null; |
| 424 | }, |
| 425 | }; |
| 426 |
nothing calls this directly
no outgoing calls
no test coverage detected