ChenSammi commented on code in PR #9674:
URL: https://github.com/apache/ozone/pull/9674#discussion_r2734681514


##########
hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3sts/S3STSEndpoint.java:
##########
@@ -189,53 +181,86 @@ private int validateDuration(Integer durationSeconds) 
throws IllegalArgumentExce
     return durationSeconds;
   }
 
-  private Response handleAssumeRole(String roleArn, String roleSessionName, 
int duration, String awsIamSessionPolicy)
-      throws IOException, OS3Exception {
-    // Validate required parameters for AssumeRole. RoleArn is required
+  private Response handleAssumeRole(String roleArn, String roleSessionName, 
Integer durationSeconds,
+      String awsIamSessionPolicy, String version, String requestId) throws 
IOException, OSTSException {
+    // Validate parameters
+    final String action = "AssumeRole";
+    int duration;
+    try {
+      duration = validateDuration(durationSeconds);
+    } catch (IllegalArgumentException e) {
+      throw new OSTSException("ValidationError", e.getMessage(), 
BAD_REQUEST.getStatusCode());
+    }
+
+    if (version == null || !version.equals("2011-06-15")) {
+      throw new OSTSException(
+          "InvalidAction", "Could not find operation " + action + " for 
version " +
+          (version == null ? "NO_VERSION_SPECIFIED" : version), 
BAD_REQUEST.getStatusCode());

Review Comment:
   Can we add the expected version number to the error message? 



-- 
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]

Reply via email to