mirror of
https://github.com/apache/jclouds.git
synced 2025-03-02 06:19:07 +00:00
JCLOUDS-633: Support passing bearer token directly for OAuth2
This commit is contained in:
parent
8df2b40742
commit
520432903e
@ -16,6 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.jclouds.googlecloudstorage.config;
|
package org.jclouds.googlecloudstorage.config;
|
||||||
|
|
||||||
|
import org.jclouds.oauth.v2.config.CredentialType;
|
||||||
import org.jclouds.oauth.v2.config.OAuthModule;
|
import org.jclouds.oauth.v2.config.OAuthModule;
|
||||||
import org.jclouds.oauth.v2.domain.OAuthCredentials;
|
import org.jclouds.oauth.v2.domain.OAuthCredentials;
|
||||||
import org.jclouds.oauth.v2.domain.Token;
|
import org.jclouds.oauth.v2.domain.Token;
|
||||||
@ -45,5 +46,6 @@ public class OAuthModuleWithoutTypeAdapters extends OAuthModule {
|
|||||||
}).to(BuildTokenRequest.class);
|
}).to(BuildTokenRequest.class);
|
||||||
bind(new TypeLiteral<Function<TokenRequest, Token>>() {
|
bind(new TypeLiteral<Function<TokenRequest, Token>>() {
|
||||||
}).to(FetchToken.class);
|
}).to(FetchToken.class);
|
||||||
|
bind(CredentialType.class).toProvider(OAuthModule.CredentialTypeFromPropertyOrDefault.class);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -36,7 +36,7 @@ import org.jclouds.googlecloudstorage.handlers.BucketAccessControlsBinder;
|
|||||||
import org.jclouds.http.HttpResponse;
|
import org.jclouds.http.HttpResponse;
|
||||||
import org.jclouds.javax.annotation.Nullable;
|
import org.jclouds.javax.annotation.Nullable;
|
||||||
import org.jclouds.oauth.v2.config.OAuthScopes;
|
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.BinderParam;
|
||||||
import org.jclouds.rest.annotations.Fallback;
|
import org.jclouds.rest.annotations.Fallback;
|
||||||
import org.jclouds.rest.annotations.MapBinder;
|
import org.jclouds.rest.annotations.MapBinder;
|
||||||
@ -53,7 +53,7 @@ import org.jclouds.rest.binders.BindToJsonPayload;
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
@SkipEncoding({ '/', '=' })
|
@SkipEncoding({ '/', '=' })
|
||||||
@RequestFilters(OAuthAuthenticator.class)
|
@RequestFilters(OAuthAuthenticationFilter.class)
|
||||||
public interface BucketAccessControlsApi {
|
public interface BucketAccessControlsApi {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -43,7 +43,7 @@ import org.jclouds.googlecloudstorage.options.ListOptions;
|
|||||||
import org.jclouds.googlecloudstorage.options.UpdateBucketOptions;
|
import org.jclouds.googlecloudstorage.options.UpdateBucketOptions;
|
||||||
import org.jclouds.javax.annotation.Nullable;
|
import org.jclouds.javax.annotation.Nullable;
|
||||||
import org.jclouds.oauth.v2.config.OAuthScopes;
|
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.BinderParam;
|
||||||
import org.jclouds.rest.annotations.Fallback;
|
import org.jclouds.rest.annotations.Fallback;
|
||||||
import org.jclouds.rest.annotations.MapBinder;
|
import org.jclouds.rest.annotations.MapBinder;
|
||||||
@ -60,7 +60,7 @@ import org.jclouds.rest.binders.BindToJsonPayload;
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
@SkipEncoding({ '/', '=' })
|
@SkipEncoding({ '/', '=' })
|
||||||
@RequestFilters(OAuthAuthenticator.class)
|
@RequestFilters(OAuthAuthenticationFilter.class)
|
||||||
public interface BucketApi {
|
public interface BucketApi {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -39,7 +39,7 @@ import org.jclouds.googlecloudstorage.handlers.DefaultObjectAccessControlsBinder
|
|||||||
import org.jclouds.http.HttpResponse;
|
import org.jclouds.http.HttpResponse;
|
||||||
import org.jclouds.javax.annotation.Nullable;
|
import org.jclouds.javax.annotation.Nullable;
|
||||||
import org.jclouds.oauth.v2.config.OAuthScopes;
|
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.BinderParam;
|
||||||
import org.jclouds.rest.annotations.Fallback;
|
import org.jclouds.rest.annotations.Fallback;
|
||||||
import org.jclouds.rest.annotations.MapBinder;
|
import org.jclouds.rest.annotations.MapBinder;
|
||||||
@ -56,7 +56,7 @@ import org.jclouds.rest.binders.BindToJsonPayload;
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
@SkipEncoding({ '/', '=' })
|
@SkipEncoding({ '/', '=' })
|
||||||
@RequestFilters(OAuthAuthenticator.class)
|
@RequestFilters(OAuthAuthenticationFilter.class)
|
||||||
public interface DefaultObjectAccessControlsApi {
|
public interface DefaultObjectAccessControlsApi {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user