RFR: 1196: Add extension points on RestRequest to support more REST authorization methods

Kevin Rushforth kcr at openjdk.java.net
Thu Sep 30 22:46:31 UTC 2021

On Thu, 30 Sep 2021 21:34:30 GMT, Erik Joelsson <erikj at openjdk.org> wrote:

> This patch adds and extends some extension points in the RestRequest API. The immediate use of these extensions are being implemented in a custom extension to Skara. There are 3 main changes:
> 1. The optional lambda that handles authorization headers for a request now has access to the HttpRequest.Builder, so that it may inspect existing headers. This is causing a lot of small changes throughout the code base, just adding the new parameter to any lambda implementing the FunctionalInterface.
> 2. Adding a new optional field to the QueryBuilder, naming a header where a sha256 hash of the request body will be stored. Requiring such a hash seems common enough to have built in support for it in Skara, but the name of the header seems to differ between API providers.
> 3. Adding another optional lambda which can override how pagination is handled. This gets access to the HttpResponse to extract any necessary data to generate an HttpRequest.Builder for accessing the next page.

Looks good.


Marked as reviewed by kcr (Reviewer).

PR: https://git.openjdk.java.net/skara/pull/1227

More information about the skara-dev mailing list