You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwhisk.apache.org by ma...@apache.org on 2018/08/20 14:46:00 UTC
[incubator-openwhisk] branch master updated: Add implicit
ActorSystem when getting the namespace identity. (#3902)
This is an automated email from the ASF dual-hosted git repository.
markusthoemmes pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk.git
The following commit(s) were added to refs/heads/master by this push:
new 6f10bb5 Add implicit ActorSystem when getting the namespace identity. (#3902)
6f10bb5 is described below
commit 6f10bb5857a465c41d57f157153504c935d99146
Author: Martin Henke <ma...@web.de>
AuthorDate: Mon Aug 20 16:45:55 2018 +0200
Add implicit ActorSystem when getting the namespace identity. (#3902)
---
.../scala/whisk/core/controller/BasicAuthenticationDirective.scala | 4 +++-
core/controller/src/main/scala/whisk/core/controller/RestAPIs.scala | 4 ++--
core/controller/src/main/scala/whisk/core/controller/WebActions.scala | 4 ++--
3 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/core/controller/src/main/scala/whisk/core/controller/BasicAuthenticationDirective.scala b/core/controller/src/main/scala/whisk/core/controller/BasicAuthenticationDirective.scala
index 7bc5e32..c0e06c5 100644
--- a/core/controller/src/main/scala/whisk/core/controller/BasicAuthenticationDirective.scala
+++ b/core/controller/src/main/scala/whisk/core/controller/BasicAuthenticationDirective.scala
@@ -17,6 +17,7 @@
package whisk.core.controller
+import akka.actor.ActorSystem
import akka.http.scaladsl.model.headers._
import akka.http.scaladsl.server.Directives._
import akka.http.scaladsl.server.directives.{AuthenticationDirective, AuthenticationResult}
@@ -73,7 +74,8 @@ object BasicAuthenticationDirective extends AuthenticationDirectiveProvider {
}
}
- def identityByNamespace(namespace: EntityName)(implicit transid: TransactionId, authStore: AuthStore) = {
+ def identityByNamespace(
+ namespace: EntityName)(implicit transid: TransactionId, system: ActorSystem, authStore: AuthStore) = {
Identity.get(authStore, namespace)
}
diff --git a/core/controller/src/main/scala/whisk/core/controller/RestAPIs.scala b/core/controller/src/main/scala/whisk/core/controller/RestAPIs.scala
index c21e112..3f69c83 100644
--- a/core/controller/src/main/scala/whisk/core/controller/RestAPIs.scala
+++ b/core/controller/src/main/scala/whisk/core/controller/RestAPIs.scala
@@ -343,6 +343,6 @@ trait AuthenticationDirectiveProvider extends Spi {
* @param namespace the namespace that the identity will be based on
* @return identity based on the given namespace
*/
- def identityByNamespace(namespace: EntityName)(implicit transid: TransactionId,
- authStore: AuthStore): Future[Identity]
+ def identityByNamespace(
+ namespace: EntityName)(implicit transid: TransactionId, system: ActorSystem, authStore: AuthStore): Future[Identity]
}
diff --git a/core/controller/src/main/scala/whisk/core/controller/WebActions.scala b/core/controller/src/main/scala/whisk/core/controller/WebActions.scala
index 26e2923..b6d39b5 100644
--- a/core/controller/src/main/scala/whisk/core/controller/WebActions.scala
+++ b/core/controller/src/main/scala/whisk/core/controller/WebActions.scala
@@ -465,8 +465,8 @@ trait WhiskWebActionsApi extends Directives with ValidateRequestSize with PostAc
* This method is factored out to allow mock testing.
*/
protected def getIdentity(namespace: EntityName)(implicit transid: TransactionId): Future[Identity] = {
-
- authenticationProvider.identityByNamespace(namespace)(transid, authStore)
+ // ask auth provider to create an identity for the given namespace
+ authenticationProvider.identityByNamespace(namespace)(transid, actorSystem, authStore)
}
private def handleMatch(namespaceSegment: String,