steveloughran commented on code in PR #6550:
URL: https://github.com/apache/hadoop/pull/6550#discussion_r1669005552
##########
hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/Constants.java:
##########
@@ -775,6 +775,29 @@ private Constants() {
"fs.s3a." + Constants.AWS_SERVICE_IDENTIFIER_STS.toLowerCase()
+ ".signing-algorithm";
+ /** Prefix for S3A client-specific properties. */
Review Comment:
can you add an {@value} tag for this and the strings below, for better IDE
experience
##########
hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/impl/AWSClientConfig.java:
##########
@@ -407,6 +414,36 @@ private static void initSigner(Configuration conf,
}
}
+ /**
+ *
Review Comment:
need a title here
##########
hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/Constants.java:
##########
@@ -775,6 +775,29 @@ private Constants() {
"fs.s3a." + Constants.AWS_SERVICE_IDENTIFIER_STS.toLowerCase()
+ ".signing-algorithm";
+ /** Prefix for S3A client-specific properties. */
+ public static final String FS_S3A_CLIENT_PREFIX = "fs.s3a.client.";
+
+ /** Custom headers postfix. */
+ public static final String CUSTOM_HEADERS_POSTFIX = ".custom.headers";
+
+ /**
+ * List of custom headers to be set on the service client.
+ * Multiple parameters can be used to specify custom headers.
+ * fs.s3a.client.s3.custom.headers - headers to add on all the s3 requests.
+ * fs.s3a.client.sts.custom.headers - headers to add on all the sts requests.
+ * Examples
+ * CustomHeader {@literal ->} 'Header1:Value1'
+ * CustomHeaders {@literal ->} 'Header1=Value1:Value2,Header2=Value1'
+ */
+ public static final String CUSTOM_HEADERS_STS =
+ FS_S3A_CLIENT_PREFIX + Constants.AWS_SERVICE_IDENTIFIER_STS.toLowerCase()
Review Comment:
1. no `Constants` reference needed here or below
2. Use `toLowerCase(Locale. ROOT)` unless you want to field support calls
from unusual locales
##########
hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/impl/AWSClientConfig.java:
##########
@@ -407,6 +414,36 @@ private static void initSigner(Configuration conf,
}
}
+ /**
+ *
+ * @param conf hadoop configuration
+ * @param clientConfig client configuration to update
+ * @param awsServiceIdentifier service name
+ */
+ private static void initRequestHeaders(Configuration conf,
+ ClientOverrideConfiguration.Builder clientConfig, String
awsServiceIdentifier) {
+ String configKey = null;
+ switch (awsServiceIdentifier) {
+ case AWS_SERVICE_IDENTIFIER_S3:
+ configKey = CUSTOM_HEADERS_S3;
+ break;
+ case AWS_SERVICE_IDENTIFIER_STS:
+ configKey = CUSTOM_HEADERS_STS;
+ break;
+ default:
+ // Nothing to do. The original signer override is already setup
Review Comment:
comment is wrong. just say "no known service"
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]