dpward / rpms / sssd

Forked from rpms/sssd 3 years ago
Clone

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

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