Skip to content

Commit

Permalink
Fix URL quoting for collection info (#72)
Browse files Browse the repository at this point in the history
* bump dohq-artifactory

* quote URL parameters

* bump dohq-artifactory in setup.cfg

* add changelog fragment

* update changelog fragment
  • Loading branch information
briantist authored Jul 5, 2023
1 parent 17b9823 commit 525321c
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 4 deletions.
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 @@ def _set_cache(self, request, cache) -> None:
cache.update()
json.dump(cache._to_serializable_dict(), buffer, default=DateTimeIsoFormatJSONProvider.default)
buffer.seek(0)
path.deploy(buffer)
path.deploy(buffer, quote_parameters=True)

@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 @@ def upload_collection_from_hashed_tempfile(artifact: ArtifactoryPath, tmpfile: H
params = {}

try:
artifact.deploy(tmpfile.handle, md5=tmpfile.md5, sha1=tmpfile.sha1, sha256=tmpfile.sha256, parameters=params)
artifact.deploy(
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

0 comments on commit 525321c

Please sign in to comment.