changeset 83:95cb8629add4 default tip

merge
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 19 Jun 2026 12:27:54 +0200
parents 0e695d856b0c (current diff) 5a15b3b00753 (diff)
children
files NEWS
diffstat 6 files changed, 32 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/.hgignore	Fri Jun 19 12:26:55 2026 +0200
+++ b/.hgignore	Fri Jun 19 12:27:54 2026 +0200
@@ -8,3 +8,4 @@
 i/
 s/
 w32/
+.vscode/
\ No newline at end of file
--- a/NEWS	Fri Jun 19 12:26:55 2026 +0200
+++ b/NEWS	Fri Jun 19 12:27:54 2026 +0200
@@ -5,6 +5,8 @@
 * Disabled "Expect: 100-continue" HTTP header during LTI registration,
   which is not always properly handled by certain LTI deployments
   (e.g., if HAProxy is put in front of Moodle)
+* New configuration "EnableVerboseLogs" to display more information, amongst other,
+  during LTI configuration.
 * REST API: Job ID is reported when starting the DICOM-ization, and upload ID
   is part of the DICOM-ization status
 
--- a/Sources/EducationConfiguration.cpp	Fri Jun 19 12:26:55 2026 +0200
+++ b/Sources/EducationConfiguration.cpp	Fri Jun 19 12:27:54 2026 +0200
@@ -56,6 +56,7 @@
   hasPluginVolView_(false),
   hasPluginWholeSlideImaging_(false),
   hasPluginOhif_(false),
+  isVerboseLogsEnabled_(false),
   sequenceProjectIds_(0)
 {
 }
@@ -730,3 +731,14 @@
 
   return NULL;
 }
+
+
+void EducationConfiguration::SetVerboseLogsEnabled(bool enable)
+{
+  isVerboseLogsEnabled_ = enable;
+}
+
+bool EducationConfiguration::IsVerboseLogsEnabled() const
+{
+  return isVerboseLogsEnabled_;
+}
--- a/Sources/EducationConfiguration.h	Fri Jun 19 12:26:55 2026 +0200
+++ b/Sources/EducationConfiguration.h	Fri Jun 19 12:27:54 2026 +0200
@@ -67,6 +67,7 @@
   bool                   hasPluginVolView_;
   bool                   hasPluginWholeSlideImaging_;
   bool                   hasPluginOhif_;
+  bool                   isVerboseLogsEnabled_;
 
   unsigned int           sequenceProjectIds_;
 
@@ -191,4 +192,8 @@
   AuthenticatedUser* DoHttpHeaderAuthentication(uint32_t headersCount,
                                                 const char* const* headersKeys,
                                                 const char* const* headersValues);
+
+  void SetVerboseLogsEnabled(bool enable);
+
+  bool IsVerboseLogsEnabled() const;
 };
--- a/Sources/LTI/LTIRoutes.cpp	Fri Jun 19 12:26:55 2026 +0200
+++ b/Sources/LTI/LTIRoutes.cpp	Fri Jun 19 12:27:54 2026 +0200
@@ -183,9 +183,20 @@
     std::map<std::string, std::string> form;
     HttpToolbox::ParseFormUrlEncoded(form, request->body, request->bodySize);
 
+    if (EducationConfiguration::GetInstance().IsVerboseLogsEnabled())
+    {
+      LOG(INFO) << "ServeLaunch payload: " << std::string(reinterpret_cast<const char*>(request->body), static_cast<size_t>(request->bodySize));
+    }
+
     CheckState(form, request);
 
     JWT jwt(HttpToolbox::ReadMandatoryString(form, "id_token"));
+
+    if (EducationConfiguration::GetInstance().IsVerboseLogsEnabled())
+    {
+      LOG(INFO) << "Verifying JWT: " << HttpToolbox::ReadMandatoryString(form, "id_token");
+    }
+
     platformKeysRegistry_->VerifyJWT(jwt, EducationConfiguration::GetInstance().GetLtiPlatformKeysUrl(), 60 /* must be short-lived */);
 
     std::map<std::string, std::string> custom;
--- a/Sources/Plugin.cpp	Fri Jun 19 12:26:55 2026 +0200
+++ b/Sources/Plugin.cpp	Fri Jun 19 12:27:54 2026 +0200
@@ -645,6 +645,7 @@
       OrthancPluginRegisterHttpAuthentication(context, HttpAuthentication);
       OrthancPluginRegisterOnChangeCallback(context, OnChangeCallback);
 
+      EducationConfiguration::GetInstance().SetVerboseLogsEnabled(configEducation.GetBooleanValue("EnableVerboseLogs", false));
 
       std::string s;
       if (configEducation.LookupStringValue(s, "AuthenticationHttpHeader"))