RFR: 1196: Add extension points on RestRequest to support more REST authorization methods
Erik Joelsson
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.
-------------
Commit messages:
- Make it possible to override logic for pagination next link
- SKARA-1196
Changes: https://git.openjdk.java.net/skara/pull/1227/files
Webrev: https://webrevs.openjdk.java.net/?repo=skara&pr=1227&range=00
Issue: https://bugs.openjdk.java.net/browse/SKARA-1196
Stats: 91 lines in 11 files changed: 57 ins; 7 del; 27 mod
Patch: https://git.openjdk.java.net/skara/pull/1227.diff
Fetch: git fetch https://git.openjdk.java.net/skara pull/1227/head:pull/1227
PR: https://git.openjdk.java.net/skara/pull/1227
More information about the skara-dev
mailing list