openwhisk-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From japet...@apache.org
Subject [openwhisk-package-kafka] branch master updated: Handle cases when authKey does not exist in DB documents (#366)
Date Wed, 08 Jan 2020 18:36:08 GMT
This is an automated email from the ASF dual-hosted git repository.

japetrsn pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/openwhisk-package-kafka.git


The following commit(s) were added to refs/heads/master by this push:
     new 0130bc2  Handle cases when authKey does not exist in DB documents (#366)
0130bc2 is described below

commit 0130bc2daef86329c7a9fb760e385438765f0fb4
Author: James Dubee <jwdubee@us.ibm.com>
AuthorDate: Wed Jan 8 13:36:00 2020 -0500

    Handle cases when authKey does not exist in DB documents (#366)
---
 provider/consumer.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/provider/consumer.py b/provider/consumer.py
index eb06c00..477b75d 100644
--- a/provider/consumer.py
+++ b/provider/consumer.py
@@ -160,8 +160,12 @@ class ConsumerProcess (Process):
         if 'isIamKey' in params and params['isIamKey'] == True:
             self.authHandler = IAMAuth(params['authKey'], params['iamUrl'])
         else:
-            auth = params['authKey'].split(':')
-            self.authHandler = HTTPBasicAuth(auth[0], auth[1])
+            if 'authKey' in params:
+                auth = params['authKey'].split(':')
+                self.authHandler = HTTPBasicAuth(auth[0], auth[1])
+            else:
+                parsedUrl = urlparse(params["triggerURL"])
+                self.authHandler = HTTPBasicAuth(parsedUrl.username, parsedUrl.password)
 
         # handle the case where there may be existing triggers that do not
         # have the isJSONData field set


Mime
View raw message