Skip to content

Commit 541c724

Browse files
committed
Remove auth for public api endpoint, add for invalid UUID
1 parent a4ad4a3 commit 541c724

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

server/mergin/sync/public_api_v2_controller.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,6 @@ def list_workspace_projects(workspace_id, page, per_page, order_params=None, q=N
456456
data = ProjectSchemaV2(many=True).dump(result)
457457
return jsonify(projects=data, count=total, page=page, per_page=per_page), 200
458458

459-
@auth_required
460459
def list_batch_projects():
461460
"""List projects by given list of UUIDs. Limit to 100 projects per request.
462461

server/mergin/tests/test_public_api_v2.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -714,6 +714,10 @@ def test_list_projects_in_batch(client):
714714
resp = client.post(url, json={})
715715
assert resp.status_code == 400
716716

717+
# invalid UUID -> 400
718+
resp = client.post(url, json={"ids": ["invalid-uuid", pub_id]})
719+
assert resp.status_code == 400
720+
717721
# returns envelope with projects list
718722
resp = client.post(url, json={"ids": [priv_id, pub_id]})
719723
assert resp.status_code == 200
@@ -726,7 +730,6 @@ def test_list_projects_in_batch(client):
726730
assert "name" in proj # full project object
727731

728732
# Reset global permissions
729-
from ..config import Configuration
730733
Configuration.GLOBAL_READ = False
731734
Configuration.GLOBAL_WRITE = False
732735
Configuration.GLOBAL_ADMIN = False

0 commit comments

Comments
 (0)