rust-jwt icon indicating copy to clipboard operation
rust-jwt copied to clipboard

Add support for multi-value aud claims

Open glimberg opened this issue 2 years ago • 2 comments

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

Fixes Issue #83

glimberg avatar Jun 24 '22 01:06 glimberg

@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.

glimberg avatar Jun 24 '22 04:06 glimberg

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.

gbrlsnchs avatar Mar 12 '23 15:03 gbrlsnchs