<div dir="ltr">Hi,<div><br></div><div>at the end I figured the problem out. It was the very same bug of the python-swiftclient, missing encoding for utf-8.</div><div>I encoded the hmac_body with utf8 (but not URI encoding) and the tempURL is now valid!</div><div><br></div><div>Thank you for the support!</div><div>Best</div><div>Antonio</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jun 29, 2016 at 9:40 PM, Antonio Calanducci <span dir="ltr"><<a href="mailto:antonio.calanducci@ct.infn.it" target="_blank">antonio.calanducci@ct.infn.it</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><div dir="ltr">Hi Tim,<div><br></div><div>thank you. I have modified my local python swift client according the diff on your patch and now I can generate tempURL on python2.7 too.</div><div><br></div><div>I have noticed a bizzarre thing now. Trying to use CURL to download the generated tempURL, using a utf8 filename ("Monè.txt"), the download works fine if I copy and paste the filename from "swift list" output, but if I type the filename with my keyboard, it doesn't work anymore. Same "è" character, not sure why. Maybe the key I type on the keyboard has a different encoding than the one from the "swift list" output?</div><div><br></div><div>I have also a second question, related to filename that contains spaces. I should not need to URL encode (with %20) the path to generate the tempURL, but I should encode when doing the actual upload, correct?</div><div><br></div><div>Actually the code that generates the tempURL is a Node.js script written in JavaScript. Probably I am not doing correctly the encodings (as far as I know I should not encode anything in Node.js because of the native support). Do you have any JS sample code for tempURL generation or any hints I should follow to properly generate the tempURL?</div><div><br></div><div>thank you in advance</div><div>Best</div><div>Antonio</div><div><br></div><div><br></div><div><p><span><br></span></p><p><span><br></span></p><p><span><br></span></p></div>







<div><br></div><div><br></div></div></span><div class="gmail_extra"><br><div class="gmail_quote"><span class="">On Wed, Jun 29, 2016 at 8:27 PM, Tim Burke <span dir="ltr"><<a href="mailto:tim@swiftstack.com" target="_blank">tim@swiftstack.com</a>></span> wrote:<br></span><div><div class="h5"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Antonio,<br>
<br>
That sounds like a bug! Looks like we decode the temporal key coming in from the terminal, but don't properly encode it when getting the HMAC. This generates the UnicodeEncodeError on python 2.7, and I've submitted <a href="https://review.openstack.org/#/c/335615/" rel="noreferrer" target="_blank">https://review.openstack.org/#/c/335615/</a> to address this.<br>
<br>
I'm not sure about what's going on with the temporal generated on python 3, though. FWIW, I'll often forget whether it's supposed to be X-Container-Meta-Temp-Url-Key or X-Container-Meta-Tempurl-Key. (For reference, use the first one.) Maybe that's the issue?<br>
<br>
Tim<br>
<div><div><br>
> On Jun 29, 2016, at 10:06 AM, Dr Antonio Calanducci <<a href="mailto:antonio.calanducci@ct.infn.it" target="_blank">antonio.calanducci@ct.infn.it</a>> wrote:<br>
><br>
> Hi,<br>
><br>
> I hope this is the right mailing list to ask this question. In case it's not, please direct me to the right one and apologise.<br>
><br>
> I have some files stored in a container the use german character (and in general non ascii character).<br>
> Using the swift REST APIs and python-swiftclient (3.0.0) download/upload command I have no problem to handle them.<br>
><br>
> But when I try to generate tempurl for some of them with python-swiftclient, I got errors if I use python 2.7. By the way, switching to python3 I can generate properly the tempurl, but the URL is actually not working generating a 401 error.<br>
><br>
> Looking at the github repo it seems there is utf8 support for the tempurl key, but I am not sure if you support unicode for path too. I am currently using swift 2.2.0 on the server.<br>
><br>
> I read in the docs that I should not encode the path while generating the tempurl, but only to actually retrieve from the generate url.<br>
><br>
> Could you confirm or not that filename with unicode chars are supported and if so in which version?<br>
><br>
> thanks a lot for the attention<br>
> All the best<br>
> Antonio<br>
><br>
> --<br>
><br>
> Dr. Antonio Calanducci, PhD<br>
> INFN Catania<br>
><br>
> Office:    <a href="tel:%2B39%20095%203785519" value="+390953785519" target="_blank">+39 095 3785519</a><br>
> Mobile:  <a href="tel:%2B39%20349%206762534" value="+393496762534" target="_blank">+39 349 6762534</a><br>
> Skype:   tcaland<br>
><br>
> <a href="mailto:antonio.calanducci@ct.infn.it" target="_blank">antonio.calanducci@ct.infn.it</a><br>
> <a href="mailto:calanducci@unict.it" target="_blank">calanducci@unict.it</a><br>
><br>
><br>
><br>
><br>
><br>
><br>
</div></div>> __________________________________________________________________________<br>
> OpenStack Development Mailing List (not for usage questions)<br>
> Unsubscribe: <a href="http://OpenStack-dev-request@lists.openstack.org?subject:unsubscribe" rel="noreferrer" target="_blank">OpenStack-dev-request@lists.openstack.org?subject:unsubscribe</a><br>
> <a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" rel="noreferrer" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
<br>
<br>
__________________________________________________________________________<br>
OpenStack Development Mailing List (not for usage questions)<br>
Unsubscribe: <a href="http://OpenStack-dev-request@lists.openstack.org?subject:unsubscribe" rel="noreferrer" target="_blank">OpenStack-dev-request@lists.openstack.org?subject:unsubscribe</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" rel="noreferrer" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
</blockquote></div></div></div><br><br clear="all"><div><br></div>-- <br><div data-smartmail="gmail_signature"><div dir="ltr"><div><div class="h5">Dr. <b>Antonio Calanducci</b>, PhD<div><font face="tahoma, sans-serif">INFN Catania</font></div></div></div><span class=""><div><font face="tahoma, sans-serif">Dipartimento di Fisica e Astronomia - Università di Catania</font></div><div><i>Via Santa Sofia, 64</i></div><div><i>95128 Catania (IT)</i></div><div><br></div><div><font face="tahoma, sans-serif">O : <a href="tel:%2B39%20095%20378%205519" value="+390953785519" target="_blank">+39 095 378 5519</a></font></div></span><div><font face="tahoma, sans-serif">M:  <a href="tel:%2B39%20349%206762534" value="+393496762534" target="_blank">+39 349 6762534</a></font></div><div><font face="tahoma, sans-serif">Skype: tcaland</font></div><div><br></div></div></div>
</div>
<br>__________________________________________________________________________<br>
OpenStack Development Mailing List (not for usage questions)<br>
Unsubscribe: <a href="http://OpenStack-dev-request@lists.openstack.org?subject:unsubscribe" rel="noreferrer" target="_blank">OpenStack-dev-request@lists.openstack.org?subject:unsubscribe</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" rel="noreferrer" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Dr. <b>Antonio Calanducci</b>, PhD<div><font face="tahoma, sans-serif">INFN Catania</font></div><div><font face="tahoma, sans-serif">Dipartimento di Fisica e Astronomia - Università di Catania</font></div><div><i>Via Santa Sofia, 64</i></div><div><i>95128 Catania (IT)</i></div><div><br></div><div><font face="tahoma, sans-serif">O : +39 095 378 5519</font></div><div><font face="tahoma, sans-serif">M:  +39 349 6762534</font></div><div><font face="tahoma, sans-serif">Skype: tcaland</font></div><div><br></div></div></div>
</div>