I'm surprised at all the tech opinions this raised :)

First, there's a couple popular suggestions happening which aren't going in
the right direction, so I'll get that out of the way quick:

1) Any solution that involves me creating a JCR node and binding by resource
type is infeasible. I'm not willing to create a JCR node for each Resource
on the proxied datasource. If I have a million images on S3, and I'm trying
to expose them via /service/image, I'm not willing to create a million nodes
underneath /services/image, nor am I willing to keep that in sync, nor am I
capable of predicting all of the possible images that could be requested in
order to create those nodes. That's a ridiculous amount of work when the
goal is just to make all requests at a dynamic path route to a single
method.

2) Some have also said not to use Sling for this... I appreciate the time
and thought, but that isn't helpful and I must do this in Sling. These
services need access to the JCR for other purposes, and I also want the same
authentication/authorization handlers handling these services as my other
requests to the JCR. There will be a /home principal which is allowed to
access this /service.

If we can't solve this, we'll just use SlingSafeMethodsServlet and use
request parameters instead (ie. /service/image?id=123123 ). This will make
us cringe but we'll bear it.

I'd *really* like to continue down the ResourceProvider path by providing a
path, as shown in my code above. If I can just get past this 403 error, I'm
good! The effective policies of my ResourceProvider at /things should just
inherit "/", which is everyone=jcr:all so it doesn't seem that creating a
node with an ACL on it will help.. I'll continue to play a bit.

As for the Spring suggestions: Thank you, I'll consider this! It seems like
a lot of library to bring in when we'd only use a tiny part of the
functionality.... And anyhow, doesn't Spring just use Jersey under the hood
to provide endpoints?


Bertrand Delacretaz wrote
> We might need to release Sling 9 soon

Yes please :)


Bertrand Delacretaz wrote
> Maybe we just need to flesh out examples like Henry's in actual samples.
> Lance, would that help you?

Isn't his suggestion one involving creating a JCR node for all possible
request paths? So, for /service/{id} which could service a million
unpredictable ids, then I'd need to create a million nodes with names that I
can't predict?



--
View this message in context: 
http://apache-sling.73963.n3.nabble.com/How-to-create-Rest-APIs-for-non-JCR-data-in-Sling-8-tp4069947p4069997.html
Sent from the Sling - Users mailing list archive at Nabble.com.

Reply via email to