Config.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Integration\Model\Oauth\Token\RequestLog;
  7. use Magento\Framework\App\Config\ReinitableConfigInterface;
  8. /**
  9. * Token request log config.
  10. */
  11. class Config
  12. {
  13. /**
  14. * @var ReinitableConfigInterface
  15. */
  16. private $storeConfig;
  17. /**
  18. * Initialize dependencies.
  19. *
  20. * @param ReinitableConfigInterface $storeConfig
  21. */
  22. public function __construct(ReinitableConfigInterface $storeConfig)
  23. {
  24. $this->storeConfig = $storeConfig;
  25. }
  26. /**
  27. * Get maximum allowed authentication failures count before account is locked.
  28. *
  29. * @return int
  30. */
  31. public function getMaxFailuresCount()
  32. {
  33. return (int)$this->storeConfig->getValue('oauth/authentication_lock/max_failures_count');
  34. }
  35. /**
  36. * Get period of time in seconds after which account will be unlocked.
  37. *
  38. * @return int
  39. */
  40. public function getLockTimeout()
  41. {
  42. return (int)$this->storeConfig->getValue('oauth/authentication_lock/timeout');
  43. }
  44. }