cduvray / jwt-authorizer

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

Fix aud validation #48

Open Bromles opened 5 months ago

Bromles commented 5 months ago

Currently, actual behavior does not match the docs.

For Validation's field aud it says: "If it contains a value, the validation will check that the aud claim value is in the values provided.". Reading this, I assume that it will skip validation of aud claim if this option is None

But in reality, it will fail for any token if the aud is None (because of validation logic inside jsonwebtoken crate)

This PR fixes it by setting an appropriate option validate_aud for validation options of jsonwebtoken

NotNorom commented 3 months ago

LGTM!