|
26 | 26 | */ |
27 | 27 | namespace OC\Authentication\Token; |
28 | 28 |
|
29 | | -use JsonSerializable; |
| 29 | +use OCP\Authentication\Token\IToken as OCPIToken; |
30 | 30 |
|
31 | | -interface IToken extends JsonSerializable { |
32 | | - public const TEMPORARY_TOKEN = 0; |
33 | | - public const PERMANENT_TOKEN = 1; |
34 | | - public const WIPE_TOKEN = 2; |
35 | | - public const DO_NOT_REMEMBER = 0; |
36 | | - public const REMEMBER = 1; |
37 | | - |
38 | | - /** |
39 | | - * Get the token ID |
40 | | - * |
41 | | - * @return int |
42 | | - */ |
43 | | - public function getId(): int; |
44 | | - |
45 | | - /** |
46 | | - * Get the user UID |
47 | | - * |
48 | | - * @return string |
49 | | - */ |
50 | | - public function getUID(): string; |
51 | | - |
52 | | - /** |
53 | | - * Get the login name used when generating the token |
54 | | - * |
55 | | - * @return string |
56 | | - */ |
57 | | - public function getLoginName(): string; |
58 | | - |
59 | | - /** |
60 | | - * Get the (encrypted) login password |
61 | | - * |
62 | | - * @return string|null |
63 | | - */ |
64 | | - public function getPassword(); |
65 | | - |
66 | | - /** |
67 | | - * Get the timestamp of the last password check |
68 | | - * |
69 | | - * @return int |
70 | | - */ |
71 | | - public function getLastCheck(): int; |
72 | | - |
73 | | - /** |
74 | | - * Set the timestamp of the last password check |
75 | | - * |
76 | | - * @param int $time |
77 | | - */ |
78 | | - public function setLastCheck(int $time); |
79 | | - |
80 | | - /** |
81 | | - * Get the authentication scope for this token |
82 | | - * |
83 | | - * @return string |
84 | | - */ |
85 | | - public function getScope(): string; |
86 | | - |
87 | | - /** |
88 | | - * Get the authentication scope for this token |
89 | | - * |
90 | | - * @return array |
91 | | - */ |
92 | | - public function getScopeAsArray(): array; |
93 | | - |
94 | | - /** |
95 | | - * Set the authentication scope for this token |
96 | | - * |
97 | | - * @param array $scope |
98 | | - */ |
99 | | - public function setScope($scope); |
100 | | - |
101 | | - /** |
102 | | - * Get the name of the token |
103 | | - * @return string |
104 | | - */ |
105 | | - public function getName(): string; |
106 | | - |
107 | | - /** |
108 | | - * Get the remember state of the token |
109 | | - * |
110 | | - * @return int |
111 | | - */ |
112 | | - public function getRemember(): int; |
113 | | - |
114 | | - /** |
115 | | - * Set the token |
116 | | - * |
117 | | - * @param string $token |
118 | | - */ |
119 | | - public function setToken(string $token); |
120 | | - |
121 | | - /** |
122 | | - * Set the password |
123 | | - * |
124 | | - * @param string $password |
125 | | - */ |
126 | | - public function setPassword(string $password); |
127 | | - |
128 | | - /** |
129 | | - * Set the expiration time of the token |
130 | | - * |
131 | | - * @param int|null $expires |
132 | | - */ |
133 | | - public function setExpires($expires); |
| 31 | +/** |
| 32 | + * @deprecated 28.0.0 use {@see \OCP\Authentication\Token\IToken} instead |
| 33 | + */ |
| 34 | +interface IToken extends OCPIToken { |
134 | 35 | } |
0 commit comments