rafiki
rafiki copied to clipboard
feat(backend): serve keys from payment pointer url
Changes proposed in this pull request
- add
paymentPointerUrlfield toclientstable. This is temporary as I don't want to break services that use clients, if you have a better way to link clients to payment pointers I'm open to it. - add
getClientByPaymentPointerUrlmethod to client service. - add
getPaymentPointerKeysmethod topaymentPointerRoutesto serve key set. - add
/jwks.jsonroute.
Context
This is one of the first tasks for refactoring the Key Directory from v1 to v2. As the first step, I'm implementing /jkws.json relative path to the payment pointer URL to serve the client key set linked to the payment pointer.
TODO
- [x] Link clients and payment pointers
- [x] Allow getting clients using payment pointers
- [x] Extract JWKS from the key set
- [x] Serve key set from
/jwks.jsonendpoint.
Checklist
- [ ] Related issues linked using
fixes #number - [ ] Tests added/updated
- [ ] Documentation added
- [ ] Make sure that all checks pass
LGTM but I suggest either @mkurapov , @sabineschaller or @wilsonianb have a quick glance over
I was able to create a client, add key to client, and get the keys via
/jwks.jsonpath successfully. For this PR, just should get Brandon's suggested change in there and good to go
I started a branch for moving clients functions and table into the paymentPointer. Should be ready end of the day.