All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Swift: Set Content-Length when requesting/checking Keystone tokens
@ 2015-04-25 16:38 Herve Rousseau
  2015-04-27  6:38 ` Herve Rousseau
  2015-04-27 15:35 ` Yehuda Sadeh-Weinraub
  0 siblings, 2 replies; 3+ messages in thread
From: Herve Rousseau @ 2015-04-25 16:38 UTC (permalink / raw)
  To: ceph-devel; +Cc: Hervé Rousseau

From: Hervé Rousseau <hroussea@cern.ch>

Running Keystone with WSGIChunkedRequest=On is not supported.

We have to make sure that we set the Content-Length header when getting
an admin token and checking revoked tokens, otherwise Keystone returns
a HTTP 411 error.

Same applies when checking revoked tickets.

Signed-off-by: Hervé Rousseau <hroussea@cern.ch>
---
 src/rgw/rgw_swift.cc |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/rgw/rgw_swift.cc b/src/rgw/rgw_swift.cc
index 76f21ee..a08d944 100644
--- a/src/rgw/rgw_swift.cc
+++ b/src/rgw/rgw_swift.cc
@@ -269,6 +269,7 @@ int	RGWSwift::get_keystone_admin_token(std::string& token)
     std::stringstream ss;
     jf.flush(ss);
     token_req.set_post_data(ss.str());
+    token_req.set_send_length(ss.str().length());
     int ret = token_req.process("POST", token_url.c_str());
     if (ret < 0)
       return ret;
@@ -296,6 +297,7 @@ int RGWSwift::check_revoked()
     return -EINVAL;
   url.append("v2.0/tokens/revoked");
   req.append_header("X-Auth-Token", token);
+  req.set_send_length(0);
   int ret = req.process(url.c_str());
   if (ret < 0)
     return ret;
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] Swift: Set Content-Length when requesting/checking Keystone tokens
  2015-04-25 16:38 [PATCH] Swift: Set Content-Length when requesting/checking Keystone tokens Herve Rousseau
@ 2015-04-27  6:38 ` Herve Rousseau
  2015-04-27 15:35 ` Yehuda Sadeh-Weinraub
  1 sibling, 0 replies; 3+ messages in thread
From: Herve Rousseau @ 2015-04-27  6:38 UTC (permalink / raw)
  To: ceph-devel

On 25/04/15 18:38 +0200, Herve Rousseau wrote:
> From: Hervé Rousseau <hroussea@cern.ch>
> 
> Running Keystone with WSGIChunkedRequest=On is not supported.
> 
> We have to make sure that we set the Content-Length header when getting
> an admin token and checking revoked tokens, otherwise Keystone returns
> a HTTP 411 error.
> 
> Same applies when checking revoked tickets.
> 
> Signed-off-by: Hervé Rousseau <hroussea@cern.ch>

[snip]

Hi all,

We identified this issue when doing some integration tests with Keystone and
user/password authentication instead of using the admin token, it's related
to http://tracker.ceph.com/issues/7796.

We followed the aforementioned bug report and directives but then keystone
wouldn't work because they won't support Chunked encoding as their documentation
now reflects: 
 https://git.openstack.org/cgit/openstack/keystone/commit/?id=05c01e26d1e62298489ba3894576faf3c352e2c9

Cheers, 

-- 
Hervé Rousseau
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Swift: Set Content-Length when requesting/checking Keystone tokens
  2015-04-25 16:38 [PATCH] Swift: Set Content-Length when requesting/checking Keystone tokens Herve Rousseau
  2015-04-27  6:38 ` Herve Rousseau
@ 2015-04-27 15:35 ` Yehuda Sadeh-Weinraub
  1 sibling, 0 replies; 3+ messages in thread
From: Yehuda Sadeh-Weinraub @ 2015-04-27 15:35 UTC (permalink / raw)
  To: Herve Rousseau; +Cc: ceph-devel

This looks good. Can you send a pull request to the ceph github repository?

Thanks,
Yehuda

----- Original Message -----
> From: "Herve Rousseau" <hroussea@cern.ch>
> To: ceph-devel@vger.kernel.org
> Cc: "Hervé Rousseau" <hroussea@cern.ch>
> Sent: Saturday, April 25, 2015 9:38:58 AM
> Subject: [PATCH] Swift: Set Content-Length when requesting/checking Keystone tokens
> 
> From: Hervé Rousseau <hroussea@cern.ch>
> 
> Running Keystone with WSGIChunkedRequest=On is not supported.
> 
> We have to make sure that we set the Content-Length header when getting
> an admin token and checking revoked tokens, otherwise Keystone returns
> a HTTP 411 error.
> 
> Same applies when checking revoked tickets.
> 
> Signed-off-by: Hervé Rousseau <hroussea@cern.ch>
> ---
>  src/rgw/rgw_swift.cc |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/src/rgw/rgw_swift.cc b/src/rgw/rgw_swift.cc
> index 76f21ee..a08d944 100644
> --- a/src/rgw/rgw_swift.cc
> +++ b/src/rgw/rgw_swift.cc
> @@ -269,6 +269,7 @@ int	RGWSwift::get_keystone_admin_token(std::string&
> token)
>      std::stringstream ss;
>      jf.flush(ss);
>      token_req.set_post_data(ss.str());
> +    token_req.set_send_length(ss.str().length());
>      int ret = token_req.process("POST", token_url.c_str());
>      if (ret < 0)
>        return ret;
> @@ -296,6 +297,7 @@ int RGWSwift::check_revoked()
>      return -EINVAL;
>    url.append("v2.0/tokens/revoked");
>    req.append_header("X-Auth-Token", token);
> +  req.set_send_length(0);
>    int ret = req.process(url.c_str());
>    if (ret < 0)
>      return ret;
> --
> 1.7.1
> 
> --
> To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-04-27 15:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-25 16:38 [PATCH] Swift: Set Content-Length when requesting/checking Keystone tokens Herve Rousseau
2015-04-27  6:38 ` Herve Rousseau
2015-04-27 15:35 ` Yehuda Sadeh-Weinraub

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.