]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: Proper result for XML formatting.
authorPritha Srivastava <prsrivas@redhat.com>
Fri, 7 Sep 2018 06:58:03 +0000 (12:28 +0530)
committerPritha Srivastava <prsrivas@redhat.com>
Fri, 21 Sep 2018 05:39:33 +0000 (11:09 +0530)
Signed-off-by: Pritha Srivastava <prsrivas@redhat.com>
src/rgw/rgw_rest_sts.cc

index ef6ec70c9d3e6efabb1abd1883dadbfc8b3ce8a4..91d14830308e524c1b5584844838b036b0eff136 100644 (file)
@@ -107,9 +107,13 @@ void RGWSTSGetSessionToken::execute()
   op_ret = std::move(ret);
   //Dump the output
   if (op_ret == 0) {
+    s->formatter->open_object_section("GetSessionTokenResponse");
+    s->formatter->open_object_section("GetSessionTokenResult");
     s->formatter->open_object_section("Credentials");
     creds.dump(s->formatter);
     s->formatter->close_section();
+    s->formatter->close_section();
+    s->formatter->close_section();
   }
 }
 
@@ -154,11 +158,15 @@ void RGWSTSAssumeRole::execute()
   op_ret = std::move(ret);
   //Dump the output
   if (op_ret == 0) {
+    s->formatter->open_object_section("AssumeRoleResponse");
+    s->formatter->open_object_section("AssumeRoleResult");
     s->formatter->open_object_section("AssumeRole");
     assumedRoleUser.dump(s->formatter);
     creds.dump(s->formatter);
     encode_json("PackedPolicySize", packedPolicySize , s->formatter);
     s->formatter->close_section();
+    s->formatter->close_section();
+    s->formatter->close_section();
   }
 }
 
@@ -181,7 +189,7 @@ int RGWHandler_REST_STS::init(RGWRados *store,
 {
   s->dialect = "sts";
 
-  if (int ret = RGWHandler_REST_STS::init_from_header(s, RGW_FORMAT_JSON, true); ret < 0) {
+  if (int ret = RGWHandler_REST_STS::init_from_header(s, RGW_FORMAT_XML, true); ret < 0) {
     ldout(s->cct, 10) << "init_from_header returned err=" << ret <<  dendl;
     return ret;
   }