Skip to content

Commit

Permalink
Fix default values in WebToken services when encryption disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
NeuralClone committed Jun 6, 2024
1 parent b20c4ae commit a198076
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions Resources/config/web_token_issuance.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
<argument type="service" id="Jose\Bundle\JoseFramework\Services\JWEBuilderFactory" on-invalid="null" />
<argument /> <!-- Signature algorithm -->
<argument /> <!-- Signature key -->
<argument /> <!-- Key encryption algorithm -->
<argument /> <!-- Content encryption algorithm -->
<argument /> <!-- Encryption key -->
<argument>null</argument> <!-- Key encryption algorithm -->
<argument>null</argument> <!-- Content encryption algorithm -->
<argument>null</argument> <!-- Encryption key -->
</service>
</services>
</container>
6 changes: 3 additions & 3 deletions Resources/config/web_token_verification.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
<argument type="service" id="Jose\Bundle\JoseFramework\Services\JWELoaderFactory" on-invalid="null" />
<argument type="service" id="Jose\Bundle\JoseFramework\Services\ClaimCheckerManagerFactory" />
<argument type="collection" /> <!-- Claim checkers -->
<argument type="collection"/> <!-- JWS header checkers -->
<argument type="collection"/> <!-- Mandatory claims -->
<argument type="collection" /> <!-- JWS header checkers -->
<argument type="collection" /> <!-- Mandatory claims -->
<argument type="collection" /> <!-- Allowed signature algorithms -->
<argument /> <!-- Signature keyset -->
<argument on-invalid="null" /> <!-- Continue on decryption failure -->
<argument type="collection" /> <!-- JWE header checkers -->
<argument type="collection" /> <!-- Allowed key encryption algorithms -->
<argument type="collection" /> <!-- Allowed content encryption algorithms -->
<argument on-invalid="null" /> <!-- Encryption keyset -->
<argument>null</argument> <!-- Encryption keyset -->
</service>
<service id="lexik_jwt_authentication.web_token.iat_validator" class="Jose\Component\Checker\IssuedAtChecker" public="false">
<argument>%lexik_jwt_authentication.clock_skew%</argument>
Expand Down
2 changes: 1 addition & 1 deletion Services/WebToken/AccessTokenLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function __construct(
?string $encryptionKeyset
) {
$this->jwsLoader = $jwsLoaderFactory->create(['jws_compact'], $signatureAlgorithms, $jwsHeaderChecker);
if ($jweLoaderFactory !== null && $keyEncryptionAlgorithms !== null && $contentEncryptionAlgorithms !== null && $jweHeaderChecker !== null) {
if ($jweLoaderFactory !== null && $keyEncryptionAlgorithms !== [] && $contentEncryptionAlgorithms !== [] && $jweHeaderChecker !== []) {
$this->jweLoader = $jweLoaderFactory->create(['jwe_compact'], array_merge($keyEncryptionAlgorithms, $contentEncryptionAlgorithms), null, null, $jweHeaderChecker);
$this->continueOnDecryptionFailure = $continueOnDecryptionFailure;
}
Expand Down

0 comments on commit a198076

Please sign in to comment.