diff Framework/Oracle/HttpCommand.h @ 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 8e3763d1736a
line wrap: on
line diff
--- a/Framework/Oracle/HttpCommand.h	Thu Oct 17 18:36:52 2019 +0200
+++ b/Framework/Oracle/HttpCommand.h	Thu Oct 17 21:25:03 2019 +0200
@@ -69,6 +69,8 @@
     std::string          body_;
     HttpHeaders          headers_;
     unsigned int         timeout_;
+    std::string          username_;
+    std::string          password_;
 
   public:
     HttpCommand();
@@ -137,5 +139,27 @@
     {
       return timeout_;
     }
+
+    void SetCredentials(const std::string& username,
+                        const std::string& password)
+    {
+      username_ = username;
+      password_ = password;
+    }
+
+    void ClearCredentials()
+    {
+      username_.clear();
+      password_.clear();
+    }
+
+    bool HasCredentials() const
+    {
+      return !username_.empty();
+    }
+
+    const std::string& GetUsername() const;
+
+    const std::string& GetPassword() const;
   };
 }