Ok :) Keep us posted; I'm curious now!
On 5 November 2013 22:51, Zack Shoylev <zack.shoy...@rackspace.com> wrote: > I looked at it some more and I will try to redesign instead. I have an idea, > hopefully it works. > ________________________________________ > From: Zack Shoylev [zack.shoy...@rackspace.com] > Sent: Tuesday, November 05, 2013 1:33 PM > To: dev@jclouds.apache.org > Cc: dev > Subject: RE: unauthenticated calls suggestions > > Seems this did not work for me. I see the following issues (I have included > the output for both): > 1) The authenticate request (/tokens) still gets executed first > 2) The tenant id (in this case 88888..) still gets included in the URL. > > This is the annotated method call: > > @Named("execute") > @POST > @Path("/execute/{capability_version}/{capability_hash}") > @Consumes(MediaType.APPLICATION_JSON) > @Fallback(FalseOnNotFoundOr404.class) > @RequestFilters({}) > @OverrideRequestFilters > boolean execute(@PathParam("capability_version") String capabilityVersion, > @PathParam("capability_hash") String capabilityHash); > > This is the branch I use: > https://github.com/rackerlabs/jclouds-labs-openstack/tree/rackspace-autoscale3 > > This is the test output I get. From what I can see, I suspect the test itself > could also be the problem. > > testExecuteWebhook(org.jclouds.rackspace.autoscale.v1.features.ExecutionApiExpectTest) > Time elapsed: 0.763 sec <<< FAILURE! > org.jclouds.http.HttpResponseException: command: POST > http://localhost:5000/v2.0/tokens HTTP/1.1 failed with response: HTTP/1.1 500 > no response configured for request; content: [ > the following request is not configured: > ---------------------------------------- > POST http://localhost:5000/v2.0/tokens HTTP/1.1 > Accept: application/json > Content-Type: application/json > Content-Length: 114 > {"auth":{"passwordCredentials":{"username":"identity","password":"credential"},"tenantName":"adr...@jclouds.org"}}---------------------------------------- > configured requests: > ---------------------------------------- > POST > https://dfw.autoscale.api.rackspacecloud.com/v1.0/execute/version1/hash12345 > HTTP/1.1 > Accept: application/json > X-Auth-Token: bb03a23aa8271291a7aaa9aaa2aaaaaa > ] > > *** > > Alternatively, the output for case 2) : > > testExecuteWebhookFail(org.jclouds.rackspace.autoscale.v1.features.ExecutionApiExpectTest) > Time elapsed: 0.006 sec <<< FAILURE! > org.jclouds.http.HttpResponseException: command: POST > https://dfw.autoscale.api.rackspacecloud.com/v1.0/888888/execute/version1/hash12345 > HTTP/1.1 failed with response: HTTP/1.1 500 no response configured for > request; content: [ > the following request is not configured: > ---------------------------------------- > POST > https://dfw.autoscale.api.rackspacecloud.com/v1.0/888888/execute/version1/hash12345 > HTTP/1.1 > Accept: application/json > ---------------------------------------- > configured requests: > ---------------------------------------- > POST http://localhost:5000/v2.0/tokens HTTP/1.1 > Accept: application/json > Content-Type: application/json > Content-Length: 114 > {"auth":{"passwordCredentials":{"username":"identity","password":"credential"},"tenantName":"adr...@jclouds.org"}}---------------------------------------- > POST > https://dfw.autoscale.api.rackspacecloud.com/v1.0/execute/version1/hash12345 > HTTP/1.1 > Accept: application/json > X-Auth-Token: bb03a23aa8271291a7aaa9aaa2aaaaaa > ] > ________________________________________ > From: Ignasi [ignasi.barr...@gmail.com] > Sent: Tuesday, November 05, 2013 12:37 AM > To: dev@jclouds.apache.org > Cc: dev > Subject: Re: unauthenticated calls suggestions > > Authentication is done per-request by using the request filters. > > If you annotate your method like this, the filters in the class should not > be applied: > > @RequestFilters({}) > @OverrideRequestFilters > public void unauthenticatedMethod() > > You still need to have a context and all the rest, but this way you can > override the filters so the unauthenticated method does not inherit the > ones from the class (you can still set the particular filters you may need > for it). > > If there are several unauthenticared methods, perhaps it is a good idea to > grouo all them in an UnauthenticatedApi class or similar, to avoid > duplicating the filter override logic too much. > > HTH! > > Ignasi > El 05/11/2013 01:01, "Zack Shoylev" <zack.shoy...@rackspace.com> escribió: > >> Specifically for openstack services, if a service supports some >> unauthenticated calls, what is a good way to integrate that call with the >> rest of the service in jclouds? So there is no authentication, no tenant on >> the path, and the method can be executed without providing credentials.... >> Regular call: {endpoint}/v1.0/{tenantid}/some_path/etc >> Unauthenticated call: {endpoint}/v1.0/some_other_path/etc