diff Plugin/ResourceHierarchyCache.h @ 77:94a9484d7f8f

fix security issues allowing to browse remote dicom servers + introduced UnitTests
author Alain Mazy <am@osimis.io>
date Wed, 15 Mar 2023 16:36:42 +0100
parents 1a13c4fbc9a1
children a2e5ea1869bd
line wrap: on
line diff
--- a/Plugin/ResourceHierarchyCache.h	Thu Mar 09 14:37:52 2023 +0100
+++ b/Plugin/ResourceHierarchyCache.h	Wed Mar 15 16:36:42 2023 +0100
@@ -26,6 +26,10 @@
 
 #include <orthanc/OrthancCPlugin.h>
 
+#if BUILD_UNIT_TESTS == 1
+#  include <gtest/gtest_prod.h>
+#endif
+
 namespace OrthancPlugins
 {
   class ResourceHierarchyCache : public boost::noncopyable
@@ -84,5 +88,16 @@
     bool LookupOrthancId(std::string& target,
                          Orthanc::ResourceType level,
                          const std::string& dicomUid);
+
+    FRIEND_TEST(DefaultAuthorizationParser, Parse);
+  protected:
+    void AddOrthancDicomMapping(Orthanc::ResourceType level,
+                                const std::string& orthancId,
+                                const std::string& dicomUid);
+
+    void AddParentLink(Orthanc::ResourceType childLevel,
+                       const std::string& childOrthancId,
+                       const std::string& parentOrthancId);
+
   };
 }