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/09/05 23:25:52 UTC

[GitHub] asteed commented on a change in pull request #3661: Restrict allowed namespaces when creating action of certain kinds

asteed commented on a change in pull request #3661: Restrict allowed namespaces when creating action of certain kinds
URL: https://github.com/apache/incubator-openwhisk/pull/3661#discussion_r215455554
 
 

 ##########
 File path: tests/src/test/scala/whisk/core/controller/test/EntitlementProviderTests.scala
 ##########
 @@ -681,4 +689,25 @@ class EntitlementProviderTests extends ControllerTestCommon with ScalaFutures {
         Await.ready(check, requestTimeout).eitherValue.get shouldBe expected
     }
   }
+
+  it should "restrict access to disallowed action kinds for a subject" in {
+    implicit val tid = transid()
+    implicit val ep = entitlementProvider
+    val subject = WhiskAuthHelpers.newIdentity().copy(limits = UserLimits(allowedKinds = Some(allowedKinds)))
+
+    disallowedKinds.foreach(k =>
+      intercept[RejectRequest] {
+        Await.result(ep.check(subject, Some(getExec(k))), 1.seconds)
 
 Review comment:
   Good catch. I've added the message checker

----------------------------------------------------------------
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