Commit f7219a8
committed
Refactor JWT::JWK::Set#initialize
The two construction paths that build keys from hashes had drifted: the
JWKS document form skips a key whose kty is unsupported, the array form
raises. That is easy to miss when the two are nested blocks in the middle
of a case expression, and it is how the gap in jwt#744 came about.
Give each branch a named method, so what differs between them is visible
in the branch itself. initialize now fits the metrics limits without the
Metrics/CyclomaticComplexity exemption it has carried until now.
No behaviour change.1 parent 6ab1be7 commit f7219a8
2 files changed
Lines changed: 22 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | | - | |
17 | | - | |
| 15 | + | |
18 | 16 | | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
34 | 23 | | |
35 | 24 | | |
36 | 25 | | |
| |||
88 | 77 | | |
89 | 78 | | |
90 | 79 | | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
91 | 94 | | |
92 | 95 | | |
93 | 96 | | |
0 commit comments