incubator-cloudstack-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Likitha Shetty" <likitha.she...@citrix.com>
Subject Re: Review Request: [EC2 Query API] Permission denied exception when a parameter value contains space
Date Tue, 12 Feb 2013 12:18:41 GMT

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/9230/
-----------------------------------------------------------

(Updated Feb. 12, 2013, 12:18 p.m.)


Review request for cloudstack and Prachi Damle.


Changes
-------

Thanks for the review Prachi.

I made the translation from %7E to ~ because according to rfc3986#section-2.4(http://tools.ietf.org/html/rfc3986#section-2.4),
older URI processing implementations encode tilde ("~") character to "%7E". But when i used
the Boto client i see that "~" is not encoded and there is no signature mismatch and so we
don't have to replace the character after URL encoding. I have now updated the diff to remove
'replace ~ by %7E'.

Manual testing
1. Make any EC2 Query API call with a space in the parameter value - the api call should be
successfully executed and throw an error 
2. Repeat the same for chararcter "*"
When tested without the patch both steps throw a Permission denied exception

Also note,
1. "*" is urlencoded to "*" but percent encoded to %2A
2. "space" is urlencode to "+" but percent encoded to %20


Description
-------

Convert space characters in the parameters to %20 while forming a query string after url-encode
because java.net.URLEncoder performs application/x-www-form-urlencoded-type encoding and not
percent-encoding. According to RFC 3986 as required by Amazon, we need to percent-encode.


This addresses bug CLOUDSTACK-1125.


Diffs (updated)
-----

  awsapi/src/com/cloud/bridge/service/EC2RestServlet.java 5d151ba 

Diff: https://reviews.apache.org/r/9230/diff/


Testing
-------

Make any EC2 Query API call with a space in the parameter value - the api call should be successfully
executed and throw an error 


Thanks,

Likitha Shetty


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message