[ 
https://issues.apache.org/jira/browse/JCLOUDS-683?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14495139#comment-14495139
 ] 

Ignasi Barrera commented on JCLOUDS-683:
----------------------------------------

I think the OAuthScopes are generic too. DigitalOcean also supports the 
read/write scopes depending on the request method, and other providers can bind 
the SingleScope class or a custom implementation. Take into account that the 
scopes are bound in each API module, in this case they're bound in the GCE http 
module, not in the oauth generic module, so it should be fine.

The annotation qualifies an URI supplier used to configure an endpoint. jclouds 
supports configuring the endpoints using the Path annotation or using a custom 
URI supplier. Since the OAuth api is generic, we can't hardcode a path in the 
Authorization api, so we use this mechanism to supply the endpoint based on a 
context property. See:
https://github.com/jclouds/jclouds-labs-google/blob/master/oauth/src/main/java/org/jclouds/oauth/v2/config/OAuthModule.java#L50-54
https://github.com/jclouds/jclouds-labs-google/blob/master/oauth/src/main/java/org/jclouds/oauth/v2/AuthorizationApi.java#L39
https://github.com/jclouds/jclouds-labs-google/blob/master/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/GoogleComputeEngineApiMetadata.java#L59

Providers using OAuth need to set this property to configure the endpoint the 
generic AuthorizationApi will connect to. Makes sense?

> Promote oauth API
> -----------------
>
>                 Key: JCLOUDS-683
>                 URL: https://issues.apache.org/jira/browse/JCLOUDS-683
>             Project: jclouds
>          Issue Type: Task
>          Components: jclouds-core, jclouds-labs-google
>    Affects Versions: 2.0.0
>            Reporter: Jeremy Daggett
>            Assignee: Chris Custine
>            Priority: Trivial
>
> Promote the oauth API to the main jclouds/jclouds repo so that other 
> apis/providers can leverage it.
> Original email thread:
> http://markmail.org/search/?q=jclouds+list%3Aorg.apache.jclouds.dev+OAuth#query:jclouds%20list%3Aorg.apache.jclouds.dev%20OAuth%20order%3Adate-backward+page:1+mid:wc3th3fantvxy6zy+state:results



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to