Staging instance, all changes can be removed at any time

Skip to content

moderation: Maybe fix deposit url access to metadata

Related to swh/infra/sysadm-environment#4125 (closed)

Test Plan

in staging:

# initial log seen from the server coming from the staging webapp
Apr 08 08:44:34 deposit python3[2575354]: 2022-04-08 08:44:34 [2575354] gunicorn.access:INFO 127.0.0.1 - - [08/Apr/2022:08:44:34 +0000] "GET /1/private/1059/meta HTTP/1.1" 301 0 "-" "python-requests/2.25.1"
Apr 08 08:44:34 deposit python3[2575346]: 2022-04-08 08:44:34 [2575346] gunicorn.access:INFO 127.0.0.1 - - [08/Apr/2022:08:44:34 +0000] "GET /1/private/1058/meta HTTP/1.1" 301 0 "-" "python-requests/2.25.1"
# tryout to check the behavior
ardumont@deposit:~% curl -u $user:$pass https://deposit-rp.internal.staging.swh.network/1/private/4/meta  # <- does nothing (301)
ardumont@deposit:~% curl -u $user:$pass https://deposit-rp.internal.staging.swh.network/1/private/4/meta/  # displays stuff
{"origin": {"type": "deposit", "url": "https://www.softwareheritage.org/79c8c06b-3e50-4153-809b-83a5dec290d0"}, "provider": {"provider_name": "swh", "provider_url": "https://www.softwareheritage.org", "provider_type": "deposit_client", "metadata": {}}, "tool": {"name": "swh-deposit", "version": "1.0.1", "configuration": {"sword_version": "2"}}, "raw_metadata": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<entry xmlns:atom=\"http://www.w3.org/2005/Atom\" xmlns:codemeta=\"https://doi.org/10.5063/SCHEMA/CODEMETA-2.0\">\n\t<codemeta:identifier>79c8c06b-3e50-4153-809b-83a5dec290d0</codemeta:identifier>\n\t<atom:updated>2020-11-12 13:17:43.519231+00:00</atom:updated>\n\t<atom:author>swh</atom:author>\n\t<atom:title>test-project</atom:title>\n\t<codemeta:name>test-project</codemeta:name>\n\t<codemeta:author>\n\t\t<codemeta:name>@ardumont</codemeta:name>\n\t</codemeta:author>\n</entry>", "deposit": {"id": 4, "client": "swh", "collection": "swh", "author": {"name": "Software Heritage", "fullname": "Software Heritage", "email": "robot@softwareheritage.org"}, "author_date": {"timestamp": {"seconds": 1605186964, "microseconds": 878062}, "offset": 0}, "committer": {"name": "Software Heritage", "fullname": "Software Heritage", "email": "robot@softwareheritage.org"}, "committer_date": {"timestamp": {"seconds": 1605186964, "microseconds": 878062}, "offset": 0}, "revision_parents": [], "release_notes": null}}%
# or `curl -L`

Migrated from D7533 (view on Phabricator)

Merge request reports

Loading