Rev 1300 | Rev 1303 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1300 | Rev 1301 | ||
---|---|---|---|
Line 21... | Line 21... | ||
21 | 21 | ||
22 | // phpcs:disable PSR1.Files.SideEffects |
22 | // phpcs:disable PSR1.Files.SideEffects |
23 | \defined('INSIDE_OIDPLUS') or die; |
23 | \defined('INSIDE_OIDPLUS') or die; |
24 | // phpcs:enable PSR1.Files.SideEffects |
24 | // phpcs:enable PSR1.Files.SideEffects |
25 | 25 | ||
26 | class OIDplusAuthContentStoreJWT extends OIDplusAuthContentStoreDummy { |
26 | class OIDplusAuthContentStoreJWT extends OIDplusAuthContentStore { |
27 | 27 | ||
28 | /** |
28 | /** |
29 | * Cookie name for the JWT auth token |
29 | * Cookie name for the JWT auth token |
30 | */ |
30 | */ |
31 | const COOKIE_NAME = 'OIDPLUS_AUTH_JWT'; |
31 | const COOKIE_NAME = 'OIDPLUS_AUTH_JWT'; |
Line 213... | Line 213... | ||
213 | } |
213 | } |
214 | 214 | ||
215 | // Override abstract functions |
215 | // Override abstract functions |
216 | 216 | ||
217 | /** |
217 | /** |
- | 218 | * @var array |
|
- | 219 | */ |
|
- | 220 | protected $content = array(); |
|
- | 221 | ||
- | 222 | /** |
|
- | 223 | * @param string $name |
|
- | 224 | * @param mixed|null $default |
|
- | 225 | * @return mixed|null |
|
- | 226 | */ |
|
- | 227 | public function getValue(string $name, $default = NULL) { |
|
- | 228 | return $this->content[$name] ?? $default; |
|
- | 229 | } |
|
- | 230 | ||
- | 231 | /** |
|
- | 232 | * @param string $name |
|
- | 233 | * @param mixed $value |
|
- | 234 | * @return void |
|
- | 235 | */ |
|
- | 236 | public function setValue(string $name, $value) { |
|
- | 237 | $this->content[$name] = $value; |
|
- | 238 | } |
|
- | 239 | ||
- | 240 | /** |
|
- | 241 | * @param string $name |
|
- | 242 | * @return bool |
|
- | 243 | */ |
|
- | 244 | public function exists(string $name): bool { |
|
- | 245 | return isset($this->content[$name]); |
|
- | 246 | } |
|
- | 247 | ||
- | 248 | /** |
|
- | 249 | * @param string $name |
|
- | 250 | * @return void |
|
- | 251 | */ |
|
- | 252 | public function delete(string $name) { |
|
- | 253 | unset($this->content[$name]); |
|
- | 254 | } |
|
- | 255 | ||
- | 256 | /** |
|
218 | * @return void |
257 | * @return void |
219 | */ |
258 | */ |
220 | public function activate() { |
259 | public function activate() { |
221 | // Send cookie at the end of the HTTP request, in case there are multiple activate() calls |
260 | // Send cookie at the end of the HTTP request, in case there are multiple activate() calls |
222 | OIDplus::register_shutdown_function(array($this,'activateNow')); |
261 | OIDplus::register_shutdown_function(array($this,'activateNow')); |