changeset 634:f6ee256f2404

fix
author Alain Mazy <am@osimis.io>
date Tue, 19 Mar 2024 10:52:40 +0100
parents 7bb22f87fc5b
children 88539de02bcc
files NewTests/Authorization/test_authorization.py NewTests/README
diffstat 2 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- 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
--- 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