jasonpet closed pull request #285: fix auth check
URL: https://github.com/apache/incubator-openwhisk-package-kafka/pull/285
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/action/messageHubFeed.js b/action/messageHubFeed.js
index 4b4638e..3217d56 100644
--- a/action/messageHubFeed.js
+++ b/action/messageHubFeed.js
@@ -20,7 +20,7 @@ function main(params) {
var iamKey = process.env.__OW_IAM_NAMESPACE_API_KEY;
massagedParams.authKey = iamKey || process.env.__OW_API_KEY;
- massagedParams.isIamKey = iamKey != undefined;
+ massagedParams.isIamKey = iamKey !== undefined;
if (massagedParams.isIamKey) {
massagedParams.iamUrl = process.env.__OW_IAM_API_URL;
diff --git a/action/messageHubFeedWeb.js b/action/messageHubFeedWeb.js
index 1f64515..76baae7 100644
--- a/action/messageHubFeedWeb.js
+++ b/action/messageHubFeedWeb.js
@@ -255,7 +255,7 @@ function checkMessageHubCredentials(params) {
}
function verifyTriggerAuth(triggerURL, apiKey, isIamKey, iamUrl) {
- if (isIamKey) {
+ if (isIamKey === true) {
return new itm({ 'iamApikey': apiKey, 'iamUrl': iamUrl
}).getToken().then( token => common.verifyTriggerAuth(triggerURL, { bearer:
token }));
} else {
var auth = apiKey.split(':');
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services