mikkyang / rust-jwt

JSON Web Token library for Rust
MIT License
176 stars 38 forks source link

Add support for multi-value aud claims #86

Open glimberg opened 2 years ago

glimberg commented 2 years ago

Introduces a StringOrVec struct and custom serializer/deserialzer for the aud claim.

Fixes Issue #83

glimberg commented 2 years ago

@mikkyang If you can look at this ASAP, it'd be much appreciated. Need to get a new release out with this change incorporated. Have a deadline of Wednesday, June 22 to get a release going.

gbrlsnchs commented 1 year ago

This PR covers deserializing the aud claim correctly, but since one and multi are private fields, how is this supposed to let the end user set a value for them to serialize it?

How about an Audience enum instead of a struct? Then you could have Audience::String and Audience::Array. This is a little more idiomatic IMO.