BruteForceProtection.php 653 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. namespace OCP\AppFramework\Http\Attribute;
  8. use Attribute;
  9. /**
  10. * Attribute for controller methods that want to protect passwords, keys, tokens
  11. * or other data against brute force
  12. *
  13. * @since 27.0.0
  14. */
  15. #[Attribute(Attribute::TARGET_METHOD | Attribute::IS_REPEATABLE)]
  16. class BruteForceProtection {
  17. /**
  18. * @since 27.0.0
  19. */
  20. public function __construct(
  21. protected string $action
  22. ) {
  23. }
  24. /**
  25. * @since 27.0.0
  26. */
  27. public function getAction(): string {
  28. return $this->action;
  29. }
  30. }