JCLOUDS-633: Support passing bearer token directly for OAuth2

This commit is contained in:
Chris Custine 2014-07-18 12:53:48 -06:00
parent 8df2b40742
commit 520432903e
4 changed files with 8 additions and 6 deletions

View File

@ -16,6 +16,7 @@
*/
package org.jclouds.googlecloudstorage.config;
import org.jclouds.oauth.v2.config.CredentialType;
import org.jclouds.oauth.v2.config.OAuthModule;
import org.jclouds.oauth.v2.domain.OAuthCredentials;
import org.jclouds.oauth.v2.domain.Token;
@ -45,5 +46,6 @@ public class OAuthModuleWithoutTypeAdapters extends OAuthModule {
}).to(BuildTokenRequest.class);
bind(new TypeLiteral<Function<TokenRequest, Token>>() {
}).to(FetchToken.class);
bind(CredentialType.class).toProvider(OAuthModule.CredentialTypeFromPropertyOrDefault.class);
}
}

View File

@ -36,7 +36,7 @@ import org.jclouds.googlecloudstorage.handlers.BucketAccessControlsBinder;
import org.jclouds.http.HttpResponse;
import org.jclouds.javax.annotation.Nullable;
import org.jclouds.oauth.v2.config.OAuthScopes;
import org.jclouds.oauth.v2.filters.OAuthAuthenticator;
import org.jclouds.oauth.v2.filters.OAuthAuthenticationFilter;
import org.jclouds.rest.annotations.BinderParam;
import org.jclouds.rest.annotations.Fallback;
import org.jclouds.rest.annotations.MapBinder;
@ -53,7 +53,7 @@ import org.jclouds.rest.binders.BindToJsonPayload;
*/
@SkipEncoding({ '/', '=' })
@RequestFilters(OAuthAuthenticator.class)
@RequestFilters(OAuthAuthenticationFilter.class)
public interface BucketAccessControlsApi {
/**

View File

@ -43,7 +43,7 @@ import org.jclouds.googlecloudstorage.options.ListOptions;
import org.jclouds.googlecloudstorage.options.UpdateBucketOptions;
import org.jclouds.javax.annotation.Nullable;
import org.jclouds.oauth.v2.config.OAuthScopes;
import org.jclouds.oauth.v2.filters.OAuthAuthenticator;
import org.jclouds.oauth.v2.filters.OAuthAuthenticationFilter;
import org.jclouds.rest.annotations.BinderParam;
import org.jclouds.rest.annotations.Fallback;
import org.jclouds.rest.annotations.MapBinder;
@ -60,7 +60,7 @@ import org.jclouds.rest.binders.BindToJsonPayload;
*/
@SkipEncoding({ '/', '=' })
@RequestFilters(OAuthAuthenticator.class)
@RequestFilters(OAuthAuthenticationFilter.class)
public interface BucketApi {
/**

View File

@ -39,7 +39,7 @@ import org.jclouds.googlecloudstorage.handlers.DefaultObjectAccessControlsBinder
import org.jclouds.http.HttpResponse;
import org.jclouds.javax.annotation.Nullable;
import org.jclouds.oauth.v2.config.OAuthScopes;
import org.jclouds.oauth.v2.filters.OAuthAuthenticator;
import org.jclouds.oauth.v2.filters.OAuthAuthenticationFilter;
import org.jclouds.rest.annotations.BinderParam;
import org.jclouds.rest.annotations.Fallback;
import org.jclouds.rest.annotations.MapBinder;
@ -56,7 +56,7 @@ import org.jclouds.rest.binders.BindToJsonPayload;
*/
@SkipEncoding({ '/', '=' })
@RequestFilters(OAuthAuthenticator.class)
@RequestFilters(OAuthAuthenticationFilter.class)
public interface DefaultObjectAccessControlsApi {
/**