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

Fix URL quoting for collection info #72

Merged
merged 5 commits into from
Jul 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions changelogs/fragments/72-fix-url-quoting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
minor_changes:
- the minimum required version of ``dohq-artifactory`` is now ``v0.9.0`` (https://github.com/briantist/galactory/pull/72).

bugfixes:
- traceback when publishing or retrieving a previously published collection (even by proxying) whose metadata contains certain characters that need to be URL quoted (https://github.com/briantist/galactory/issues/58, https://github.com/briantist/galactory/issues/52).

known_issues:
- any collections already published with malformed metadata due to the bug in ``collection_info`` will not be fixed and will need to be re-published or have their collection info repaired (https://github.com/briantist/galactory/pull/72).
2 changes: 1 addition & 1 deletion galactory/upstream.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
cache.update()
json.dump(cache._to_serializable_dict(), buffer, default=DateTimeIsoFormatJSONProvider.default)
buffer.seek(0)
path.deploy(buffer)
path.deploy(buffer, quote_parameters=True)

Check warning on line 148 in galactory/upstream.py

View check run for this annotation

Codecov / codecov/patch

galactory/upstream.py#L148

Added line #L148 was not covered by tests

@contextmanager
def proxy_download(self, request):
Expand Down
9 changes: 8 additions & 1 deletion galactory/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,14 @@
params = {}

try:
artifact.deploy(tmpfile.handle, md5=tmpfile.md5, sha1=tmpfile.sha1, sha256=tmpfile.sha256, parameters=params)
artifact.deploy(

Check warning on line 263 in galactory/utilities.py

View check run for this annotation

Codecov / codecov/patch

galactory/utilities.py#L263

Added line #L263 was not covered by tests
tmpfile.handle,
md5=tmpfile.md5,
sha1=tmpfile.sha1,
sha256=tmpfile.sha256,
parameters=params,
quote_parameters=True
)
except ArtifactoryException as exc:
cause = exc.__cause__
current_app.logger.debug(cause)
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
dohq-artifactory>=0.8,<0.9
dohq-artifactory>=0.9,<0.10
Flask>=2.1,<3
semver>=2,<3
base64io>=1,<2
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ zip_safe = True
include_package_data = True
python_requires = >= 3.6
install_requires =
dohq-artifactory>=0.8,<0.9
dohq-artifactory>=0.9,<0.10
Flask>=2.1,<3
semver>=2,<3
base64io>=1,<2
Expand Down