-
-
Notifications
You must be signed in to change notification settings - Fork 452
Expand file tree
/
Copy pathAppCheckWithReplayProtection.php
More file actions
35 lines (31 loc) · 1.22 KB
/
AppCheckWithReplayProtection.php
File metadata and controls
35 lines (31 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
declare(strict_types=1);
namespace Kreait\Firebase\Contract;
use Kreait\Firebase\AppCheck\VerifyAppCheckTokenResponse;
use Kreait\Firebase\Exception;
use Kreait\Firebase\Exception\AppCheck\FailedToVerifyAppCheckReplayProtection;
use Kreait\Firebase\Exception\AppCheck\FailedToVerifyAppCheckToken;
use Kreait\Firebase\Exception\AppCheck\InvalidAppCheckToken;
use SensitiveParameter;
/**
* Transitional contract for replay protection support.
*
* This interface exists to provide replay protection without changing the
* existing AppCheck::verifyToken() signature in a backwards-incompatible way.
* In a future major release, replay protection should be moved into
* AppCheck::verifyToken() as an additional argument/options parameter.
*/
interface AppCheckWithReplayProtection
{
/**
* Verifies an App Check token and consumes it for replay protection.
*
* @param non-empty-string $appCheckToken
*
* @throws InvalidAppCheckToken
* @throws FailedToVerifyAppCheckToken
* @throws FailedToVerifyAppCheckReplayProtection
* @throws Exception\FirebaseException
*/
public function verifyTokenWithReplayProtection(#[SensitiveParameter] string $appCheckToken): VerifyAppCheckTokenResponse;
}