|
ILIAS
trunk Revision v13.0_alpha-62-g3b72d83f2e5
|
Verifies that a request was sent by the WOPI client, see https://learn.microsoft.com/en-us/microsoft-365/cloud-storage-partner-program/online/scenarios/proofkeys. More...
Collaboration diagram for ILIAS\WOPI\Handler\ProofValidator:Public Member Functions | |
| __construct (private ?ProofKeys $keys, ?\Closure $clock=null) | |
| withKeys (ProofKeys $keys) | |
| isValid (string $access_token, string $url, ?string $timestamp, ?string $proof, ?string $old_proof) | |
Static Public Member Functions | |
| static | expected (string $access_token, string $url, int $timestamp) |
Private Member Functions | |
| verify (string $expected, string $signature, ProofKey $key) | |
Private Attributes | |
| const | TICKS_AT_UNIX_EPOCH = 621_355_968_000_000_000 |
| X-WOPI-TimeStamp counts the 100 nanosecond intervals since 0001-01-01 (.NET ticks). More... | |
| const | TICKS_PER_SECOND = 10_000_000 |
| const | MAX_AGE = 20 * 60 |
| Closure | $clock |
Verifies that a request was sent by the WOPI client, see https://learn.microsoft.com/en-us/microsoft-365/cloud-storage-partner-program/online/scenarios/proofkeys.
The client signs the access token, the URL and a timestamp of each request with its private key. Without proof keys in the discovery there is nothing to verify against, every request is accepted then.
Definition at line 36 of file ProofValidator.php.
| ILIAS\WOPI\Handler\ProofValidator::__construct | ( | private ?ProofKeys | $keys, |
| ?\Closure | $clock = null |
||
| ) |
Closure(): int|null $clock returns the current unix timestamp, for testing
Definition at line 53 of file ProofValidator.php.
References ILIAS\WOPI\Handler\ProofValidator\$clock.
|
static |
Definition at line 99 of file ProofValidator.php.
References $timestamp.
Referenced by ILIAS\WOPI\Handler\ProofValidatorTest\sign(), ILIAS\WOPI\Handler\RequestHandlerTest\signedHeaders(), and ILIAS\WOPI\Handler\RequestHandlerTest\testRequestWithValidProofIsAccepted().
Here is the caller graph for this function:| ILIAS\WOPI\Handler\ProofValidator::isValid | ( | string | $access_token, |
| string | $url, | ||
| ?string | $timestamp, | ||
| ?string | $proof, | ||
| ?string | $old_proof | ||
| ) |
| string | $url | the URL the client requested, including the query string |
Definition at line 71 of file ProofValidator.php.
Referenced by ILIAS\WOPI\Handler\RequestHandler\hasValidProof().
Here is the caller graph for this function:
|
private |
Definition at line 108 of file ProofValidator.php.
References ILIAS\WOPI\Discovery\ProofKey\toPem().
Here is the call graph for this function:| ILIAS\WOPI\Handler\ProofValidator::withKeys | ( | ProofKeys | $keys | ) |
Definition at line 60 of file ProofValidator.php.
|
private |
Definition at line 48 of file ProofValidator.php.
Referenced by ILIAS\WOPI\Handler\ProofValidator\__construct().
|
private |
Definition at line 43 of file ProofValidator.php.
|
private |
X-WOPI-TimeStamp counts the 100 nanosecond intervals since 0001-01-01 (.NET ticks).
Definition at line 41 of file ProofValidator.php.
|
private |
Definition at line 42 of file ProofValidator.php.