AccessKey.php 871 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\Auth\AmazonS3;
  8. use OCA\Files_External\Lib\Auth\AuthMechanism;
  9. use OCA\Files_External\Lib\DefinitionParameter;
  10. use OCP\IL10N;
  11. /**
  12. * Amazon S3 access key authentication
  13. */
  14. class AccessKey extends AuthMechanism {
  15. public const SCHEME_AMAZONS3_ACCESSKEY = 'amazons3_accesskey';
  16. public function __construct(IL10N $l) {
  17. $this
  18. ->setIdentifier('amazons3::accesskey')
  19. ->setScheme(self::SCHEME_AMAZONS3_ACCESSKEY)
  20. ->setText($l->t('Access key'))
  21. ->addParameters([
  22. new DefinitionParameter('key', $l->t('Access key')),
  23. (new DefinitionParameter('secret', $l->t('Secret key')))
  24. ->setType(DefinitionParameter::VALUE_PASSWORD),
  25. ]);
  26. }
  27. }