Skip to content

Commit e845142

Browse files
committed
GET project never exposes
1 parent d80900b commit e845142

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

server/mergin/sync/permissions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ def require_project_by_uuid(
223223
expose (bool, optional): Controls security disclosure behavior on permission failure.
224224
- If `True`: Returns 403 Forbidden (reveals project exists but access is denied).
225225
- If `False`: Returns 404 Not Found (hides project existence for security).
226-
Defaults to `True` for v1 endpoints compatibility.
226+
Standard is that reading results in 404, while writing results in 403
227227
"""
228228
if not is_valid_uuid(uuid):
229229
abort(404)

server/mergin/tests/test_public_api_v2.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,11 +180,11 @@ def test_get_project(client):
180180
# anonymous user cannot access the private resource
181181
response = client.get(f"v2/projects/{project.id}")
182182
assert response.status_code == 404
183-
# lack of permissions
183+
# lack of permissions also results in 404 for GET project
184184
user = add_user("tests", "tests")
185185
login(client, user.username, "tests")
186186
response = client.get(f"v2/projects/{project.id}")
187-
assert response.status_code == 403
187+
assert response.status_code == 404
188188
# access public project
189189
project.public = True
190190
db.session.commit()

0 commit comments

Comments
 (0)