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

Adrian Cole commented on JCLOUDS-172:
-------------------------------------

One thing I've noticed is that we copy-paste oauth scope annotations 
everywhere. this is really error prone, tedious, and high reflective overhead.

The rules are simple! I would like to change the oauth provider to not use 
annotations anymore. Instead a function like this.

{code}
static class OAuthScopeForGCE implements Function<HttpRequest, String> {
   @Override public String apply(HttpRequest in) {
      if (in.getMethod().equals("GET") || in.getMethod().equals("HEAD") {
          return "https://www.googleapis.com/auth/compute.readonly";;
      } else {
          return "https://www.googleapis.com/auth/compute";;
      }
   }
}
{code}

With the above, we can stop boiler-plating annotations on literally every 
method, which allows us to focus on the annotations that matter.

> "Graduate" GCE to core
> ----------------------
>
>                 Key: JCLOUDS-172
>                 URL: https://issues.apache.org/jira/browse/JCLOUDS-172
>             Project: jclouds
>          Issue Type: Task
>          Components: jclouds-labs-google
>    Affects Versions: 1.8.0
>            Reporter: Andrew Bayer
>            Assignee: Adrian Cole
>            Priority: Critical
>
> We should really get GCE to a "finished" state and include it in 1.7.0.



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

Reply via email to