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/02/15 14:52:47 UTC
[GitHub] mdeuser commented on a change in pull request #4284: Add an
annotations to inject the API key into the action context.
mdeuser 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_r257263385
##########
File path: core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/ContainerProxy.scala
##########
@@ -560,7 +560,9 @@ class ContainerProxy(
}
val parameters = job.msg.content getOrElse JsObject.empty
- val authEnvironment = job.msg.user.authkey.toEnvironment
+ val authEnvironment = if (job.action.annotations.isTruthy(WhiskAction.provideApiKeyAnnotationName)) {
+ job.msg.user.authkey.toEnvironment
+ } else JsObject.empty
Review comment:
just want to confirm my understanding as well as the non-breaking behavior in an update scenario. from the dev list discussion
> actions which do not have the annotation will still get the api key injected. The annotation is added by the controller when an action is created or updated unless already present. The default value for the annotation is "false", meaning no key is injected to the action context.
here's the scenario
1. an existing action without annotation is updated, the request does not specify the annotation
2. backend sees action without annotation and updates action with the annotation
- will this value be `true` or `false` ?
3. some time later, another request to update the same action is made. as before, the request does not specify the annotation.
- will the updated action have the annotation set to `true` or `false`?
----------------------------------------------------------------
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