OpenStackV2.php 1.6 KB

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