IToken.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <?php
  2. /**
  3. * @author Christoph Wurst <christoph@owncloud.com>
  4. *
  5. * @copyright Copyright (c) 2016, ownCloud, Inc.
  6. * @license AGPL-3.0
  7. *
  8. * This code is free software: you can redistribute it and/or modify
  9. * it under the terms of the GNU Affero General Public License, version 3,
  10. * as published by the Free Software Foundation.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU Affero General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Affero General Public License, version 3,
  18. * along with this program. If not, see <http://www.gnu.org/licenses/>
  19. *
  20. */
  21. namespace OC\Authentication\Token;
  22. use JsonSerializable;
  23. interface IToken extends JsonSerializable {
  24. const TEMPORARY_TOKEN = 0;
  25. const PERMANENT_TOKEN = 1;
  26. /**
  27. * Get the token ID
  28. *
  29. * @return int
  30. */
  31. public function getId();
  32. /**
  33. * Get the user UID
  34. *
  35. * @return string
  36. */
  37. public function getUID();
  38. /**
  39. * Get the login name used when generating the token
  40. *
  41. * @return string
  42. */
  43. public function getLoginName();
  44. /**
  45. * Get the (encrypted) login password
  46. *
  47. * @return string
  48. */
  49. public function getPassword();
  50. /**
  51. * Get the timestamp of the last password check
  52. *
  53. * @return int
  54. */
  55. public function getLastCheck();
  56. /**
  57. * Get the timestamp of the last password check
  58. *
  59. * @param int $time
  60. */
  61. public function setLastCheck($time);
  62. }