public class GetCallerIdentityV4Presigner extends Object implements STSGetCallerIdentityPresigner
AMZ_ACTION_PARAM_NAME, AMZ_ALGORITHM_PARAM_NAME, AMZ_CREDENTIAL_PARAM_NAME, AMZ_DATE_PARAM_NAME, AMZ_EXPIRES_PARAM_NAME, AMZ_SECURITY_TOKEN_PARAM_NAME, AMZ_SIGNATURE_PARAM_NAME, AMZ_SIGNED_HEADERS_PARAM_NAME, AMZ_VERSION_PARAM_NAME| Constructor and Description |
|---|
GetCallerIdentityV4Presigner() |
| Modifier and Type | Method and Description |
|---|---|
byte[] |
computeSignature(com.amazonaws.auth.AWSCredentials sanitizedCredentials,
String dateStamp,
String region,
String SERVICE_NAME,
String TERMINATOR,
String stringToSign) |
protected String |
getCanonicalizedHeaderString(Map<String,String> requestHeaders) |
protected String |
getCanonicalizedQueryString(Map<String,String> parameters)
Examines the specified query string parameters and returns a
canonicalized form.
|
protected String |
getCanonicalRequest(String httpMethod,
Map<String,String> parameters,
Map<String,String> headers,
String contentSha256) |
static String |
getDateStamp(long dateMilli) |
protected String |
getHostHeader(URI endpoint) |
protected Date |
getSignatureDate(int timeOffset) |
protected String |
getSignedHeadersString(Map<String,String> headers) |
protected String |
getStringToSign(String algorithm,
String dateTime,
String scope,
String canonicalRequest) |
static String |
getTimeStamp(long dateMilli) |
byte[] |
hash(String text)
Hashes the string contents (assumed to be UTF-8) using the SHA-256
algorithm.
|
static boolean |
isUsingNonDefaultPort(URI uri)
Returns true if the specified URI is using a non-standard port (i.e.
|
GeneratePresignGetCallerIdentityResponse |
presignRequest(io.lakefs.auth.GeneratePresignGetCallerIdentityRequest input) |
protected com.amazonaws.auth.AWSCredentials |
sanitizeCredentials(com.amazonaws.auth.AWSCredentials credentials)
Loads the individual access key ID and secret key from the specified
credentials, ensuring that access to the credentials is synchronized on
the credentials object itself, and trimming any extra whitespace from the
credentials.
|
protected byte[] |
sign(byte[] data,
byte[] key,
com.amazonaws.auth.SigningAlgorithm algorithm) |
byte[] |
sign(String stringData,
byte[] key,
com.amazonaws.auth.SigningAlgorithm algorithm) |
static String |
urlEncode(String value,
boolean path)
Encode a string for use in the path of a URL; uses URLEncoder.encode,
(which encodes a string for use in the query portion of a URL), then
applies some postfilters to fix things up per the RFC.
|
public byte[] sign(String stringData, byte[] key, com.amazonaws.auth.SigningAlgorithm algorithm) throws com.amazonaws.AmazonClientException
com.amazonaws.AmazonClientExceptionprotected byte[] sign(byte[] data,
byte[] key,
com.amazonaws.auth.SigningAlgorithm algorithm)
throws com.amazonaws.AmazonClientException
com.amazonaws.AmazonClientExceptionpublic byte[] hash(String text) throws com.amazonaws.AmazonClientException
text - The string to hash.com.amazonaws.AmazonClientException - If the hash cannot be computed.protected String getCanonicalizedQueryString(Map<String,String> parameters)
The canonicalized query string is formed by first sorting all the query string parameters, then URI encoding both the key and value and then joining them, in order, separating key value pairs with an '&'.
parameters - The query string parameters to be canonicalized.protected com.amazonaws.auth.AWSCredentials sanitizeCredentials(com.amazonaws.auth.AWSCredentials credentials)
Returns either a BasicSessionCredentials or a
BasicAWSCredentials object, depending on the input type.
credentials - protected Date getSignatureDate(int timeOffset)
public static String getDateStamp(long dateMilli)
public static String getTimeStamp(long dateMilli)
protected String getCanonicalizedHeaderString(Map<String,String> requestHeaders)
protected String getCanonicalRequest(String httpMethod, Map<String,String> parameters, Map<String,String> headers, String contentSha256)
protected String getStringToSign(String algorithm, String dateTime, String scope, String canonicalRequest)
public static String urlEncode(String value, boolean path)
value - the value to encodepath - true if the value is intended to represent a pathpublic static boolean isUsingNonDefaultPort(URI uri)
uri - public GeneratePresignGetCallerIdentityResponse presignRequest(io.lakefs.auth.GeneratePresignGetCallerIdentityRequest input)
presignRequest in interface STSGetCallerIdentityPresignerCopyright © 2024. All rights reserved.