Skip to content

Commit 015e995

Browse files
committed
chore: add firebase/php-jwt as dependency
The nextcloud/server PR nextcloud/server#60136 implements RFC9421 http-signatures. Rather than implementing some of the JWK primitives our selfs, we can lean on firebase/php-jwt and that is this commit adds that dependency here. Signed-off-by: Micke Nordin <kano@sunet.se>
1 parent 5d09a7f commit 015e995

16 files changed

Lines changed: 1706 additions & 1 deletion

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
"deepdiver1975/tarstreamer": "^2.1.0",
2828
"doctrine/dbal": "^3.10.4",
2929
"egulias/email-validator": "^4.0.4",
30+
"firebase/php-jwt": "^7.0",
3031
"fusonic/opengraph": "^3.0.0",
3132
"giggsey/libphonenumber-for-php-lite": "^9.0.9",
3233
"guzzlehttp/guzzle": "^7.10.0",

composer.lock

Lines changed: 65 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

composer/autoload_classmap.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -963,6 +963,14 @@
963963
'Egulias\\EmailValidator\\Warning\\QuotedString' => $vendorDir . '/egulias/email-validator/src/Warning/QuotedString.php',
964964
'Egulias\\EmailValidator\\Warning\\TLD' => $vendorDir . '/egulias/email-validator/src/Warning/TLD.php',
965965
'Egulias\\EmailValidator\\Warning\\Warning' => $vendorDir . '/egulias/email-validator/src/Warning/Warning.php',
966+
'Firebase\\JWT\\BeforeValidException' => $vendorDir . '/firebase/php-jwt/src/BeforeValidException.php',
967+
'Firebase\\JWT\\CachedKeySet' => $vendorDir . '/firebase/php-jwt/src/CachedKeySet.php',
968+
'Firebase\\JWT\\ExpiredException' => $vendorDir . '/firebase/php-jwt/src/ExpiredException.php',
969+
'Firebase\\JWT\\JWK' => $vendorDir . '/firebase/php-jwt/src/JWK.php',
970+
'Firebase\\JWT\\JWT' => $vendorDir . '/firebase/php-jwt/src/JWT.php',
971+
'Firebase\\JWT\\JWTExceptionWithPayloadInterface' => $vendorDir . '/firebase/php-jwt/src/JWTExceptionWithPayloadInterface.php',
972+
'Firebase\\JWT\\Key' => $vendorDir . '/firebase/php-jwt/src/Key.php',
973+
'Firebase\\JWT\\SignatureInvalidException' => $vendorDir . '/firebase/php-jwt/src/SignatureInvalidException.php',
966974
'Fusonic\\OpenGraph\\Consumer' => $vendorDir . '/fusonic/opengraph/src/Consumer.php',
967975
'Fusonic\\OpenGraph\\Elements\\Audio' => $vendorDir . '/fusonic/opengraph/src/Elements/Audio.php',
968976
'Fusonic\\OpenGraph\\Elements\\ElementBase' => $vendorDir . '/fusonic/opengraph/src/Elements/ElementBase.php',

composer/autoload_psr4.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
'GuzzleHttp\\Promise\\' => array($vendorDir . '/guzzlehttp/promises/src'),
7878
'GuzzleHttp\\' => array($vendorDir . '/guzzlehttp/guzzle/src'),
7979
'Fusonic\\OpenGraph\\' => array($vendorDir . '/fusonic/opengraph/src'),
80+
'Firebase\\JWT\\' => array($vendorDir . '/firebase/php-jwt/src'),
8081
'Egulias\\EmailValidator\\' => array($vendorDir . '/egulias/email-validator/src'),
8182
'Doctrine\\Deprecations\\' => array($vendorDir . '/doctrine/deprecations/src'),
8283
'Doctrine\\DBAL\\' => array($vendorDir . '/doctrine/dbal/src'),

composer/autoload_static.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ class ComposerStaticInit2f23f73bc0cc116b4b1eee1521aa8652
162162
'F' =>
163163
array (
164164
'Fusonic\\OpenGraph\\' => 18,
165+
'Firebase\\JWT\\' => 13,
165166
),
166167
'E' =>
167168
array (
@@ -475,6 +476,10 @@ class ComposerStaticInit2f23f73bc0cc116b4b1eee1521aa8652
475476
array (
476477
0 => __DIR__ . '/..' . '/fusonic/opengraph/src',
477478
),
479+
'Firebase\\JWT\\' =>
480+
array (
481+
0 => __DIR__ . '/..' . '/firebase/php-jwt/src',
482+
),
478483
'Egulias\\EmailValidator\\' =>
479484
array (
480485
0 => __DIR__ . '/..' . '/egulias/email-validator/src',
@@ -1495,6 +1500,14 @@ class ComposerStaticInit2f23f73bc0cc116b4b1eee1521aa8652
14951500
'Egulias\\EmailValidator\\Warning\\QuotedString' => __DIR__ . '/..' . '/egulias/email-validator/src/Warning/QuotedString.php',
14961501
'Egulias\\EmailValidator\\Warning\\TLD' => __DIR__ . '/..' . '/egulias/email-validator/src/Warning/TLD.php',
14971502
'Egulias\\EmailValidator\\Warning\\Warning' => __DIR__ . '/..' . '/egulias/email-validator/src/Warning/Warning.php',
1503+
'Firebase\\JWT\\BeforeValidException' => __DIR__ . '/..' . '/firebase/php-jwt/src/BeforeValidException.php',
1504+
'Firebase\\JWT\\CachedKeySet' => __DIR__ . '/..' . '/firebase/php-jwt/src/CachedKeySet.php',
1505+
'Firebase\\JWT\\ExpiredException' => __DIR__ . '/..' . '/firebase/php-jwt/src/ExpiredException.php',
1506+
'Firebase\\JWT\\JWK' => __DIR__ . '/..' . '/firebase/php-jwt/src/JWK.php',
1507+
'Firebase\\JWT\\JWT' => __DIR__ . '/..' . '/firebase/php-jwt/src/JWT.php',
1508+
'Firebase\\JWT\\JWTExceptionWithPayloadInterface' => __DIR__ . '/..' . '/firebase/php-jwt/src/JWTExceptionWithPayloadInterface.php',
1509+
'Firebase\\JWT\\Key' => __DIR__ . '/..' . '/firebase/php-jwt/src/Key.php',
1510+
'Firebase\\JWT\\SignatureInvalidException' => __DIR__ . '/..' . '/firebase/php-jwt/src/SignatureInvalidException.php',
14981511
'Fusonic\\OpenGraph\\Consumer' => __DIR__ . '/..' . '/fusonic/opengraph/src/Consumer.php',
14991512
'Fusonic\\OpenGraph\\Elements\\Audio' => __DIR__ . '/..' . '/fusonic/opengraph/src/Elements/Audio.php',
15001513
'Fusonic\\OpenGraph\\Elements\\ElementBase' => __DIR__ . '/..' . '/fusonic/opengraph/src/Elements/ElementBase.php',

composer/installed.json

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -859,6 +859,73 @@
859859
],
860860
"install-path": "../egulias/email-validator"
861861
},
862+
{
863+
"name": "firebase/php-jwt",
864+
"version": "v7.0.5",
865+
"version_normalized": "7.0.5.0",
866+
"source": {
867+
"type": "git",
868+
"url": "https://github.com/googleapis/php-jwt.git",
869+
"reference": "47ad26bab5e7c70ae8a6f08ed25ff83631121380"
870+
},
871+
"dist": {
872+
"type": "zip",
873+
"url": "https://api.github.com/repos/googleapis/php-jwt/zipball/47ad26bab5e7c70ae8a6f08ed25ff83631121380",
874+
"reference": "47ad26bab5e7c70ae8a6f08ed25ff83631121380",
875+
"shasum": ""
876+
},
877+
"require": {
878+
"php": "^8.0"
879+
},
880+
"require-dev": {
881+
"guzzlehttp/guzzle": "^7.4",
882+
"phpfastcache/phpfastcache": "^9.2",
883+
"phpspec/prophecy-phpunit": "^2.0",
884+
"phpunit/phpunit": "^9.5",
885+
"psr/cache": "^2.0||^3.0",
886+
"psr/http-client": "^1.0",
887+
"psr/http-factory": "^1.0"
888+
},
889+
"suggest": {
890+
"ext-sodium": "Support EdDSA (Ed25519) signatures",
891+
"paragonie/sodium_compat": "Support EdDSA (Ed25519) signatures when libsodium is not present"
892+
},
893+
"time": "2026-04-01T20:38:03+00:00",
894+
"type": "library",
895+
"installation-source": "dist",
896+
"autoload": {
897+
"psr-4": {
898+
"Firebase\\JWT\\": "src"
899+
}
900+
},
901+
"notification-url": "https://packagist.org/downloads/",
902+
"license": [
903+
"BSD-3-Clause"
904+
],
905+
"authors": [
906+
{
907+
"name": "Neuman Vong",
908+
"email": "neuman+pear@twilio.com",
909+
"role": "Developer"
910+
},
911+
{
912+
"name": "Anant Narayanan",
913+
"email": "anant@php.net",
914+
"role": "Developer"
915+
}
916+
],
917+
"description": "A simple library to encode and decode JSON Web Tokens (JWT) in PHP. Should conform to the current spec.",
918+
"homepage": "https://github.com/firebase/php-jwt",
919+
"keywords": [
920+
"jwt",
921+
"php"
922+
],
923+
"support": {
924+
"issues": "https://github.com/googleapis/php-jwt/issues",
925+
"source": "https://github.com/googleapis/php-jwt/tree/v7.0.5"
926+
},
927+
"install-path": "../firebase/php-jwt"
928+
},
862929
{
863930
"name": "fusonic/opengraph",
864931
"version": "v3.0.0",

composer/installed.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,15 @@
118118
'aliases' => array(),
119119
'dev_requirement' => false,
120120
),
121+
'firebase/php-jwt' => array(
122+
'pretty_version' => 'v7.0.5',
123+
'version' => '7.0.5.0',
124+
'reference' => '47ad26bab5e7c70ae8a6f08ed25ff83631121380',
125+
'type' => 'library',
126+
'install_path' => __DIR__ . '/../firebase/php-jwt',
127+
'aliases' => array(),
128+
'dev_requirement' => false,
129+
),
121130
'fusonic/opengraph' => array(
122131
'pretty_version' => 'v3.0.0',
123132
'version' => '3.0.0.0',

firebase/php-jwt/LICENSE

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
Copyright (c) 2011, Neuman Vong
2+
3+
All rights reserved.
4+
5+
Redistribution and use in source and binary forms, with or without
6+
modification, are permitted provided that the following conditions are met:
7+
8+
* Redistributions of source code must retain the above copyright
9+
notice, this list of conditions and the following disclaimer.
10+
11+
* Redistributions in binary form must reproduce the above
12+
copyright notice, this list of conditions and the following
13+
disclaimer in the documentation and/or other materials provided
14+
with the distribution.
15+
16+
* Neither the name of the copyright holder nor the names of other
17+
contributors may be used to endorse or promote products derived
18+
from this software without specific prior written permission.
19+
20+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
3+
namespace Firebase\JWT;
4+
5+
class BeforeValidException extends \UnexpectedValueException implements JWTExceptionWithPayloadInterface
6+
{
7+
private object $payload;
8+
9+
public function setPayload(object $payload): void
10+
{
11+
$this->payload = $payload;
12+
}
13+
14+
public function getPayload(): object
15+
{
16+
return $this->payload;
17+
}
18+
}

0 commit comments

Comments
 (0)