OpenStackV3.php 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * @copyright Copyright (c) 2018 Robin Appelman <robin@icewind.nl>
  5. *
  6. * @author Julien Lutran <julien.lutran@corp.ovh.com>
  7. * @author Robin Appelman <robin@icewind.nl>
  8. * @author Robin McCorkell <robin@mccorkell.me.uk>
  9. * @author Roeland Jago Douma <roeland@famdouma.nl>
  10. *
  11. * @license GNU AGPL version 3 or any later version
  12. *
  13. * This program is free software: you can redistribute it and/or modify
  14. * it under the terms of the GNU Affero General Public License as
  15. * published by the Free Software Foundation, either version 3 of the
  16. * License, or (at your option) any later version.
  17. *
  18. * This program is distributed in the hope that it will be useful,
  19. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  20. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  21. * GNU Affero General Public License for more details.
  22. *
  23. * You should have received a copy of the GNU Affero General Public License
  24. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  25. *
  26. */
  27. namespace OCA\Files_External\Lib\Auth\OpenStack;
  28. use OCA\Files_External\Lib\Auth\AuthMechanism;
  29. use OCA\Files_External\Lib\DefinitionParameter;
  30. use OCP\IL10N;
  31. /**
  32. * OpenStack Keystone authentication
  33. */
  34. class OpenStackV3 extends AuthMechanism {
  35. public function __construct(IL10N $l) {
  36. $this
  37. ->setIdentifier('openstack::openstackv3')
  38. ->setScheme(self::SCHEME_OPENSTACK)
  39. ->setText($l->t('OpenStack v3'))
  40. ->addParameters([
  41. new DefinitionParameter('user', $l->t('Username')),
  42. new DefinitionParameter('domain', $l->t('Domain')),
  43. (new DefinitionParameter('password', $l->t('Password')))
  44. ->setType(DefinitionParameter::VALUE_PASSWORD),
  45. new DefinitionParameter('tenant', $l->t('Tenant name')),
  46. new DefinitionParameter('url', $l->t('Identity endpoint URL'))
  47. ])
  48. ;
  49. }
  50. }