Skip to content

Add web-token/jwt-framework ^4.0 support#219

Open
amitsamtani wants to merge 1 commit intoCyberSource:masterfrom
amitsamtani:feature/jwt-framework-4x-support
Open

Add web-token/jwt-framework ^4.0 support#219
amitsamtani wants to merge 1 commit intoCyberSource:masterfrom
amitsamtani:feature/jwt-framework-4x-support

Conversation

@amitsamtani
Copy link
Copy Markdown

Summary

This PR adds support for web-token/jwt-framework v4.x, which is required for compatibility with Symfony 8 and Laravel 13.

Currently, the SDK constrains web-token/jwt-framework to ^2.2.11|^3.3.5. Since v3.x depends on Symfony <8 components, any project using Laravel 13 (which requires Symfony 8) cannot install cybersource/rest-client-php due to dependency conflicts.

Changes

composer.json

  • Widened constraint: ^2.2.11|^3.3.5^2.2.11|^3.3.5|^4.0

lib/Authentication/Util/MLEUtility.php

  • Removed CompressionMethodManager and Deflate imports and usage (removed in jwt-framework 4.0 per RFC 8725 Section 3.6)
  • Simplified JWEBuilder constructor to accept a single AlgorithmManager (4.0 API)

lib/Authentication/Util/JWE/JWEUtility.php

  • Same compression removal and constructor simplification for JWEDecrypter in both decryptJWEUsingPEM() and decryptJWEUsingPrivateKey()
  • Merged separate key encryption and content encryption AlgorithmManager instances into one (4.0 API)

Why

  • web-token/jwt-framework 4.0 removed compression support following RFC 8725 security recommendations
  • JWEBuilder and JWEDecrypter constructors were simplified to accept a single AlgorithmManager instead of separate managers
  • These are the only breaking changes that affect this SDK

Testing

  • Verified dependency resolution succeeds with web-token/jwt-framework 4.1.4 + Symfony 8 + Laravel 13
  • Existing SDK behavior is preserved — encryption/decryption logic is unchanged, only the framework API surface was updated

…ompatibility

The jwt-framework 4.0 removed compression classes (CompressionMethodManager,
Deflate) per RFC 8725 Section 3.6, and simplified JWEBuilder/JWEDecrypter
constructors to accept a single AlgorithmManager.

Changes:
- Remove CompressionMethodManager and Deflate usage from MLEUtility and JWEUtility
- Simplify JWEBuilder/JWEDecrypter constructors to single AlgorithmManager
- Widen composer.json constraint to ^2.2.11|^3.3.5|^4.0

This unblocks Laravel 13 which requires Symfony 8 components.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant