diff Framework/Oracle/HttpCommand.cpp @ 1079:e6d2ff8f1ab4 broker

credentials in HttpCommand
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 17 Oct 2019 21:25:03 +0200
parents 18d53a8b41b7
children 87fbeb823375
line wrap: on
line diff
--- a/Framework/Oracle/HttpCommand.cpp	Thu Oct 17 18:36:52 2019 +0200
+++ b/Framework/Oracle/HttpCommand.cpp	Thu Oct 17 21:25:03 2019 +0200
@@ -76,4 +76,30 @@
       throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls);
     }
   }
+
+
+  const std::string& HttpCommand::GetUsername() const
+  {
+    if (HasCredentials())
+    {
+      return username_;
+    }
+    else
+    {
+      throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls);
+    }
+  }
+
+
+  const std::string& HttpCommand::GetPassword() const
+  {
+    if (HasCredentials())
+    {
+      return password_;
+    }
+    else
+    {
+      throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls);
+    }
+  }
 }