Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ensure JWS serializers only throw InvalidArgumentException #485

Conversation

KampfCaspar
Copy link

Q A
Branch? 3.3.x
Bug fix? yes
New feature? no
Deprecations? no
Tickets
License MIT

SerializerManager tries one serializer after another but expects the individual serializer only to throw InvalidArgumentException in ::unserialize - if any other Exception is thrown, unserialization (and JWS verification) fails directly.

The JSON serializers (global and flattened) try JSON-decoding using JsonConverter. The latter, however, throws a RuntimeException. Therefore, if a later serializer in the SerializerManager is applicable to the token, it's never reached.

This PR encapsulates the call to JsonEncoder and converts the exception to InvalidArgumentException.

Copy link

stale bot commented Dec 15, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Dec 15, 2023
@stale stale bot closed this Jan 7, 2024
@Spomky Spomky reopened this Jan 7, 2024
@stale stale bot removed the wontfix label Jan 7, 2024
@Spomky
Copy link
Member

Spomky commented Feb 1, 2024

Closing in favor of #513

@Spomky Spomky closed this Feb 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants