<?php declare(strict_types=1); namespace Kreait\Firebase; use Kreait\Firebase\AppCheck\ApiClient; use Kreait\Firebase\AppCheck\AppCheckToken; use Kreait\Firebase\AppCheck\AppCheckTokenGenerator; use Kreait\Firebase\AppCheck\AppCheckTokenOptions; use Kreait\Firebase\AppCheck\AppCheckTokenVerifier; use Kreait\Firebase\AppCheck\VerifyAppCheckTokenResponse; use function is_array; /** * @internal */ final class AppCheck implements Contract\AppCheck { public function __construct( private readonly ApiClient $client, private readonly AppCheckTokenGenerator $tokenGenerator, private readonly AppCheckTokenVerifier $tokenVerifier, ) { } public function createToken(string $appId, $options = null): AppCheckToken { if (is_array($options)) { $options = AppCheckTokenOptions::fromArray($options); } $customToken = $this->tokenGenerator->createCustomToken($appId, $options); $result = $this->client->exchangeCustomToken($appId, $customToken); return AppCheckToken::fromArray($result); } public function verifyToken(string $appCheckToken): VerifyAppCheckTokenResponse { $decodedToken = $this->tokenVerifier->verifyToken($appCheckToken); return new VerifyAppCheckTokenResponse($decodedToken->app_id, $decodedToken); } }
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
AppCheck | Folder | 0755 |
|
|
Auth | Folder | 0755 |
|
|
Contract | Folder | 0755 |
|
|
Database | Folder | 0755 |
|
|
DynamicLink | Folder | 0755 |
|
|
Exception | Folder | 0755 |
|
|
Http | Folder | 0755 |
|
|
Messaging | Folder | 0755 |
|
|
RemoteConfig | Folder | 0755 |
|
|
Request | Folder | 0755 |
|
|
Util | Folder | 0755 |
|
|
Value | Folder | 0755 |
|
|
AppCheck.php | File | 1.32 KB | 0644 |
|
Auth.php | File | 22.53 KB | 0644 |
|
Database.php | File | 2.2 KB | 0644 |
|
DynamicLink.php | File | 2.04 KB | 0644 |
|
DynamicLinks.php | File | 5.26 KB | 0644 |
|
Factory.php | File | 20.57 KB | 0644 |
|
Firestore.php | File | 558 B | 0644 |
|
Messaging.php | File | 7.69 KB | 0644 |
|
RemoteConfig.php | File | 3.52 KB | 0644 |
|
Request.php | File | 131 B | 0644 |
|
Storage.php | File | 1.18 KB | 0644 |
|
Util.php | File | 1.55 KB | 0644 |
|