go-jose / go-jose

An implementation of JOSE standards (JWE, JWS, JWT) in Go
Apache License 2.0
318 stars 77 forks source link

Revert #130: JSONWebKeySet: ignore unsupported key types #137

Closed jsha closed 2 months ago

jsha commented 2 months ago

As discussed in #136, this was a breaking change. Implementing UnmarshalJSON on JSONWebKeySet broke unmarshaling into structs that embed JSONWebKeySet and also include other fields (and that do not have UnmarshalJSON implementations themselves). Before #130, those fields would get unmarshaled using the default behavior for encoding/json. After #130, the custom UnmarshalJSON would get called for the whole parent struct, but because its receiver is the embedded JSONWebKeySet it would not be able to set any of the sibling fields.

Revert for now to undo the breakage. We should find another way to solve the problem of accepting unrecognized keys.