ProviderInterface.php 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. <?php
  2. /**
  3. * MageSpecialist
  4. *
  5. * NOTICE OF LICENSE
  6. *
  7. * This source file is subject to the Open Software License (OSL 3.0)
  8. * that is bundled with this package in the file LICENSE.txt.
  9. * It is also available through the world-wide-web at this URL:
  10. * http://opensource.org/licenses/osl-3.0.php
  11. * If you did not receive a copy of the license and are unable to
  12. * obtain it through the world-wide-web, please send an email
  13. * to info@magespecialist.it so we can send you a copy immediately.
  14. *
  15. * @category MSP
  16. * @package MSP_TwoFactorAuth
  17. * @copyright Copyright (c) 2017 Skeeller srl (http://www.magespecialist.it)
  18. * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
  19. */
  20. namespace MSP\TwoFactorAuth\Api;
  21. interface ProviderInterface
  22. {
  23. /**
  24. * Return true if this provider has been enabled by admin
  25. * @return boolean
  26. */
  27. public function isEnabled();
  28. /**
  29. * Get provider engine
  30. * @return \MSP\TwoFactorAuth\Api\EngineInterface
  31. */
  32. public function getEngine();
  33. /**
  34. * Get provider code
  35. * @return string
  36. */
  37. public function getCode();
  38. /**
  39. * Get provider name
  40. * @return string
  41. */
  42. public function getName();
  43. /**
  44. * Get icon
  45. * @return string
  46. */
  47. public function getIcon();
  48. /**
  49. * Return true if this provider configuration can be reset
  50. * @return boolean
  51. */
  52. public function isResetAllowed();
  53. /**
  54. * Return true if this provider allows trusted devices
  55. * @return boolean
  56. */
  57. public function isTrustedDevicesAllowed();
  58. /**
  59. * Reset provider configuration
  60. * @param int $userId
  61. * @return \MSP\TwoFactorAuth\Api\ProviderInterface
  62. */
  63. public function resetConfiguration($userId);
  64. /**
  65. * Return true if this provider has been configured
  66. * @param int $userId
  67. * @return bool
  68. */
  69. public function isConfigured($userId);
  70. /**
  71. * Return true if current provider has been activated
  72. * @param int $userId
  73. * @return bool
  74. */
  75. public function isActive($userId);
  76. /**
  77. * Activate provider
  78. * @param int $userId
  79. * @return \MSP\TwoFactorAuth\Api\ProviderInterface
  80. */
  81. public function activate($userId);
  82. /**
  83. * Get configure action
  84. * @return string
  85. */
  86. public function getConfigureAction();
  87. /**
  88. * Get auth action
  89. * @return string
  90. */
  91. public function getAuthAction();
  92. /**
  93. * Get allowed extra actions
  94. * @return string[]
  95. */
  96. public function getExtraActions();
  97. }