SFTP_Key.php 990 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. /**
  3. * SPDX-FileCopyrightText: 2018-2024 Nextcloud GmbH and Nextcloud contributors
  4. * SPDX-FileCopyrightText: 2016 ownCloud, Inc.
  5. * SPDX-License-Identifier: AGPL-3.0-only
  6. */
  7. namespace OCA\Files_External\Lib\Backend;
  8. use OCA\Files_External\Lib\Auth\AuthMechanism;
  9. use OCA\Files_External\Lib\Auth\PublicKey\RSA;
  10. use OCA\Files_External\Lib\DefinitionParameter;
  11. use OCP\IL10N;
  12. class SFTP_Key extends Backend {
  13. public function __construct(IL10N $l, RSA $legacyAuth, SFTP $sftpBackend) {
  14. $this
  15. ->setIdentifier('\OC\Files\Storage\SFTP_Key')
  16. ->setStorageClass('\OCA\Files_External\Lib\Storage\SFTP')
  17. ->setText($l->t('SFTP with secret key login'))
  18. ->addParameters([
  19. new DefinitionParameter('host', $l->t('Host')),
  20. (new DefinitionParameter('root', $l->t('Remote subfolder')))
  21. ->setFlag(DefinitionParameter::FLAG_OPTIONAL),
  22. ])
  23. ->addAuthScheme(AuthMechanism::SCHEME_PUBLICKEY)
  24. ->setLegacyAuthMechanism($legacyAuth)
  25. ->deprecateTo($sftpBackend)
  26. ;
  27. }
  28. }