Class SharedKeyLiteAuthentication
- java.lang.Object
-
- org.jclouds.azure.storage.filters.SharedKeyLiteAuthentication
-
- All Implemented Interfaces:
HttpRequestFilter
@Singleton public class SharedKeyLiteAuthentication extends Object implements HttpRequestFilter
Signs the Azure Storage request.
-
-
Constructor Summary
Constructors Constructor Description SharedKeyLiteAuthentication(SignatureWire signatureWire, com.google.common.base.Supplier<Credentials> creds, javax.inject.Provider<String> timeStampProvider, Crypto crypto, HttpUtils utils, boolean sasAuthentication, StorageUrlSupplier storageUrlSupplier, AuthType authType, OAuthFilter oAuthFilter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
calculateSignature(String toSign)
String
createStringToSign(HttpRequest request)
String[]
cutUri(URI uri)
this is the method to parse container name and blob name from the HttpRequest.HttpRequest
filter(HttpRequest request)
this is an updated filter method, which decides whether the SAS or SharedKeyLite is used and applies the right filtering.HttpRequest
filterKey(HttpRequest request)
this is a 'standard' filter method, applied when SharedKeyLite authentication is used.HttpRequest
filterSAS(HttpRequest request, String credential)
this filter method is applied only for the cases with SAS Authentication.String
signString(String toSign)
-
-
-
Constructor Detail
-
SharedKeyLiteAuthentication
@Inject public SharedKeyLiteAuthentication(SignatureWire signatureWire, com.google.common.base.Supplier<Credentials> creds, javax.inject.Provider<String> timeStampProvider, Crypto crypto, HttpUtils utils, @Named("sasAuth") boolean sasAuthentication, StorageUrlSupplier storageUrlSupplier, AuthType authType, OAuthFilter oAuthFilter)
-
-
Method Detail
-
filter
public HttpRequest filter(HttpRequest request) throws HttpException
this is an updated filter method, which decides whether the SAS or SharedKeyLite is used and applies the right filtering.- Specified by:
filter
in interfaceHttpRequestFilter
- Throws:
HttpException
-
filterSAS
public HttpRequest filterSAS(HttpRequest request, String credential) throws HttpException, IllegalArgumentException
this filter method is applied only for the cases with SAS Authentication.
-
filterKey
public HttpRequest filterKey(HttpRequest request) throws HttpException
this is a 'standard' filter method, applied when SharedKeyLite authentication is used.- Throws:
HttpException
-
cutUri
public String[] cutUri(URI uri) throws IllegalArgumentException
this is the method to parse container name and blob name from the HttpRequest.- Throws:
IllegalArgumentException
-
createStringToSign
public String createStringToSign(HttpRequest request)
-
calculateSignature
public String calculateSignature(String toSign) throws HttpException
- Throws:
HttpException
-
-