cduvray / jwt-authorizer

JWT authorization layer for Axum.
MIT License
69 stars 21 forks source link

Changelog: Audience was not checked in versions < 0.14.0 (2024-01-22) #46

Closed lcmgh closed 2 months ago

lcmgh commented 8 months ago

On 0.14 token validation fails with an InvalidAudience error when .validation(Validation::new().aud(&[config.audience])) is not set. Prior 0.14 one had to validate audience on its own and skipping .validation was not a problem.

Would have been helpful if this breaking change were mentioned in the CHANGELOG.

Bromles commented 6 months ago

This was a very unpleasant surprise during the update, especially considering that the error occurs only in runtime.

For my specific use case, I cannot check the audience when validating the token. And, interestingly, the jsonwebtoken crate that this library uses allows to disable this check. But here the validation options do not provide such an opportunity. I really don't want to fork just to add 1 new validation option, but if it doesn't get fixed I'll have to do this

Bromles commented 6 months ago

Made a quick PR to fix this

48