Add optional self-hosted ALTCHA protection and dependency maintenance
This commit is contained in:
1 parent
3b558409f3
commit
2a2f1d5878
59 files changed
+2648
-12
No files matched your search
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace HGCFVendor\AltchaOrg\Altcha;
|
||||
|
||||
use HGCFVendor\AltchaOrg\Altcha\Algorithm\DeriveKeyInterface;
|
||||
|
||||
class VerifySolutionOptions
|
||||
{
|
||||
public readonly Payload $payload;
|
||||
|
||||
/**
|
||||
* @param array<string, mixed>|Payload|string $payload A `Payload` object, a raw base64-encoded
|
||||
* payload string (as posted by the widget),
|
||||
* or an already-decoded associative array.
|
||||
*/
|
||||
public function __construct(
|
||||
Payload|string|array $payload,
|
||||
public readonly DeriveKeyInterface $algorithm,
|
||||
) {
|
||||
$this->payload = match (true) {
|
||||
$payload instanceof Payload => $payload,
|
||||
\is_string($payload) => Payload::fromBase64($payload),
|
||||
default => Payload::fromArray($payload),
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user