jwx: [NOTICE] Changes for v1.1.0 (BREAKING CHANGES! PLEASE TEST)
Tracker issue for v1.1.0, which is planned to introduce breaking changes. Development is being done in https://github.com/lestrrat-go/jwx/tree/develop/v1.1.0
Planned Breaking Changes
- Remove all
Parse(io.Reader)
,ParseBytes([]byte)
, andmethods (closes #291)ParseString(string)
- Add
Parse([]byte)
andParseReader(io.Reader)
methods - Remove
jws.ParseVerify
- Add
- Change
jwk.Set
to a an interface (closes #293)- Change API to allow mutation.
Add(jwk.Key)
,Remove(jwk.Key)
,Clear()
, etc. (note: treat it as a “set”; don’t create lookups, because “kid” is not guaranteed to be there) - Fix JSON marshaling
-
(jwk.Set).LookupKeyID(string)
returns the firstjwk.Key
matching the “kid”. If multiple kids are available, use(jwk.Set).Iterate(context.Context)
- Change API to allow mutation.
- Remove
jwk.PublicKeyOf(rawKey)
- Add
jwk.PublicRawKeyOf(rawKey)
- Add
jwk.PublicKeyOf(jwk.Key)
- Add
jwk.PublicSetOf(jwk.Set)
- Change
(jwk.Key).PublicKey()
to return ajwk.Key
. Implement it in all applicable key types - Make
key.PublicKey()
return a key with all fields (except for those explicitly not allowed) copied from the original key.
- Add
- Remove
jws.VerifyXXXX
.- Allow
jws.Verify()
to take a raw key or ajwk.Key
- Add
jws.VerifySet([]byte, jwk.Set)
- Allow
- Remove
jwk.FetchXXXX
methods. Onlyjwk.Fetch()
remains.- Reuse
jwk.Fetch()
fromjwk.AutoRefresh
. - Reclassify
WithHTTPClient()
asFetchOption
- Rename
WithRefreshBackoff()
toWithFetchBackoff()
- Reuse
- Add
ReadFile()
to all packages, to read from local file system. On go >= 1.16 , io/fs should be supported, so you could even embed your jwk in your compiled program - Remove
jws.SplitCompact(io.Reader)
(NEW!)- Add
jws.SplitCompact([]byte)
- Add
jws.SplitCompactReader(io.Reader)
- Add
- Remove
jws.SignLiteral
- Change options to
jws.SignMulti
- Change
jwe.WithPrettyJSONFormat
tojwe.WithPrettyFormat
, and its return type tojws.SerializerOption
- Remove buffer.Buffer
Miscellaneous
- switch default branch to main
- Optimizations
- Optimize (jwk.Set).MarshalJSON (36% reduction in memory allocation)
- Optimize (jwt.Token).MarshalJSON
- Optimize (jws.Header).MarshalJSON
- Optimize (jwe.Header).MarshalJSON
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 18 (6 by maintainers)
Commits related to this issue
- jwk.Set is an interface, and has a new API refs #295 * jwk.Set has an API to mutate and examine its contents. * jwk.Set is now an interface, forcing users to explicitly initialize it properly. * j... — committed to lestrrat-go/jwx by lestrrat 3 years ago
- Rework everything related to PublicKeyOf() refs #295 — committed to lestrrat-go/jwx by lestrrat 3 years ago
- Port to jwx 1.1.0 https://github.com/lestrrat-go/jwx/issues/295 — committed to anatol/clevis.go by anatol 3 years ago
- breaking changes with github.com/lestrrat-go/jwx update v0.9.2 -> v1.2.25 https://github.com/lestrrat-go/jwx/issues/295 — committed to xmidt-org/themis by denopink 2 years ago
Not at all. The changes are straightforward and documented in the
Changes
file.well deserved! I’m just starting out my day (I live in Toronto, Canada)
I went into a frenzy and implemented everything in a day. So much for shooting for April.
I guess it’s time I stop and take some feedback.
I just want to have some fresh eyes, and to that extent I’m just going to call on some people who have recently contributed to this repository in one form or the other. I will also ask from my Twitter account if anybody is interested.
So…
@sonard(sorry for the typo!) @anatol @imirkin @shaunco @gboloIf any of you have some spare time, will you please check out the proposed changes in this issue, and the changes in #306? You absolutely do no have to feel obligated to do this for me, but if you do take the time to review, thank you very much in advance.