rafiki icon indicating copy to clipboard operation
rafiki copied to clipboard

feat(backend): serve keys from payment pointer url

Open omertoast opened this issue 3 years ago • 2 comments

Changes proposed in this pull request

  • add paymentPointerUrl field to clients table. 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 getClientByPaymentPointerUrl method to client service.
  • add getPaymentPointerKeys method to paymentPointerRoutes to serve key set.
  • add /jwks.json route.

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.json endpoint.

Checklist

  • [ ] Related issues linked using fixes #number
  • [ ] Tests added/updated
  • [ ] Documentation added
  • [ ] Make sure that all checks pass

omertoast avatar Oct 18 '22 09:10 omertoast

LGTM but I suggest either @mkurapov , @sabineschaller or @wilsonianb have a quick glance over

adrianhopebailie avatar Oct 18 '22 12:10 adrianhopebailie

I was able to create a client, add key to client, and get the keys via /jwks.json path 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.

omertoast avatar Oct 19 '22 11:10 omertoast