Add image captcha expiration policy configuration
This commit is contained in:
parent
ab957226d5
commit
b2aa5ed6a2
2 changed files with 22 additions and 0 deletions
|
@ -129,6 +129,10 @@
|
||||||
// The amount of time in seconds it takes before a session is considered expired due to inactivity
|
// The amount of time in seconds it takes before a session is considered expired due to inactivity
|
||||||
// Default: 12hours
|
// Default: 12hours
|
||||||
$config->setDefault('policies.session_inactivity_expires', 43200);
|
$config->setDefault('policies.session_inactivity_expires', 43200);
|
||||||
|
// The amount of time in seconds it takes before an image captcha is considered expired due to lack of
|
||||||
|
// answer within the time-frame that the captcha was generated
|
||||||
|
// If expired; client is expected to request for a new captcha which will generate a new random answer.
|
||||||
|
$config->setDefault('policies.image_captcha_expires', 300);
|
||||||
|
|
||||||
// Storage configuration
|
// Storage configuration
|
||||||
$config->setDefault('storage.path', '/etc/socialbox'); // The main path for file storage
|
$config->setDefault('storage.path', '/etc/socialbox'); // The main path for file storage
|
||||||
|
|
|
@ -6,14 +6,18 @@
|
||||||
{
|
{
|
||||||
private int $maxSigningKeys;
|
private int $maxSigningKeys;
|
||||||
private int $sessionInactivityExpires;
|
private int $sessionInactivityExpires;
|
||||||
|
private int $imageCaptchaExpires;
|
||||||
|
|
||||||
public function __construct(array $data)
|
public function __construct(array $data)
|
||||||
{
|
{
|
||||||
$this->maxSigningKeys = $data['max_signing_keys'];
|
$this->maxSigningKeys = $data['max_signing_keys'];
|
||||||
$this->sessionInactivityExpires = $data['session_inactivity_expires'];
|
$this->sessionInactivityExpires = $data['session_inactivity_expires'];
|
||||||
|
$this->imageCaptchaExpires = $data['image_captcha_expires'];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Returns the maximum amount of signing keys a peer can register with the server at once
|
||||||
|
*
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
public function getMaxSigningKeys(): int
|
public function getMaxSigningKeys(): int
|
||||||
|
@ -22,10 +26,24 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Returns the maximum amount of seconds before the session is considered expired due to inactivity
|
||||||
|
*
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
public function getSessionInactivityExpires(): int
|
public function getSessionInactivityExpires(): int
|
||||||
{
|
{
|
||||||
return $this->sessionInactivityExpires;
|
return $this->sessionInactivityExpires;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the maximum amount of seconds before a captcha is considered expired due to the amount of time
|
||||||
|
* that has passed since the answer was generated, if a user fails to answer the captcha during the time
|
||||||
|
* period then the user must request for a new captcha with a new answer.
|
||||||
|
*
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
public function getImageCaptchaExpires(): int
|
||||||
|
{
|
||||||
|
return $this->imageCaptchaExpires;
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Add table
Reference in a new issue