Skip to content

Commit

Permalink
Merge pull request #32 from andrew-broberg-five9/support-caching-keys
Browse files Browse the repository at this point in the history
feat: Add support for caching of certificates
  • Loading branch information
marickvantuil authored Mar 27, 2024
2 parents 0acaafa + 6e1ab2e commit 95a2457
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
4 changes: 3 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
"google/cloud-scheduler": "^1.6",
"phpseclib/phpseclib": "^3.0",
"google/auth": "^v1.29.1",
"laravel/framework": "^10.0|^11.0"
"laravel/framework": "^10.0|^11.0",
"php": "^8.1",
"symfony/cache": "^6.4"
},
"require-dev": {
"mockery/mockery": "^1.5",
Expand Down
9 changes: 8 additions & 1 deletion src/OpenIdVerificatorConcrete.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,20 @@

class OpenIdVerificatorConcrete extends Facade
{
private AccessToken $accessToken;

public function __construct(AccessToken $accessToken)
{
$this->accessToken = $accessToken;
}

public function verify(?string $token, array $config): void
{
if (! $token) {
throw new CloudSchedulerException('Missing [Authorization] header');
}

$payload = (new AccessToken())->verify(
$payload = $this->accessToken->verify(
$token,
[
'audience' => config('cloud-scheduler.app_url'),
Expand Down

0 comments on commit 95a2457

Please sign in to comment.