feat: add support for asymmetrical url signing keys, auth style key rotation and well-known - #1257
feat: add support for asymmetrical url signing keys, auth style key rotation and well-known#1257itslenny wants to merge 4 commits into
Conversation
This comment has been minimized.
This comment has been minimized.
Coverage Report for CI Build 32506509059Coverage increased (+0.2%) to 81.408%Details
Uncovered Changes
Coverage RegressionsNo coverage regressions found. Coverage Stats💛 - Coveralls |
868168d to
385ef32
Compare
385ef32 to
81b3ff4
Compare
911b0a0 to
22eead5
Compare
22eead5 to
5d8582b
Compare
5d8582b to
244508d
Compare
7168637 to
36ef6d4
Compare
| UPDATE tenants_jwks | ||
| SET active = $1 | ||
| WHERE id = $2 | ||
| AND tenant_id = $3 | ||
| AND active = $4 |
There was a problem hiding this comment.
per state machine, it won't be called concurrently or on signing key but shall we add kind to filter to ensure standby?
There was a problem hiding this comment.
This can be called on a key of any kind. It is used in rollURlSigningJwk to deactivate the active key. It can also be used to deactivate custom keys that were added which can have any kind (except the reserved ones). Since the kid is unique (primary key) there is no concern of updating the wrong key.
There was a problem hiding this comment.
This did make me realize that it's possible to deactivate the current url signing key which would leave the tenant with no url signing key at all. I added a check at the endpoint layer to explicitly prevent this. We can still use the roll endpoint and from an end user perspective they should create a standby, swap, and then deactivate
There was a problem hiding this comment.
exactly, this was my concern
There was a problem hiding this comment.
I rechecked this, endpoint check can only protect serial calls. If toggleActive is blocked on row lock of concurrent roll, it can deactivate the single signing key. We still need the kind check here to prevent it
1ac6475 to
6840d1d
Compare
6840d1d to
414ffcb
Compare
414ffcb to
5c942b6
Compare
What kind of change does this PR introduce?
Feature
What is the current behavior?
What is the new behavior?
.well-known/jwks.jsonso asymmetric keys can be validated at the gateway