summaryrefslogtreecommitdiff
path: root/opendc-web/opendc-web-api/opendc/api/v2/topologies/topologyId/test_endpoint.py
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2021-05-14 16:50:23 +0200
committerFabian Mastenbroek <mail.fabianm@gmail.com>2021-05-17 17:06:51 +0200
commit05d2318538eba71ac0555dc5ec146499d9cb0592 (patch)
tree6163e6429879109e322a4c0883fab168031aa109 /opendc-web/opendc-web-api/opendc/api/v2/topologies/topologyId/test_endpoint.py
parent0c6ccca5fac44ab40671627fd3181e9b138672fa (diff)
api: Remove user handling from OpenDC API server
This change removes any of the user handling and endpoints from the OpenDC API server. The API server does not need to store user information other than an identifier in the database.
Diffstat (limited to 'opendc-web/opendc-web-api/opendc/api/v2/topologies/topologyId/test_endpoint.py')
-rw-r--r--opendc-web/opendc-web-api/opendc/api/v2/topologies/topologyId/test_endpoint.py16
1 files changed, 5 insertions, 11 deletions
diff --git a/opendc-web/opendc-web-api/opendc/api/v2/topologies/topologyId/test_endpoint.py b/opendc-web/opendc-web-api/opendc/api/v2/topologies/topologyId/test_endpoint.py
index 4da0bc64..96d2e08e 100644
--- a/opendc-web/opendc-web-api/opendc/api/v2/topologies/topologyId/test_endpoint.py
+++ b/opendc-web/opendc-web-api/opendc/api/v2/topologies/topologyId/test_endpoint.py
@@ -11,7 +11,7 @@ def test_get_topology(client, mocker):
'_id': test_id,
'projectId': test_id,
'authorizations': [{
- 'projectId': test_id,
+ 'userId': 'test',
'authorizationLevel': 'EDIT'
}]
})
@@ -30,10 +30,7 @@ def test_get_topology_not_authorized(client, mocker):
return_value={
'_id': test_id,
'projectId': test_id,
- 'authorizations': [{
- 'projectId': test_id_2,
- 'authorizationLevel': 'OWN'
- }]
+ 'authorizations': []
})
res = client.get(f'/v2/topologies/{test_id}')
assert '403' in res.status
@@ -60,10 +57,7 @@ def test_update_topology_not_authorized(client, mocker):
return_value={
'_id': test_id,
'projectId': test_id,
- 'authorizations': [{
- 'projectId': test_id,
- 'authorizationLevel': 'VIEW'
- }]
+ 'authorizations': []
})
mocker.patch.object(DB, 'update', return_value={})
assert '403' in client.put(f'/v2/topologies/{test_id}', json={
@@ -81,7 +75,7 @@ def test_update_topology(client, mocker):
'_id': test_id,
'projectId': test_id,
'authorizations': [{
- 'projectId': test_id,
+ 'userId': 'test',
'authorizationLevel': 'OWN'
}]
})
@@ -104,7 +98,7 @@ def test_delete_topology(client, mocker):
'googleId': 'test',
'topologyIds': [test_id],
'authorizations': [{
- 'projectId': test_id,
+ 'userId': 'test',
'authorizationLevel': 'OWN'
}]
})