aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMichael Hwang <mhwang@research.att.com>2017-10-19 14:31:55 -0400
committerMichael Hwang <mhwang@research.att.com>2017-10-19 15:38:03 -0400
commit5e312fba79c7aeaba2b433fe19dae7b0ced20cfb (patch)
tree9702a4af984e19c39c50d4c73be269aaf1242f2f /src
parent3be31336e2324772c13856da50f4ffd610f4e3cc (diff)
Use activateServerTLSAuth in asdc_client
This is to support insecure testing Change-Id: I8343e3b453ac1a35110bd6c59d0d56d9170a0451 Issue-Id: DCAEGEN2-170 Signed-off-by: Michael Hwang <mhwang@research.att.com>
Diffstat (limited to 'src')
-rw-r--r--src/sch/asdc_client.clj22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/sch/asdc_client.clj b/src/sch/asdc_client.clj
index a9742b3..b859f03 100644
--- a/src/sch/asdc_client.clj
+++ b/src/sch/asdc_client.clj
@@ -27,14 +27,12 @@
(defn create-asdc-conn
-
- ([asdc-uri user password consumer-id]
- [(uri asdc-uri) user password consumer-id])
-
([config]
- (let [config-asdc (:asdcDistributionClient config)]
- (create-asdc-conn (:asdcUri config-asdc) (:user config-asdc)
- (:password config-asdc) (:consumerId config-asdc))))
+ (let [config-asdc (:asdcDistributionClient config)
+ { :keys [asdcUri user password consumerId activateServerTLSAuth] } config-asdc]
+ ; The last entry is passed into clj-http's "insecure?" parameter which is
+ ; why "activateServerTLSAuth" is negated
+ [(uri asdcUri) user password consumerId (not activateServerTLSAuth)]))
)
@@ -49,10 +47,11 @@
(defn get-artifact!
[connection artifact-path]
- (let [[asdc-uri user password instance-id] connection
+ (let [[asdc-uri user password instance-id insecure?] connection
target-uri (assoc asdc-uri :path artifact-path)
resp (client/get (str target-uri) { :basic-auth [user password]
- :headers { "X-ECOMP-InstanceID" instance-id } })]
+ :headers { "X-ECOMP-InstanceID" instance-id }
+ :insecure? insecure? })]
(if (= (:status resp) 200)
; Response media type is application/octet-stream
; TODO: Use X-ECOMP-RequestID?
@@ -62,10 +61,11 @@
(defn get-service-metadata!
[connection service-uuid]
- (let [[asdc-uri user password instance-id] connection
+ (let [[asdc-uri user password instance-id insecure?] connection
target-uri (assoc asdc-uri :path (construct-service-path service-uuid))
resp (client/get (str target-uri) { :basic-auth [user password]
- :headers { "X-ECOMP-InstanceID" instance-id } })]
+ :headers { "X-ECOMP-InstanceID" instance-id }
+ :insecure? insecure? })]
(if (= (:status resp) 200)
; Response media type is application/octet-stream
; TODO: Use X-ECOMP-RequestID?