You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@jclouds.apache.org by Mat Mannion <no...@github.com> on 2017/04/03 13:54:38 UTC

[jclouds/jclouds] JCLOUDS-1263: URL encode object names from list object response before creating URIs with them (#1084)

This fix calls urlEncode on the path before appending them to the existing path, as the core UriBuilder
class expects them to be URL-encoded.

I'm not overly enamoured with this fix, it seems wasteful to encode something for it to be immediately decoded, but equally I'm nervous about making changes to jclouds-core and this seemed to be the easiest drop-in fix for the underlying issue.
You can view, comment on, or merge this pull request online at:

  https://github.com/jclouds/jclouds/pull/1084

-- Commit Summary --

  * JCLOUDS-1263: URL encode object names from list object response before creating URIs with them

-- File Changes --

    M apis/openstack-swift/src/main/java/org/jclouds/openstack/swift/v1/functions/ParseObjectListFromResponse.java (5)
    M apis/openstack-swift/src/test/java/org/jclouds/openstack/swift/v1/features/ObjectApiMockTest.java (4)
    M apis/openstack-swift/src/test/resources/object_list.json (2)

-- Patch Links --

https://github.com/jclouds/jclouds/pull/1084.patch
https://github.com/jclouds/jclouds/pull/1084.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/1084

Re: [jclouds/jclouds] JCLOUDS-1263: URL encode object names from list object response before creating URIs with them (#1084)

Posted by Andrew Gaul <no...@github.com>.
@matmannion Can you look at some of the earlier URL encoding commits to see if there is a better solution?  @timuralp fixed a lot of these issues in [JCLOUDS-217](https://issues.apache.org/jira/browse/JCLOUDS-217).

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/1084#issuecomment-291394897

Re: [jclouds/jclouds] JCLOUDS-1263: URL encode object names from list object response before creating URIs with them (#1084)

Posted by Andrew Gaul <no...@github.com>.
@matmannion Can you verify that the test does what you expect?  `mvn integration-test -pl :rackspace-cloudfiles-us -Plive -Dtest=CloudFilesUSObjectApiLiveTest#testCreateAndListWithUnicodeCharacters` succeeds with and without your fix.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/1084#issuecomment-291591048

Re: [jclouds/jclouds] JCLOUDS-1263: URL encode object names from list object response before creating URIs with them (#1084)

Posted by Mat Mannion <no...@github.com>.
@andrewgaul I don't have any updates, no - I'm not in a position to come back and look at this at the moment unfortunately.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/1084#issuecomment-326913242

Re: [jclouds/jclouds] JCLOUDS-1263: URL encode object names from list object response before creating URIs with them (#1084)

Posted by Andrew Gaul <no...@github.com>.
Pushed to master as 14621c08d70c3f128d7d1a81149fc88f43c61c95 and 29655f3149f151a834ed5a724e91e32994b28d89 and 2.1.x as 4288c9eb7f3d920eb24af8da006b8c32f1cff703 and d464e8a3704a780f7bec4873bce905413f987faa.  Sorry for the delay; I misunderstood the Travis failures and missed the added tests.  Thank you for your contribution @matmannion and thanks @timuralp for pushing this through!

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/1084#issuecomment-390868187

Re: [jclouds/jclouds] JCLOUDS-1263: URL encode object names from list object response before creating URIs with them (#1084)

Posted by Timur Alperovich <no...@github.com>.
@gaul I'd like to resurrect this PR and apologies for the delay. I think this is the right thing to do for Swift, as listings will return non-ASCII UTF-8 characters not URL encoded, but escaped as "\uXXXX". I'm curious if the same issue exists when listing the containers -- I'll look into that tomorrow.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/1084#issuecomment-388724490

Re: [jclouds/jclouds] JCLOUDS-1263: URL encode object names from list object response before creating URIs with them (#1084)

Posted by Timur Alperovich <no...@github.com>.
Checked out the container listings. We don't have the same issue, as we don't attempt to build URIs from them. We should merge this PR to fix this issue in Swift.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/1084#issuecomment-390530613

Re: [jclouds/jclouds] JCLOUDS-1263: URL encode object names from list object response before creating URIs with them (#1084)

Posted by Andrew Gaul <no...@github.com>.
@stevegomez17 Please stop adding irrelevant comments to jclouds pull requests.  I have been deleting these.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/1084#issuecomment-332682134

Re: [jclouds/jclouds] JCLOUDS-1263: URL encode object names from list object response before creating URIs with them (#1084)

Posted by Mat Mannion <no...@github.com>.
@andrewgaul I've added an integration test against live. I looked through the commits from JCLOUDS-217 and there doesn't seem to be anything that jumps out as an obvious better solution; I note that @timuralp himself made [an identical change to OldSwift](https://git-wip-us.apache.org/repos/asf?p=jclouds.git;a=blobdiff;f=apis/swift/src/main/java/org/jclouds/openstack/swift/functions/ParseObjectInfoListFromJsonResponse.java;h=485408aa048da19dc70f8fe1ffbbcbb55ce3f7ce;hp=b2e65a3fe37b799e0c41e8d1424c3187b828a1fb;hb=2c2b498;hpb=7151a3875ba46e768a368d534ecbaa2bb43acb14) and this change effectively ports that to NewSwift.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/1084#issuecomment-291493446

Re: [jclouds/jclouds] JCLOUDS-1263: URL encode object names from list object response before creating URIs with them (#1084)

Posted by Andrew Gaul <no...@github.com>.
@timuralp Do you have any insight into this issue?  Otherwise we can close this pull request.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/1084#issuecomment-331726071

Re: [jclouds/jclouds] JCLOUDS-1263: URL encode object names from list object response before creating URIs with them (#1084)

Posted by Timur Alperovich <no...@github.com>.
@andrewgaul I will try to looking into it this weekend and report back.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/1084#issuecomment-332659235

Re: [jclouds/jclouds] JCLOUDS-1263: URL encode object names from list object response before creating URIs with them (#1084)

Posted by Andrew Gaul <no...@github.com>.
@matmannion Any updates on this pull request?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/1084#issuecomment-326688942

Re: [jclouds/jclouds] JCLOUDS-1263: URL encode object names from list object response before creating URIs with them (#1084)

Posted by Mat Mannion <no...@github.com>.
@andrewgaul I haven't had chance to go back and look at this, but I was testing against a DevStack instance with the following:

    mvn integration-test -pl :openstack-swift -Plive -Dtest.openstack-swift.endpoint="http://137.205.194.8:5000/identity/v2.0" -Dtest.openstack-swift.identity="demo:demo" -Dtest.openstack-swift.credential="secretadmin" -Dtest=ObjectApiLiveTest

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/1084#issuecomment-293874322

Re: [jclouds/jclouds] JCLOUDS-1263: URL encode object names from list object response before creating URIs with them (#1084)

Posted by Mat Mannion <no...@github.com>.
@matmannion pushed 1 commit.

23e8889  JCLOUDS-1263: Add live integration test for manipulating objects through the Swift ObjectApi with unicode characters in their path


-- 
You are receiving this because you are subscribed to this thread.
View it on GitHub:
https://github.com/jclouds/jclouds/pull/1084/files/ffe61fe6eaa469691fe69c35413720ca91485490..23e8889f4e1f1c129ee85ee029067173a2d87853

Re: [jclouds/jclouds] JCLOUDS-1263: URL encode object names from list object response before creating URIs with them (#1084)

Posted by Andrew Gaul <no...@github.com>.
Closed #1084.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/1084#event-1638433977

Re: [jclouds/jclouds] JCLOUDS-1263: URL encode object names from list object response before creating URIs with them (#1084)

Posted by Timur Alperovich <no...@github.com>.
I'm able to successfully run the tests locally. I'm not sure what the Travis failure was at the time, but I believe we should be able to rebase and merge this PR.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/1084#issuecomment-390796709

Re: [jclouds/jclouds] JCLOUDS-1263: URL encode object names from list object response before creating URIs with them (#1084)

Posted by stevegomez17 <no...@github.com>.
say thank you so much on have never really expressed that to you very well but you dont realize how much you have helped me out !!

Sent from my iPhone

On Sep 27, 2017, at 4:21 PM, Timur Alperovich <no...@github.com> wrote:

@andrewgaul I will try to looking into it this weekend and report back.

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.



-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/1084#issuecomment-332676081

Re: [jclouds/jclouds] JCLOUDS-1263: URL encode object names from list object response before creating URIs with them (#1084)

Posted by Zack Shoylev <no...@github.com>.
Looks good

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/1084#issuecomment-291242800

Re: [jclouds/jclouds] JCLOUDS-1263: URL encode object names from list object response before creating URIs with them (#1084)

Posted by Andrew Gaul <no...@github.com>.
@matmannion Can you add a test to `ContainerApiLiveTest`?  If you haven't run the integration tests before, you can do so via:

```
mvn integration-test -pl :openstack-swift -Plive -Dtest.rackspace-cloudfiles-us.identity="${JCLOUDS_IDENTITY}" -Dtest.rackspace-cloudfiles-us.credential="${JCLOUDS_CREDENTIAL}"
```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/1084#issuecomment-291394519