Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

url quote collection info #59

Closed

Conversation

jcox10
Copy link
Contributor

@jcox10 jcox10 commented Mar 10, 2023

Use urllib.parse.quote to encode any special characters in the collection info. Prevents any query string parameters in the collection info from getting interpreted by Artifactory.

Fixes: #58
Fixes: #52
Closes: #54

@jcox10
Copy link
Contributor Author

jcox10 commented Mar 10, 2023

Closes #59

@codecov
Copy link

codecov bot commented Mar 10, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.15 🎉

Comparison is base (d4414c0) 56.59% compared to head (67df068) 56.75%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #59      +/-   ##
==========================================
+ Coverage   56.59%   56.75%   +0.15%     
==========================================
  Files          26       26              
  Lines         947      948       +1     
==========================================
+ Hits          536      538       +2     
+ Misses        411      410       -1     
Impacted Files Coverage Δ
galactory/utilities.py 45.94% <100.00%> (+1.04%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@briantist briantist self-assigned this Mar 11, 2023
@briantist briantist added the bug Something isn't working label Mar 11, 2023
@briantist briantist added this to the v0.9.1 milestone Mar 11, 2023
@briantist
Copy link
Owner

ah ha! Great find. The only other thing I want to look into is more of a curiosity: why I am not seeing the issue in my own environment? I wonder if it's because of my reverse proxy configuration or something else. Going to take a look at that before merging just in case I find something that might effect this. Also it could help me come up with tests that would've caught this.

Thanks very much for putting this up!

@jcox10
Copy link
Contributor Author

jcox10 commented Mar 11, 2023

Yeah that is odd, it could be the reverse proxy. I'm using nginx 1.20 with Artifactory 7.55.

@briantist
Copy link
Owner

briantist commented Mar 12, 2023

@jcox10 @mamercad ok! So I think I figured out what's going on in my environment: due to a different issue, I have used the fallback property option described here: https://github.com/briantist/galactory/blob/main/CHANGELOG.rst#v0-7-0

Since this option sets properties in a POST it is unaffected by this quoting issue. I have recently switched to not using the fallback, but since I've already had the Windows and AWS collections that you're both referencing uploaded to my Artifactory, I did not see any issues (I will see them as soon as the next version of those arrives and I attempt to publish it).

The good news is that means there's an existing option you can both use to work around the issue.

The bad news is that this thickens the plot: this issue should be addressed in the artifactory library first, and I've opened this issue for it (please upvote 👍):

So this PR as written currently would break the fallback mechanism, because it will add encodings to the properties on POST which will end up as literals.

But even if we change it to only encode on non-fallback, we'll have the same problem if/when the artifactory library decides to do the same thing.

So I want to get an answer from them first on whether they expect clients to encode their own matrix parameter values, or whether they will make/accept a change to do that encoding.

Their answer will change how we implement it here.

If there's no quick definitive answer or resolution, we may implement it here anyway, possible behind yet another option, or maybe with some other guard in place.


In the meantime, could you both check to see if using the property fallback works for you? If there's some issue with it I haven't realized that prevents it from working for you, I'd like to know that too.

@jcox10
Copy link
Contributor Author

jcox10 commented Mar 13, 2023

That's a good point, this should be fixed the the artifactory library since it is making the http call. Using the fallback property works for me.

@briantist briantist removed this from the v0.9.1 milestone Jul 1, 2023
@briantist briantist closed this in #72 Jul 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

JSON error getting ansible.windows collection versions Traceback when publishing amazon.aws
2 participants