TritonDataCenter / python-manta

Python SDK for Manta (community maintained)
MIT License
25 stars 18 forks source link

proper URI encoding (RFC3986) #9

Closed trentm closed 11 years ago

trentm commented 11 years ago

see MANTA-1593 for manta general ticket on this.

trentm commented 11 years ago

it is "wrong" now:

$ m -v put -v test%ing tmp/enc/
...
mantash: INFO: put test%ing /trentm/stor/tmp/enc/test%ing  # application/octet-stream
manta.client: DEBUG: PutObject '/trentm/stor/tmp/enc/test%ing'
manta.auth: DEBUG: sign 'date: Wed, 26 Jun 2013 20:14:24 GMT' with agent key (...)
manta.client: DEBUG: req: PUT /trentm/stor/tmp/enc/test%ing
    host: us-east.manta.joyent.com
    headers: {'accept-encoding': 'gzip, deflate',
     'authorization': 'Signature keyId=...',
     'content-length': '23',
     'content-md5': 'kI1pVL/JU3Rk8Q5UVStzww==',
     'content-type': 'application/octet-stream',
     'date': 'Wed, 26 Jun 2013 20:14:24 GMT',
     'user-agent': 'mantash/1.4.0 (darwin) Python/2.6.6'}
    body: testing % url encoding

manta.client: DEBUG: res: PUT /trentm/stor/tmp/enc/test%ing
    {'connection': 'keep-alive',
     'date': 'Wed, 26 Jun 2013 20:14:27 GMT',
     'etag': '16b73451-a90c-4ba4-a0f6-81b95dce96e9',
     'last-modified': 'Wed, 26 Jun 2013 20:14:27 GMT',
     'server': 'Manta',
     'status': '204',
     'x-request-id': '00b77130-de9d-11e2-8f08-85b558099e24',
     'x-response-time': '202',
     'x-server-name': '4b35fd3c-55aa-4dff-b859-5597d5e59a51'}
trentm commented 11 years ago

working patch: https://gist.github.com/trentm/f98a3e58feb3c9547474

trentm commented 11 years ago

Will be right once servers are switched over:

$ mantash -v put -v test%ing tmp/enc/
...

mantash: INFO: put test%ing /trentm/stor/tmp/enc/test%ing  # application/octet-stream
manta.client: DEBUG: PutObject '/trentm/stor/tmp/enc/test%ing'
manta.auth: DEBUG: sign 'date: Mon, 08 Jul 2013 18:32:46 GMT' with agent key (algo rsa-sha1, fp b3:f0:a1:6c:18:3b:47:63:ae:6e:57:22:74:71:d4:bc)
manta.client: DEBUG: req: PUT /trentm/stor/tmp/enc/test%25ing
    host: us-east.manta.joyent.com
    headers: {'accept-encoding': 'gzip, deflate',
     'authorization': 'Signature keyId="/trentm/keys/b3:f0:a1:6c:18:3b:47:63:ae:6e:57:22:74:71:d4:bc",algorithm="rsa-sha1",signature="Lus+Vurx7qIB9SgodRswojNdJFgFQIdZZ6hT8QYmIhhsMJaeZWYSPrRwidMHUM2c2SV5sxbx0DaQUi4qQugG8nhcQjlmrBrve05x8m85j7FhRg1feCiRKU2oFRjYOMXCSB4m7Y8cWnCkemNXqq2VkaRlBHNHI5KMklwU1iqgCxv0dITAe2e/M2I5aFHEh2qMllSAkUP9iJeLVALiO759E0JDOLJx2turPfCLjhRweOAwCTs/J9wO8nwawLDz6ZxgEzGls3k3+e4bNOTS6+FRhIJJtZPG20cqTQ0BUTC6A5uLhAiDlx6mWhEl9Yv90WHCqZio2A9/CKzAqTP8dosF1g=="',
     'content-length': '10',
     'content-md5': 'al+569bI6n77U9BxBT73eA==',
     'content-type': 'application/octet-stream',
     'date': 'Mon, 08 Jul 2013 18:32:46 GMT',
     'user-agent': 'mantash/1.4.1 (darwin) Python/2.6.6'}
    body: blah blah

manta.client: DEBUG: res: PUT /trentm/stor/tmp/enc/test%25ing
    {'connection': 'keep-alive',
     'date': 'Mon, 08 Jul 2013 18:32:45 GMT',
     'etag': 'ef2baf41-baf0-4abd-bba6-12f988c7fc6d',
     'last-modified': 'Mon, 08 Jul 2013 18:32:45 GMT',
     'server': 'Manta',
     'status': '204',
     'x-request-id': 'c8338290-e7fc-11e2-b31a-e7daf5289671',
     'x-response-time': '39',
     'x-server-name': '60771e58-2ad0-4c50-8b23-86b72f9307f8'}
trentm commented 11 years ago

This is in python-manta/mantash v1.5.0