Skip to content

Commit b5a1d2c

Browse files
authored
Require organisation id in Annotation upload. (#1155)
* Require orga id in Annotation constructor. * Update changelog * Add organization_id to two tests. * Set org_id on upload and update cassettes. * Update changelog.
1 parent 2e525ab commit b5a1d2c

33 files changed

+1934
-3780
lines changed

webknossos/Changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ For upgrade instructions, please check the respective _Breaking Changes_ section
1616
- `RemoteDataset.display_name` is deprecated. To change the name of a dataset use the `name` property instead.
1717
- `Dataset.get_remote_datasets()` returns a mapping. The keys of this mapping changed from datasets name to datasets id.
1818
- `Task.create()` needs a `dataset_id` now instead of a `dataset_name`. Alternativly a `RemoteDataset` object can be used. The `dataset_name` is marked as deprecated. As `dataset_name` is an optional argument now its position has changed, this is important if `create()` is called only with positional arguments.
19+
- When uploading an Annotation the organization_id is neccessary now. The organization_id might be stored in the Annotation object or it is inferred from the current webknossos_context. [#1155](https://github.com/scalableminds/webknossos-libs/pull/1155)
1920

2021
### Added
2122
- `Dataset` method `get_remote_datasets()` accepts `name` and `folder_id` as arguments now to filter remote datasets.

webknossos/tests/cassettes/test_annotation/test_annotation_upload_download_roundtrip.yml

Lines changed: 42 additions & 42 deletions
Large diffs are not rendered by default.

webknossos/tests/cassettes/test_annotation/test_bounding_box_roundtrip.yml

Lines changed: 34 additions & 34 deletions
Large diffs are not rendered by default.

webknossos/tests/cassettes/test_api_client/test_annotation_info.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ http_interactions:
22
- request:
33
method: GET
44
path: >-
5-
/api/v9/annotations/570ba0092a7c0e980056fe9b/info?timestamp=1736433032000
5+
/api/v9/annotations/570ba0092a7c0e980056fe9b/info?timestamp=1737379983000
66
headers:
77
host: localhost:9000
88
accept: '*/*'
9-
accept-encoding: gzip, deflate, zstd
9+
accept-encoding: gzip, deflate
1010
connection: keep-alive
1111
user-agent: python-httpx/0.27.2
1212
x-auth-token: >-
@@ -22,7 +22,7 @@ http_interactions:
2222
cache-control: no-cache
2323
referrer-policy: origin-when-cross-origin, strict-origin-when-cross-origin
2424
x-permitted-cross-domain-policies: master-only
25-
date: Thu, 09 Jan 2025 14:30:32 GMT
25+
date: Mon, 20 Jan 2025 13:33:02 GMT
2626
content-type: application/json
2727
content-length: '1929'
2828
body:

webknossos/tests/cassettes/test_api_client/test_build_info.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ http_interactions:
55
headers:
66
host: localhost:9000
77
accept: '*/*'
8-
accept-encoding: gzip, deflate, zstd
8+
accept-encoding: gzip, deflate
99
connection: keep-alive
1010
user-agent: python-httpx/0.27.2
1111
x-auth-token: >-
@@ -22,7 +22,7 @@ http_interactions:
2222
access-control-max-age: '600'
2323
access-control-allow-origin: '*'
2424
x-permitted-cross-domain-policies: master-only
25-
date: Thu, 09 Jan 2025 14:30:33 GMT
25+
date: Mon, 20 Jan 2025 13:33:03 GMT
2626
content-type: application/json
2727
content-length: '415'
2828
body:

webknossos/tests/cassettes/test_api_client/test_current_user_info_and_user_logged_time.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ http_interactions:
55
headers:
66
host: localhost:9000
77
accept: '*/*'
8-
accept-encoding: gzip, deflate, zstd
8+
accept-encoding: gzip, deflate
99
connection: keep-alive
1010
user-agent: python-httpx/0.27.2
1111
x-auth-token: >-
@@ -21,21 +21,21 @@ http_interactions:
2121
cache-control: no-cache
2222
referrer-policy: origin-when-cross-origin, strict-origin-when-cross-origin
2323
x-permitted-cross-domain-policies: master-only
24-
date: Thu, 09 Jan 2025 14:30:33 GMT
24+
date: Mon, 20 Jan 2025 13:33:03 GMT
2525
content-type: application/json
2626
content-length: '682'
2727
body:
2828
encoding: utf8
2929
data: >-
30-
{"id":"570b9f4d2a7c0e4d008da6ef","email":"[email protected]","firstName":"user_A","lastName":"last_A","isAdmin":true,"isOrganizationOwner":true,"isDatasetManager":true,"isActive":true,"teams":[{"id":"570b9f4b2a7c0e3b008da6ec","name":"team_X1","isTeamManager":true},{"id":"59882b370d889b84020efd3f","name":"team_X3","isTeamManager":false},{"id":"59882b370d889b84020efd6f","name":"team_X4","isTeamManager":true}],"experiences":{"abc":5},"lastActivity":1736432857848,"isAnonymous":false,"isEditable":true,"organization":"Organization_X","novelUserExperienceInfos":{},"selectedTheme":"auto","created":1460379469000,"lastTaskTypeId":null,"isSuperUser":true,"isEmailVerified":true}
30+
{"id":"570b9f4d2a7c0e4d008da6ef","email":"[email protected]","firstName":"user_A","lastName":"last_A","isAdmin":true,"isOrganizationOwner":true,"isDatasetManager":true,"isActive":true,"teams":[{"id":"570b9f4b2a7c0e3b008da6ec","name":"team_X1","isTeamManager":true},{"id":"59882b370d889b84020efd3f","name":"team_X3","isTeamManager":false},{"id":"59882b370d889b84020efd6f","name":"team_X4","isTeamManager":true}],"experiences":{"abc":5},"lastActivity":1737379785764,"isAnonymous":false,"isEditable":true,"organization":"Organization_X","novelUserExperienceInfos":{},"selectedTheme":"auto","created":1460379469000,"lastTaskTypeId":null,"isSuperUser":true,"isEmailVerified":true}
3131
compression: none
3232
- request:
3333
method: GET
3434
path: /api/v9/users/570b9f4d2a7c0e4d008da6ef/loggedTime
3535
headers:
3636
host: localhost:9000
3737
accept: '*/*'
38-
accept-encoding: gzip, deflate, zstd
38+
accept-encoding: gzip, deflate
3939
connection: keep-alive
4040
user-agent: python-httpx/0.27.2
4141
x-auth-token: >-
@@ -51,7 +51,7 @@ http_interactions:
5151
cache-control: no-cache
5252
referrer-policy: origin-when-cross-origin, strict-origin-when-cross-origin
5353
x-permitted-cross-domain-policies: master-only
54-
date: Thu, 09 Jan 2025 14:30:33 GMT
54+
date: Mon, 20 Jan 2025 13:33:03 GMT
5555
content-type: application/json
5656
content-length: '691'
5757
body:

webknossos/tests/cassettes/test_api_client/test_dataset_info.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ http_interactions:
55
headers:
66
host: localhost:9000
77
accept: '*/*'
8-
accept-encoding: gzip, deflate, zstd
8+
accept-encoding: gzip, deflate
99
connection: keep-alive
1010
user-agent: python-httpx/0.27.2
1111
x-auth-token: >-
@@ -21,7 +21,7 @@ http_interactions:
2121
cache-control: no-cache
2222
referrer-policy: origin-when-cross-origin, strict-origin-when-cross-origin
2323
x-permitted-cross-domain-policies: master-only
24-
date: Thu, 09 Jan 2025 14:30:33 GMT
24+
date: Mon, 20 Jan 2025 13:33:03 GMT
2525
content-type: application/json
2626
content-length: '112'
2727
body:
@@ -35,7 +35,7 @@ http_interactions:
3535
headers:
3636
host: localhost:9000
3737
accept: '*/*'
38-
accept-encoding: gzip, deflate, zstd
38+
accept-encoding: gzip, deflate
3939
connection: keep-alive
4040
user-agent: python-httpx/0.27.2
4141
x-auth-token: >-
@@ -51,11 +51,11 @@ http_interactions:
5151
cache-control: no-cache
5252
referrer-policy: origin-when-cross-origin, strict-origin-when-cross-origin
5353
x-permitted-cross-domain-policies: master-only
54-
date: Thu, 09 Jan 2025 14:30:33 GMT
54+
date: Mon, 20 Jan 2025 13:33:03 GMT
5555
content-type: application/json
5656
content-length: '1503'
5757
body:
5858
encoding: utf8
5959
data: >-
60-
{"id":"59e9cfbdba632ac2ab8b23b5","name":"l4_sample","dataSource":{"id":{"name":"l4_sample","team":"Organization_X"},"dataLayers":[{"name":"color","category":"color","boundingBox":{"topLeft":[3072,3072,512],"width":1024,"height":1024,"depth":1024},"resolutions":[[1,1,1],[2,2,1],[4,4,1],[8,8,2],[16,16,4]],"elementClass":"uint8","defaultViewConfiguration":{"color":[255,0,0]}},{"name":"segmentation","category":"segmentation","boundingBox":{"topLeft":[3072,3072,512],"width":1024,"height":1024,"depth":1024},"resolutions":[[1,1,1],[2,2,1],[4,4,1],[8,8,2],[16,16,4]],"elementClass":"uint32","largestSegmentId":2504697}],"scale":{"factor":[11.239999771118164,11.239999771118164,28],"unit":"nanometer"}},"dataStore":{"name":"localhost","url":"http://localhost:9000","isScratch":false,"allowsUpload":true,"jobsSupportedByAvailableWorkers":[],"jobsEnabled":false},"owningOrganization":"Organization_X","allowedTeams":[{"id":"570b9f4b2a7c0e3b008da6ec","name":"team_X1","organization":"Organization_X"}],"allowedTeamsCumulative":[{"id":"570b9f4b2a7c0e3b008da6ec","name":"team_X1","organization":"Organization_X"}],"isActive":true,"isPublic":true,"description":null,"directoryName":"l4_sample","created":1508495293789,"isEditable":true,"lastUsedByUser":1736433034081,"logoUrl":"/assets/images/mpi-logos.svg","sortingKey":1508495293789,"metadata":[{"key":"key","type":"string","value":"value"}],"isUnreported":false,"tags":[],"folderId":"570b9f4e4bb848d0885ea917","publication":null,"usedStorageBytes":1692207513}
60+
{"id":"59e9cfbdba632ac2ab8b23b5","name":"l4_sample","dataSource":{"id":{"name":"l4_sample","team":"Organization_X"},"dataLayers":[{"name":"color","category":"color","boundingBox":{"topLeft":[3072,3072,512],"width":1024,"height":1024,"depth":1024},"resolutions":[[1,1,1],[2,2,1],[4,4,1],[8,8,2],[16,16,4]],"elementClass":"uint8","defaultViewConfiguration":{"color":[255,0,0]}},{"name":"segmentation","category":"segmentation","boundingBox":{"topLeft":[3072,3072,512],"width":1024,"height":1024,"depth":1024},"resolutions":[[1,1,1],[2,2,1],[4,4,1],[8,8,2],[16,16,4]],"elementClass":"uint32","largestSegmentId":2504697}],"scale":{"factor":[11.239999771118164,11.239999771118164,28],"unit":"nanometer"}},"dataStore":{"name":"localhost","url":"http://localhost:9000","isScratch":false,"allowsUpload":true,"jobsSupportedByAvailableWorkers":[],"jobsEnabled":false},"owningOrganization":"Organization_X","allowedTeams":[{"id":"570b9f4b2a7c0e3b008da6ec","name":"team_X1","organization":"Organization_X"}],"allowedTeamsCumulative":[{"id":"570b9f4b2a7c0e3b008da6ec","name":"team_X1","organization":"Organization_X"}],"isActive":true,"isPublic":true,"description":null,"directoryName":"l4_sample","created":1508495293789,"isEditable":true,"lastUsedByUser":1737379984239,"logoUrl":"/assets/images/mpi-logos.svg","sortingKey":1508495293789,"metadata":[{"key":"key","type":"string","value":"value"}],"isUnreported":false,"tags":[],"folderId":"570b9f4e4bb848d0885ea917","publication":null,"usedStorageBytes":1692207513}
6161
compression: none

webknossos/tests/cassettes/test_api_client/test_datastore_list.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ http_interactions:
55
headers:
66
host: localhost:9000
77
accept: '*/*'
8-
accept-encoding: gzip, deflate, zstd
8+
accept-encoding: gzip, deflate
99
connection: keep-alive
1010
user-agent: python-httpx/0.27.2
1111
x-auth-token: >-
@@ -21,7 +21,7 @@ http_interactions:
2121
cache-control: no-cache
2222
referrer-policy: origin-when-cross-origin, strict-origin-when-cross-origin
2323
x-permitted-cross-domain-policies: master-only
24-
date: Thu, 09 Jan 2025 14:30:32 GMT
24+
date: Mon, 20 Jan 2025 13:33:02 GMT
2525
content-type: application/json
2626
content-length: '147'
2727
body:

webknossos/tests/cassettes/test_api_client/test_generate_token_for_data_store.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ http_interactions:
66
host: localhost:9000
77
content-length: '0'
88
accept: '*/*'
9-
accept-encoding: gzip, deflate, zstd
9+
accept-encoding: gzip, deflate
1010
connection: keep-alive
1111
user-agent: python-httpx/0.27.2
1212
x-auth-token: >-
@@ -22,10 +22,10 @@ http_interactions:
2222
cache-control: no-cache
2323
referrer-policy: origin-when-cross-origin, strict-origin-when-cross-origin
2424
x-permitted-cross-domain-policies: master-only
25-
date: Thu, 09 Jan 2025 14:30:33 GMT
25+
date: Mon, 20 Jan 2025 13:33:03 GMT
2626
content-type: application/json
2727
content-length: '34'
2828
body:
2929
encoding: utf8
30-
data: '{"token":"NEdSmVtaQai_RdfG3fDxNQ"}'
30+
data: '{"token":"PxDd6hXgE0biL9iVj3wTJQ"}'
3131
compression: none

webknossos/tests/cassettes/test_api_client/test_health.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ http_interactions:
55
headers:
66
host: localhost:9000
77
accept: '*/*'
8-
accept-encoding: gzip, deflate, zstd
8+
accept-encoding: gzip, deflate
99
connection: keep-alive
1010
user-agent: python-httpx/0.27.2
1111
x-auth-token: >-
@@ -21,7 +21,7 @@ http_interactions:
2121
cache-control: no-cache
2222
referrer-policy: origin-when-cross-origin, strict-origin-when-cross-origin
2323
x-permitted-cross-domain-policies: master-only
24-
date: Thu, 09 Jan 2025 14:30:32 GMT
24+
date: Mon, 20 Jan 2025 13:33:02 GMT
2525
content-type: text/plain; charset=UTF-8
2626
content-length: '2'
2727
body:

0 commit comments

Comments
 (0)