# HG changeset patch # User Alain Mazy # Date 1710841960 -3600 # Node ID f6ee256f240444299233813c66b531661d59da2b # Parent 7bb22f87fc5bfd0eb982feac842d74e4ca0cc9b0 fix diff -r 7bb22f87fc5b -r f6ee256f2404 NewTests/Authorization/test_authorization.py --- a/NewTests/Authorization/test_authorization.py Tue Mar 19 08:51:56 2024 +0100 +++ b/NewTests/Authorization/test_authorization.py Tue Mar 19 10:52:40 2024 +0100 @@ -52,7 +52,8 @@ ], "CheckedLevel": "studies", "TokenHttpHeaders": ["user-token-key", "resource-token-key"], - "TokenGetArguments": ["resource-token-key"] + "TokenGetArguments": ["resource-token-key"], + "UncheckedFolders": ["/plugins"] # to allow testing plugin version while it is not included by default in the auth-plugin }, "DicomWeb": { "Enable": True @@ -162,6 +163,7 @@ def test_user_a(self): + o_admin = OrthancApiClient(self.o._root_url, headers={"user-token-key": "token-admin"}) o = OrthancApiClient(self.o._root_url, headers={"user-token-key": "token-user-a"}) # # make sure we can access all these urls (they would throw if not) @@ -246,7 +248,7 @@ m = o.get_json(f"dicom-web/studies/{self.label_a_study_dicom_id}/metadata") self.assert_is_forbidden(lambda: o.get_json(f"dicom-web/studies/{self.label_b_study_dicom_id}/metadata")) - if o.is_plugin_version_at_least("authorization", 0, 7, 1): + if o_admin.is_plugin_version_at_least("authorization", 0, 7, 1): i = o.get_json(f"dicom-web/studies/{self.label_a_study_dicom_id}/instances") self.assert_is_forbidden(lambda: o.get_json(f"dicom-web/studies/{self.label_b_study_dicom_id}/instances")) @@ -258,7 +260,7 @@ def test_resource_token(self): o = OrthancApiClient(self.o._root_url, headers={"resource-token-key": "token-a-study"}) - + # with a resource token, we can access only the given resource, not generic resources or resources from other studies # generic resources are forbidden diff -r 7bb22f87fc5b -r f6ee256f2404 NewTests/README --- a/NewTests/README Tue Mar 19 08:51:56 2024 +0100 +++ b/NewTests/README Tue Mar 19 10:52:40 2024 +0100 @@ -157,7 +157,7 @@ python3 NewTests/main.py --pattern=Authorization.test_authorization.TestAuthorization.* \ --orthanc_under_tests_docker_image=orthancteam/orthanc:current \ - --orthanc_previous_version_docker_image=orthancteam/orthanc:22.4.0 \ + --orthanc_previous_version_docker_image=orthancteam/orthanc:24.3.3 \ --orthanc_under_tests_http_port=8043