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 2019/03/05 01:56:30 UTC

[GitHub] [incubator-openwhisk] rabbah commented on a change in pull request #4284: Add an annotations to inject the API key into the action context.

rabbah commented on a change in pull request #4284: Add an annotations to inject the API key into the action context.
URL: https://github.com/apache/incubator-openwhisk/pull/4284#discussion_r262320168
 
 

 ##########
 File path: core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/ContainerProxy.scala
 ##########
 @@ -560,7 +560,13 @@ class ContainerProxy(
         }
         val parameters = job.msg.content getOrElse JsObject.empty
 
-        val authEnvironment = job.msg.user.authkey.toEnvironment
+        // if the action requests the api key to be injected into the action context, add it here;
+        // treat a missing annotation as requesting the api key for backward compatibility
+        val authEnvironment = {
+          if (job.action.annotations.isTruthy(WhiskAction.provideApiKeyAnnotationName, valueForNonExistent = true)) {
+            job.msg.user.authkey.toEnvironment
+          } else JsObject.empty
 
 Review comment:
   Thanks!

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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