how to use Guard to protect confirmed URIs

3 messages Options
Embed this post
Permalink
Johnson Jiang

how to use Guard to protect confirmed URIs

Reply Threaded More More options
Print post
Permalink
Hi,

if the URI /customers/{customerId}/orders and /customers are my protection URIs, then how do I specify the baseUris like

    public Guard(Context context, String realm, Collection<String> baseUris,
            String serverKey)

Best Regards,

Johnson

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=7458&dsMessageId=2370876
Johnson Jiang

RE: how to use Guard to protect confirmed URIs

Reply Threaded More More options
Print post
Permalink
hi,

I add some description for the topic above:

actually the scenario is like that:

I just want to protect some of all resources like /customers, /customers/{customerId}, /customers/{customerId}/orders etc. some other resources such as /users, /users/{userId} etc.

if I want to Digest to do that, I know I have to customize a subclass of Guard, also I have to implement a construtor which contains baseUris parameter.

currently my thought is:
1. I can put the protected Uris into baseUris, then Restlet will check that and do the validation, I mean if restlet finds some uri should be protected, then it will call the related methods to do the validation. otherwise execute the next restlet.

2. restlet hasn't implemented this functionality, I mean users need to complete the logic about the protection urils mapping.

for example, we can override doHandle method, get the request uri, then check whether it is protected.

by the way, I am using restlet 1.1.5

Can anyone give me some help?

Thanks and Regards,

Johnson

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=7458&dsMessageId=2371384
jlouvel

RE: how to use Guard to protect confirmed URIs

Reply Threaded More More options
Print post
Permalink
Hi Johnson,

I suggest posting those messages to the "discuss" mailing list.

Best regards,
Jerome Louvel
--
Restlet ~ Founder and Lead developer ~ http://www.restlet.org
Noelios Technologies ~ Co-founder ~ http://www.noelios.com




-----Message d'origine-----
De : Johnson [mailto:[hidden email]]
Envoyé : mercredi 15 juillet 2009 07:22
À : [hidden email]
Objet : RE: how to use Guard to protect confirmed URIs

hi,

I add some description for the topic above:

actually the scenario is like that:

I just want to protect some of all resources like /customers,
/customers/{customerId}, /customers/{customerId}/orders etc. some other
resources such as /users, /users/{userId} etc.

if I want to Digest to do that, I know I have to customize a subclass of
Guard, also I have to implement a construtor which contains baseUris
parameter.

currently my thought is:
1. I can put the protected Uris into baseUris, then Restlet will check that
and do the validation, I mean if restlet finds some uri should be protected,
then it will call the related methods to do the validation. otherwise
execute the next restlet.

2. restlet hasn't implemented this functionality, I mean users need to
complete the logic about the protection urils mapping.

for example, we can override doHandle method, get the request uri, then
check whether it is protected.

by the way, I am using restlet 1.1.5

Can anyone give me some help?

Thanks and Regards,

Johnson

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=7458&dsMessageId=23713
84

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=7458&dsMessageId=2375498