Hi,
Background:
OAK-6575 adds support for a Oak DataStore to implement a service
implementing org.apache.jackrabbit.oak.api.conversion.URIProvider which
converts a JCR Value to a URI. The implementation in OAK-6575 is for the
Oak S3 DataStore to convert to a CloudFront signed url as detailed in [1].
The URI the URIProvider emits in this case expires quickly (< 60s), only
allows GET and is only issued to a JCR session that can read the binary. It
is intended to be used as a redirect, the flow being.
Client > Sling -> GET <binaryURL>
<- redirect to CF sifgned url
Client -> CF -> GET <CF signed URL>
To patch[2] has been discussed at length on Oak and now is close to being
acceptable.
To make this work in Sling requires a patch to Sling, which needs
discussion. The assumptions are that it should work seamlessly and not
require any core component to depend on the Oak API. One patch is [3]. It
adds a new bundle that adds and AdapterFactory that adapts from Resource to
URI. It tries all URIProviders registered by Oak and if one provides a URI.
Inside the Get Servlets streaming helper, if a resource is adaptable to a
URI, that URI is used as a redirect rather than streaming the binaries.
I think this patch needs discussion before being committed, hence this
thread.
Best Regards
Ian
1
http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/PrivateContent.html
2
https://github.com/ieb/jackrabbit-oak/compare/trunk...ieb:OAK-6575-3?expand=1
3 https://github.com/apache/sling/compare/trunk...ieb:OAK-6575-3?expand=1