Blame SOURCES/0086-secrets-support-HTTP-basic-authentication-with-proxy.patch

ecf709
From 28d590900ab20dec3dc447562aefaa5e2771c48e Mon Sep 17 00:00:00 2001
ecf709
From: =?UTF-8?q?Pavel=20B=C5=99ezina?= <pbrezina@redhat.com>
ecf709
Date: Tue, 28 Feb 2017 13:58:20 +0100
ecf709
Subject: [PATCH 86/90] secrets: support HTTP basic authentication with proxy
ecf709
 provider
ecf709
ecf709
Even though configuration options auth_type = basic, username and password
ecf709
are read they were not used anywhere prior this patch.
ecf709
ecf709
Reviewed-by: Simo Sorce <simo@redhat.com>
ecf709
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
ecf709
(cherry picked from commit af026ea6a6e812b7d6c5c889dda64ba7b7c433ee)
ecf709
---
ecf709
 src/responder/secrets/proxy.c | 9 +++++++++
ecf709
 1 file changed, 9 insertions(+)
ecf709
ecf709
diff --git a/src/responder/secrets/proxy.c b/src/responder/secrets/proxy.c
ecf709
index 240a1de1e431d511a1eca24d8b463c37ba893e7b..fd96e985c897e2cb470a9b5d6eecbd34350fb7d2 100644
ecf709
--- a/src/responder/secrets/proxy.c
ecf709
+++ b/src/responder/secrets/proxy.c
ecf709
@@ -440,6 +440,15 @@ static errno_t proxy_http_create_request(TALLOC_CTX *mem_ctx,
ecf709
         }
ecf709
     }
ecf709
 
ecf709
+    /* Set basic authentication if required. */
ecf709
+    if (pcfg->auth_type == PAT_BASIC_AUTH) {
ecf709
+        ret = tcurl_req_http_basic_auth(tcurl_req, pcfg->auth.basic.username,
ecf709
+                                        pcfg->auth.basic.password);
ecf709
+        if (ret != EOK) {
ecf709
+            goto done;
ecf709
+        }
ecf709
+    }
ecf709
+
ecf709
     talloc_steal(tcurl_req, body);
ecf709
     *_tcurl_req = talloc_steal(mem_ctx, tcurl_req);
ecf709
 
ecf709
-- 
ecf709
2.9.3
ecf709