RE: Is it possible to (easily) have authenticated/non-authenticated versions...

2012-05-16 Thread Ioannis Mavroukakis
Yeah the problem IMHO is that you're returning the guard, and the guard knows nothing about your URL scheme if I'm not mistaken. This needs something like router - guard - resource instead of guard - router - resource. alternatively, there should be an easy way to pattern match a guard to

RE: Is it possible to (easily) have authenticated/non-authenticated versions...

2012-05-16 Thread Richard Berger
Thanks again for the update - I will continue to work on this, although right now I am in the midst of trying to get oAuth2 to work, so it may be a while before I have a real response. RB -- View this message in context:

Re: Is it possible to (easily) have authenticated/non-authenticated versions...

2012-05-16 Thread Thierry Boileau
Hello Richard, I suggest you to update your code as follow: public final Restlet createInboundRoot() { Router rootRouter = new Router(getContext()); Router guardedRouter = new Router(getContext()); // attach your resources, relatively to the root path /v1 guardedRouter.attach(/test,

Re: Is it possible to (easily) have authenticated/non-authenticated versions...

2012-05-16 Thread Richard Berger
Thanks - that works perfectly for me. I had been returning the guard to fix an earlier problem - but obviously I fixed it in the wrong way. Thanks again for the detailed solution! RB -- View this message in context:

RE: Is it possible to (easily) have authenticated/non-authenticated versions...

2012-05-15 Thread Ioannis Mavroukakis
I haven't tested this so please accept my apologies if it doesn't work. You could use the following form of attach() public Route attach(String pathTemplate, Class? targetClass, int matchingMode) and attach your guard with a Template.MODE_STARTS_WITH

RE: Is it possible to (easily) have authenticated/non-authenticated versions...

2012-05-15 Thread Richard Berger
Thank you for the response... My simplified test code is now: public final Restlet createInboundRoot() { Router router = new Router(getContext()); router.attach(/v1/, RootServerResource.class); router.attach(/v2/, RootServerResource.class); GaeAuthenticator guard = new