Add OTP support with implementation for creation, deletion, and verification.
This commit is contained in:
parent
d9c8208310
commit
866bb90f2a
8 changed files with 572 additions and 28 deletions
|
@ -7,6 +7,11 @@
|
|||
private bool $displayInternalExceptions;
|
||||
private int $resolvedServersTtl;
|
||||
private int $captchaTtl;
|
||||
private int $otpSecretKeyLength;
|
||||
private int $otpTimeStep;
|
||||
private int $otpDigits;
|
||||
private string $otpHashAlgorithm;
|
||||
private int $otpWindow;
|
||||
|
||||
/**
|
||||
* Constructor method for initializing class properties.
|
||||
|
@ -20,6 +25,11 @@
|
|||
$this->displayInternalExceptions = $data['display_internal_exceptions'];
|
||||
$this->resolvedServersTtl = $data['resolved_servers_ttl'];
|
||||
$this->captchaTtl = $data['captcha_ttl'];
|
||||
$this->otpSecretKeyLength = $data['otp_secret_key_length'];
|
||||
$this->otpTimeStep = $data['otp_time_step'];
|
||||
$this->otpDigits = $data['otp_digits'];
|
||||
$this->otpHashAlgorithm = $data['otp_hash_algorithm'];
|
||||
$this->otpWindow = $data['otp_window'];
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -52,4 +62,53 @@
|
|||
return $this->captchaTtl;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the length of the secret key used for OTP generation.
|
||||
*
|
||||
* @return int The length of the secret key used for OTP generation.
|
||||
*/
|
||||
public function getOtpSecretKeyLength(): int
|
||||
{
|
||||
return $this->otpSecretKeyLength;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the time step value for OTP generation.
|
||||
*
|
||||
* @return int The time step value for OTP generation.
|
||||
*/
|
||||
public function getOtpTimeStep(): int
|
||||
{
|
||||
return $this->otpTimeStep;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the number of digits in the OTP.
|
||||
*
|
||||
* @return int The number of digits in the OTP.
|
||||
*/
|
||||
public function getOtpDigits(): int
|
||||
{
|
||||
return $this->otpDigits;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the hash algorithm used for OTP generation.
|
||||
*
|
||||
* @return string The hash algorithm used for OTP generation.
|
||||
*/
|
||||
public function getOtpHashAlgorithm(): string
|
||||
{
|
||||
return $this->otpHashAlgorithm;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the window value for OTP generation.
|
||||
*
|
||||
* @return int The window value for OTP generation.
|
||||
*/
|
||||
public function getOtpWindow(): int
|
||||
{
|
||||
return $this->otpWindow;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue