TrustedManagerInterface.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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 TrustedManagerInterface
  22. {
  23. const TRUSTED_DEVICE_COOKIE = 'msp_tfa_trusted';
  24. /**
  25. * Rotate secret trust token
  26. * @return boolean
  27. */
  28. public function rotateTrustedDeviceToken();
  29. /**
  30. * Return true if device is trusted
  31. * @return boolean
  32. */
  33. public function isTrustedDevice();
  34. /**
  35. * Revoke trusted device
  36. * @param int $tokenId
  37. * @return bool
  38. * @throws \Magento\Framework\Exception\NoSuchEntityException
  39. */
  40. public function revokeTrustedDevice($tokenId);
  41. /**
  42. * Trust a device
  43. * @param string $providerCode
  44. * @param \Magento\Framework\App\RequestInterface $request
  45. * @return boolean
  46. */
  47. public function handleTrustDeviceRequest($providerCode, \Magento\Framework\App\RequestInterface $request);
  48. }