RFR: 1196: Add extension points on RestRequest to support more REST authorization methods
erikj at openjdk.java.net
Thu Sep 30 21:38:00 UTC 2021
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.
- Make it possible to override logic for pagination next link
Stats: 91 lines in 11 files changed: 57 ins; 7 del; 27 mod
Fetch: git fetch https://git.openjdk.java.net/skara pull/1227/head:pull/1227
More information about the skara-dev