You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by GitBox <gi...@apache.org> on 2018/03/15 01:08:43 UTC

[GitHub] csantanapr closed pull request #3437: swagger generation update

csantanapr closed pull request #3437: swagger generation update
URL: https://github.com/apache/incubator-openwhisk/pull/3437
 
 
   

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/ansible/group_vars/all b/ansible/group_vars/all
index f0dca5fac1..3f9507f087 100644
--- a/ansible/group_vars/all
+++ b/ansible/group_vars/all
@@ -207,7 +207,7 @@ apigateway:
     api: 9000
     api_secure: 443
     mgmt: 9001
-  version: 0.9.8
+  version: 0.9.10
 
 redis:
   version: 3.2
diff --git a/core/routemgmt/common/apigw-utils.js b/core/routemgmt/common/apigw-utils.js
index 07f2be5318..84d4104c15 100644
--- a/core/routemgmt/common/apigw-utils.js
+++ b/core/routemgmt/common/apigw-utils.js
@@ -516,6 +516,7 @@ function generateBaseSwaggerApi(basepath, apiname) {
  *                    backendUrl:
  *                    name:
  *                    namespace:
+ *                    secureKey
  *                  }
  *                }
  *   responsetype Optional. The web action invocation .extension.  Defaults to json
@@ -569,6 +570,10 @@ function setActionOperationInvocationDetails(swagger, endpoint, operationId, res
   _.set(swagger, 'x-ibm-configuration.assembly.execute[0].operation-switch.case['+caseIdx+'].operations', operations);
   _.set(swagger, 'x-ibm-configuration.assembly.execute[0].operation-switch.case['+caseIdx+'].execute[0].invoke.target-url',  makeWebActionBackendUrl(endpoint.action, responsetype, getPathParameters(endpoint.gatewayPath)));
   _.set(swagger, 'x-ibm-configuration.assembly.execute[0].operation-switch.case['+caseIdx+'].execute[0].invoke.verb', 'keep');
+  if (endpoint.action.secureKey) {
+    _.set(swagger, 'x-ibm-configuration.assembly.execute[0].operation-switch.case['+caseIdx+'].execute[1].set-variable.actions[0].set', 'message.headers.X-Require-Whisk-Auth' );
+    _.set(swagger, 'x-ibm-configuration.assembly.execute[0].operation-switch.case['+caseIdx+'].execute[1].set-variable.actions[0].value', endpoint.action.secureKey );
+  }
 }
 
 // Return the numeric index into case[] into which the associated operation will be configured
diff --git a/core/routemgmt/createApi/createApi.js b/core/routemgmt/createApi/createApi.js
index fbe83be7fd..36310fb1f1 100644
--- a/core/routemgmt/createApi/createApi.js
+++ b/core/routemgmt/createApi/createApi.js
@@ -44,6 +44,7 @@
   *           backendMethod    Required.  Action invocation REST verb.  "POST"
   *           backendUrl       Required.  Action invocation REST url
   *           authkey          Required.  Action invocation auth key
+  *           secureKey        Optional.  Action's require-whisk-auth value
   *      swagger             Required if gatewayBasePath not provided.  API swagger JSON
   *
   * NOTE: The package containing this action will be bound to the following values:
@@ -122,6 +123,7 @@ function main(message) {
     console.log('action backendUrl: '+doc.action.backendUrl);
     console.log('action backendMethod: '+doc.action.backendMethod);
     console.log('action authkey: '+utils.confidentialPrint(doc.action.authkey));
+    console.log('action secureKey: '+utils.confidentialPrint(doc.action.secureKey));
   }
   console.log('calledAsWebAction: '+calledAsWebAction);
   console.log('apidoc        :\n'+JSON.stringify(doc));


 

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services