Skip to content

Commit 28ccff9

Browse files
Merge remote-tracking branch 'origin/main' into draft-into-morphology-model
* origin/main: root routes should not require auth, make sure tests reflect this (#351) Specify permission for service admin (#342)
2 parents fc3f586 + 4b58023 commit 28ccff9

File tree

2 files changed

+23
-25
lines changed

2 files changed

+23
-25
lines changed

docs/API.md

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,11 @@
1414
```
1515

1616
These have CRUD-able patterns:
17-
GET /contribution/{id} to get
18-
POST /contribution/ to create
17+
GET /experimental-bouton-density/{id} to get
18+
POST /experimental-bouton-density/ to create
19+
PATCH /experimental-bouton-density/ to update
1920

20-
21-
Note: the organizations will need to be filled in; they include ones that are not yet part of the OBI, so there isn't a one-to-one relationship with what is included virtual lab service.
22-
Future work may include auto-additing organizations when one joins the OBI; alternatively the first time data is created, they could be added.
23-
Currently, `Entity`s are immutable, with the exception of the `authorized_public` property (see Authorization).
24-
25-
TODO:
26-
What are the ACLs on these operations?
27-
contribution
28-
organization
29-
person
30-
role
21+
API reserved for the service admin group (see [Authorization](#Authorization)) will be prefixed by /admin/ .
3122

3223
# List views
3324
The endpoint for returning the listing per type; including faceting; if no query parameter is passed, the traditional list view will be returned (ie: no filtering)
@@ -363,6 +354,13 @@ Members of the owning project can set the `authorized_public` on creation, to ma
363354
In addition, this value can be changed by using the `PATCH` operation.
364355
Once an `Entity` is made public, it can not be made private, since it could be already shared/used by others.
365356

357+
Users in the [service admin group](#service-admin-group) can read data from any project, and edit (read/update/delete) data in any project.
358+
359+
A resource without an authorized_project_id is called a global resource.
360+
361+
Global resources and public entities can be updated only by service admins.
362+
363+
366364

367365
### To be looked at more:
368366
```

tests/routers/test_root.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
from app.config import settings
22

33

4-
def test_root(client):
5-
response = client.get("/", follow_redirects=False)
4+
def test_root(client_no_auth):
5+
response = client_no_auth.get("/", follow_redirects=False)
66

77
assert response.status_code == 302
88
assert response.next_request.url.path == f"{settings.ROOT_PATH}/docs"
99

1010

11-
def test_health(client):
12-
response = client.get("/health")
11+
def test_health(client_no_auth):
12+
response = client_no_auth.get("/health")
1313

1414
assert response.status_code == 200
1515
assert response.json() == {"status": "OK"}
1616

1717

18-
def test_version(client):
19-
response = client.get("/version")
18+
def test_version(client_no_auth):
19+
response = client_no_auth.get("/version")
2020

2121
assert response.status_code == 200
2222
response_json = response.json()
@@ -26,8 +26,8 @@ def test_version(client):
2626
assert response_json["commit_sha"] is not None
2727

2828

29-
def test_error(client):
30-
response = client.get("/error")
29+
def test_error(client_no_auth):
30+
response = client_no_auth.get("/error")
3131

3232
assert response.status_code == 400
3333
assert response.json() == {
@@ -37,8 +37,8 @@ def test_error(client):
3737
}
3838

3939

40-
def test_extra_query_params(client):
41-
response = client.get("/version", params={"foo": "bar"})
40+
def test_extra_query_params(client_no_auth):
41+
response = client_no_auth.get("/version", params={"foo": "bar"})
4242

4343
assert response.status_code == 422
4444
assert response.json() == {
@@ -48,7 +48,7 @@ def test_extra_query_params(client):
4848
}
4949

5050

51-
def test_extra_query_params_bypass(client):
52-
response = client.get("/version", params={"foo": "bar", "allow_extra_params": True})
51+
def test_extra_query_params_bypass(client_no_auth):
52+
response = client_no_auth.get("/version", params={"foo": "bar", "allow_extra_params": True})
5353

5454
assert response.status_code == 200

0 commit comments

Comments
 (0)