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:
[email protected]


With regards,
Apache Git Services

Reply via email to