kilork / openid

OpenID Connect Rust Library
The Unlicense
61 stars 22 forks source link

feat: ensure Bearer serialization round trip is possible #48

Closed Lesny closed 5 months ago

Lesny commented 11 months ago

Fixes #47

No breaking changes intended. Tokens serialized by previous versions upon deserialization should be corrupted in exactly same way as before. (didn't test this).

kyrias commented 6 months ago

No breaking changes intended.

Adding a new member to a struct where all existing members are pub and the struct isn't marked with non_exhaustive is a breaking change nonetheless. I don't think that's necessarily a problem, but it would require a breaking version bump.

It does seem a bit strange to me though to have have both received_at and expires be DateTimes and then adding or subtracting them to go from one struct to the other. I feel like it would maybe make more sense to only have a single struct with the new received_at, but then replace expires with the raw expires_in and adding a method that returns the actual calculated expiration DateTime.