You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by John Crawford <cr...@gmail.com> on 2009/08/20 01:43:31 UTC

SlingPostServlet

Does anyone know if it possible to modify data / structure in another
workspace (outside of the current sling sandbox) if the user has the proper
credentials to that workspace?
Respectfully,
John

Re: SlingPostServlet

Posted by John Crawford <cr...@gmail.com>.
Hi Felix,

Ok.  I was thinking that this would be the solution, but was hoping we  
already had something.

Thanks again.
John

On Aug 20, 2009, at 1:36 AM, Felix Meschberger <fm...@gmail.com>  
wrote:

> Hi John
>
> John Crawford schrieb:
>> Does anyone know if it possible to modify data / structure in another
>> workspace (outside of the current sling sandbox) if the user has  
>> the proper
>> credentials to that workspace?
>
> The SlingPostServlet itself cannot do this at the moment: It is using
> the session of the current request and thus only has access to the
> workspace of the session.
>
> If you implement your own PostOperation you could of course get  
> another
> session to access a different workspace for your operation.
>
> Regards
> Felix

Re: SlingPostServlet

Posted by John Crawford <cr...@gmail.com>.
Very nice. I'll check this out. Thanks!

On Aug 20, 2009, at 1:50 AM, Bertrand Delacretaz  
<bd...@apache.org> wrote:

> Hi,
>
> On Thu, Aug 20, 2009 at 8:36 AM, Felix  
> Meschberger<fm...@gmail.com> wrote:
>> John Crawford schrieb:
>>> Does anyone know if it possible to modify data / structure in  
>>> another
>>> workspace (outside of the current sling sandbox) if the user has  
>>> the proper
>>> credentials to that workspace?
>>
>> The SlingPostServlet itself cannot do this at the moment: It is using
>> the session of the current request and thus only has access to the
>> workspace of the session.
>
> According to https://issues.apache.org/jira/browse/SLING-727,
> implementing a custom AuthenticationHandler (or improving the existing
> AuthorizationHeaderAuthenticationHandler [1]) would allow you to
> specify a workspace at login.
>
> Sling would need to fall back to the default workspace to find scripts
> - that should work in theory, but there might be some bugs as I'm not
> sure if people are currently using this.
>
> -Bertrand
>
> [1] http://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/httpauth/src/main/java/org/apache/sling/httpauth/impl/AuthorizationHeaderAuthenticationHandler.java

Re: SlingPostServlet

Posted by John Crawford <cr...@gmail.com>.
Ok, cool, this makes total sense.
As always, thank you for the help.

Respectfully,
John


On Thu, Aug 20, 2009 at 6:53 AM, Bertrand Delacretaz <bdelacretaz@apache.org
> wrote:

> On Thu, Aug 20, 2009 at 1:47 PM, John Crawford<cr...@gmail.com> wrote:
> > What if my target workspace does not have sling installed?  Only the root
> > (default) workspace.
>
> That was my comment about the need for Sling to find scripts, but as
> Carsten indicates Sling should always look for scripts in the default
> workspace, so that should not be a problem. Not much tested though, I
> assume.
>
> Note also that you can also get at other workspaces in scripts, via
> currentNode.getSession().getRepository().login(...). Not the cleanest
> thing but that might be useful for experimenting.
>
> -Bertrand
>
> >
> >
> > On Aug 20, 2009, at 2:11 AM, Carsten Ziegeler <cz...@apache.org>
> wrote:
> >
> >> Bertrand Delacretaz wrote:
> >>>
> >>> Hi,
> >>>
> >>> On Thu, Aug 20, 2009 at 8:36 AM, Felix Meschberger<fm...@gmail.com>
> >>> wrote:
> >>>>
> >>>> John Crawford schrieb:
> >>>>>
> >>>>> Does anyone know if it possible to modify data / structure in another
> >>>>> workspace (outside of the current sling sandbox) if the user has the
> >>>>> proper
> >>>>> credentials to that workspace?
> >>>>
> >>>> The SlingPostServlet itself cannot do this at the moment: It is using
> >>>> the session of the current request and thus only has access to the
> >>>> workspace of the session.
> >>>
> >>> According to https://issues.apache.org/jira/browse/SLING-727,
> >>> implementing a custom AuthenticationHandler (or improving the existing
> >>> AuthorizationHeaderAuthenticationHandler [1]) would allow you to
> >>> specify a workspace at login.
> >>>
> >>> Sling would need to fall back to the default workspace to find scripts
> >>> - that should work in theory, but there might be some bugs as I'm not
> >>> sure if people are currently using this.
> >>>
> >> This should work with the latest code from trunk as now a script admin
> >> session is used to query the script locations.
> >>
> >> Carsten
> >> --
> >> Carsten Ziegeler
> >> cziegeler@apache.org
> >
>

Re: SlingPostServlet

Posted by Bertrand Delacretaz <bd...@apache.org>.
On Thu, Aug 20, 2009 at 1:47 PM, John Crawford<cr...@gmail.com> wrote:
> What if my target workspace does not have sling installed?  Only the root
> (default) workspace.

That was my comment about the need for Sling to find scripts, but as
Carsten indicates Sling should always look for scripts in the default
workspace, so that should not be a problem. Not much tested though, I
assume.

Note also that you can also get at other workspaces in scripts, via
currentNode.getSession().getRepository().login(...). Not the cleanest
thing but that might be useful for experimenting.

-Bertrand

>
>
> On Aug 20, 2009, at 2:11 AM, Carsten Ziegeler <cz...@apache.org> wrote:
>
>> Bertrand Delacretaz wrote:
>>>
>>> Hi,
>>>
>>> On Thu, Aug 20, 2009 at 8:36 AM, Felix Meschberger<fm...@gmail.com>
>>> wrote:
>>>>
>>>> John Crawford schrieb:
>>>>>
>>>>> Does anyone know if it possible to modify data / structure in another
>>>>> workspace (outside of the current sling sandbox) if the user has the
>>>>> proper
>>>>> credentials to that workspace?
>>>>
>>>> The SlingPostServlet itself cannot do this at the moment: It is using
>>>> the session of the current request and thus only has access to the
>>>> workspace of the session.
>>>
>>> According to https://issues.apache.org/jira/browse/SLING-727,
>>> implementing a custom AuthenticationHandler (or improving the existing
>>> AuthorizationHeaderAuthenticationHandler [1]) would allow you to
>>> specify a workspace at login.
>>>
>>> Sling would need to fall back to the default workspace to find scripts
>>> - that should work in theory, but there might be some bugs as I'm not
>>> sure if people are currently using this.
>>>
>> This should work with the latest code from trunk as now a script admin
>> session is used to query the script locations.
>>
>> Carsten
>> --
>> Carsten Ziegeler
>> cziegeler@apache.org
>

Re: SlingPostServlet

Posted by John Crawford <cr...@gmail.com>.
What if my target workspace does not have sling installed?  Only the  
root (default) workspace.

Respectfully,
John


On Aug 20, 2009, at 2:11 AM, Carsten Ziegeler <cz...@apache.org>  
wrote:

> Bertrand Delacretaz wrote:
>> Hi,
>>
>> On Thu, Aug 20, 2009 at 8:36 AM, Felix  
>> Meschberger<fm...@gmail.com> wrote:
>>> John Crawford schrieb:
>>>> Does anyone know if it possible to modify data / structure in  
>>>> another
>>>> workspace (outside of the current sling sandbox) if the user has  
>>>> the proper
>>>> credentials to that workspace?
>>> The SlingPostServlet itself cannot do this at the moment: It is  
>>> using
>>> the session of the current request and thus only has access to the
>>> workspace of the session.
>>
>> According to https://issues.apache.org/jira/browse/SLING-727,
>> implementing a custom AuthenticationHandler (or improving the  
>> existing
>> AuthorizationHeaderAuthenticationHandler [1]) would allow you to
>> specify a workspace at login.
>>
>> Sling would need to fall back to the default workspace to find  
>> scripts
>> - that should work in theory, but there might be some bugs as I'm not
>> sure if people are currently using this.
>>
> This should work with the latest code from trunk as now a script admin
> session is used to query the script locations.
>
> Carsten
> -- 
> Carsten Ziegeler
> cziegeler@apache.org

Re: SlingPostServlet

Posted by Carsten Ziegeler <cz...@apache.org>.
Bertrand Delacretaz wrote:
> Hi,
> 
> On Thu, Aug 20, 2009 at 8:36 AM, Felix Meschberger<fm...@gmail.com> wrote:
>> John Crawford schrieb:
>>> Does anyone know if it possible to modify data / structure in another
>>> workspace (outside of the current sling sandbox) if the user has the proper
>>> credentials to that workspace?
>> The SlingPostServlet itself cannot do this at the moment: It is using
>> the session of the current request and thus only has access to the
>> workspace of the session.
> 
> According to https://issues.apache.org/jira/browse/SLING-727,
> implementing a custom AuthenticationHandler (or improving the existing
> AuthorizationHeaderAuthenticationHandler [1]) would allow you to
> specify a workspace at login.
> 
> Sling would need to fall back to the default workspace to find scripts
> - that should work in theory, but there might be some bugs as I'm not
> sure if people are currently using this.
> 
This should work with the latest code from trunk as now a script admin
session is used to query the script locations.

Carsten
-- 
Carsten Ziegeler
cziegeler@apache.org

Re: SlingPostServlet

Posted by Bertrand Delacretaz <bd...@apache.org>.
Hi,

On Thu, Aug 20, 2009 at 8:36 AM, Felix Meschberger<fm...@gmail.com> wrote:
> John Crawford schrieb:
>> Does anyone know if it possible to modify data / structure in another
>> workspace (outside of the current sling sandbox) if the user has the proper
>> credentials to that workspace?
>
> The SlingPostServlet itself cannot do this at the moment: It is using
> the session of the current request and thus only has access to the
> workspace of the session.

According to https://issues.apache.org/jira/browse/SLING-727,
implementing a custom AuthenticationHandler (or improving the existing
AuthorizationHeaderAuthenticationHandler [1]) would allow you to
specify a workspace at login.

Sling would need to fall back to the default workspace to find scripts
- that should work in theory, but there might be some bugs as I'm not
sure if people are currently using this.

-Bertrand

[1] http://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/httpauth/src/main/java/org/apache/sling/httpauth/impl/AuthorizationHeaderAuthenticationHandler.java

Re: SlingPostServlet

Posted by Felix Meschberger <fm...@gmail.com>.
Hi John

John Crawford schrieb:
> Does anyone know if it possible to modify data / structure in another
> workspace (outside of the current sling sandbox) if the user has the proper
> credentials to that workspace?

The SlingPostServlet itself cannot do this at the moment: It is using
the session of the current request and thus only has access to the
workspace of the session.

If you implement your own PostOperation you could of course get another
session to access a different workspace for your operation.

Regards
Felix