Closed qmuntal closed 1 year ago
Merging #158 (0c37dca) into main (c862f87) will increase coverage by
2.14%
. The diff coverage is96.66%
.
@@ Coverage Diff @@
## main #158 +/- ##
==========================================
+ Coverage 91.16% 93.30% +2.14%
==========================================
Files 12 11 -1
Lines 1550 1658 +108
==========================================
+ Hits 1413 1547 +134
+ Misses 101 78 -23
+ Partials 36 33 -3
Impacted Files | Coverage Δ | |
---|---|---|
key.go | 95.76% <96.66%> (+6.46%) |
:arrow_up: |
:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more
@thomas-fossati @setrofim I've added one last commit to this PR, in case you want to take another look.
@thomas-fossati @setrofim I've added one last commit to this PR, in case you want to take another look.
neat!
This PR redesigns
Key
so all non-common parameters are stored in a map instead, even the ones from known key types (i.e. EC2, OKP, and Symmetric keys). This allowsgo-cose
to support key types and parameters that are not defined in RFC8152 without having to break the module API. See #151 for more context.The Key struct now looks like this:
I've also added some helper functions to access the known and unknown key parameters:
A good amount of new test cases have been added.
@setrofim I've remove the
intOrStr
struct, as it is not necessary with the new way of decoding keys, It is a pity, because I conceptually liked it. If we ever release a new major version, we should consider using something like that to have a better type enforcement in all map labels.