Remove feature to access multiple namespaces with one key
This removes lots of code related to a deprecated 1:n mapping of keys to namespaces. The /namespaces call will now only yield exactly one namespace, which is the namespace of the key you're providing.
diff --git a/tests/src/system/basic/WskBasicTests.scala b/tests/src/system/basic/WskBasicTests.scala
index 44a7ff5..f9e2fb9 100644
--- a/tests/src/system/basic/WskBasicTests.scala
+++ b/tests/src/system/basic/WskBasicTests.scala
@@ -347,7 +347,7 @@
}
wsk.action.invoke(name, blocking = true, expectedExitCode = 246)
- .stderr should include regex (""""error": "This error thrown on purpose by the action."""")
+ .stderr should include regex (""""error": "This error thrown on purpose by the action."""")
}
it should "create and invoke a blocking action resulting in an failed promise" in withAssetCleaner(wskprops) {
@@ -469,16 +469,16 @@
withActivation(wsk.activation, run) {
activation =>
activation.response.result shouldBe Some(dynamicParams.toJson)
- activation.duration shouldBe 0L // shouldn't exist but CLI generates it
- activation.end shouldBe Instant.EPOCH // shouldn't exist but CLI generates it
+ activation.duration shouldBe 0L // shouldn't exist but CLI generates it
+ activation.end shouldBe Instant.EPOCH // shouldn't exist but CLI generates it
}
val runWithNoParams = wsk.trigger.fire(name, Map())
withActivation(wsk.activation, runWithNoParams) {
activation =>
activation.response.result shouldBe Some(JsObject())
- activation.duration shouldBe 0L // shouldn't exist but CLI generates it
- activation.end shouldBe Instant.EPOCH // shouldn't exist but CLI generates it
+ activation.duration shouldBe 0L // shouldn't exist but CLI generates it
+ activation.end shouldBe Instant.EPOCH // shouldn't exist but CLI generates it
}
wsk.trigger.list().stdout should include(name)
@@ -688,9 +688,9 @@
behavior of "Wsk Namespace CLI"
- it should "list namespaces" in {
+ it should "return a list of exactly one namespace" in {
wsk.namespace.list().
- stdout should include regex ("@|guest")
+ stdout.lines should have size 2 // headline + namespace
}
it should "list entities in default namespace" in {
@@ -728,7 +728,7 @@
wsk.activation.get(activation.activationId, fieldFilter = Some("name")).stdout should include(s"""$successMsg name\n"$name"""")
wsk.activation.get(activation.activationId, fieldFilter = Some("version")).stdout should include(s"""$successMsg version\n"0.0.1"""")
wsk.activation.get(activation.activationId, fieldFilter = Some("publish")).stdout should include(s"""$successMsg publish\nfalse""")
- wsk.activation.get(activation.activationId, fieldFilter = Some("subject")).stdout should include regex (s"""(?i)$successMsg subject\n$ns_regex_list""")
+ wsk.activation.get(activation.activationId, fieldFilter = Some("subject")).stdout should include regex (s"""(?i)$successMsg subject\n""")
wsk.activation.get(activation.activationId, fieldFilter = Some("activationid")).stdout should include(s"""$successMsg activationid\n"${activation.activationId}""")
wsk.activation.get(activation.activationId, fieldFilter = Some("start")).stdout should include regex (s"""$successMsg start\n\\d""")
wsk.activation.get(activation.activationId, fieldFilter = Some("end")).stdout should include regex (s"""$successMsg end\n\\d""")
diff --git a/tests/src/whisk/core/controller/test/ControllerTestCommon.scala b/tests/src/whisk/core/controller/test/ControllerTestCommon.scala
index eaa1360..ab0e5d3 100644
--- a/tests/src/whisk/core/controller/test/ControllerTestCommon.scala
+++ b/tests/src/whisk/core/controller/test/ControllerTestCommon.scala
@@ -42,7 +42,6 @@
import whisk.core.database.test.DbUtils
import whisk.core.entitlement._
import whisk.core.entity._
-import whisk.core.iam.NamespaceProvider
import whisk.core.loadBalancer.LoadBalancer
protected trait ControllerTestCommon
@@ -68,8 +67,7 @@
override val loadBalancer = new DegenerateLoadBalancerService(whiskConfig)
- override val iam = new NamespaceProvider(whiskConfig, forceLocal = true)
- override lazy val entitlementProvider: EntitlementProvider = new LocalEntitlementProvider(whiskConfig, loadBalancer, iam)
+ override lazy val entitlementProvider: EntitlementProvider = new LocalEntitlementProvider(whiskConfig, loadBalancer)
override val activationIdFactory = new ActivationId.ActivationIdGenerator() {
// need a static activation id to test activations api
diff --git a/tests/src/whisk/core/controller/test/MetaApiTests.scala b/tests/src/whisk/core/controller/test/MetaApiTests.scala
index 38b294c..ffc00f5 100644
--- a/tests/src/whisk/core/controller/test/MetaApiTests.scala
+++ b/tests/src/whisk/core/controller/test/MetaApiTests.scala
@@ -48,7 +48,6 @@
import whisk.core.entitlement.Resource
import whisk.core.entity._
import whisk.core.entity.size._
-import whisk.core.iam.NamespaceProvider
import whisk.core.loadBalancer.LoadBalancer
import whisk.http.ErrorResponse
import whisk.http.Messages
@@ -74,7 +73,7 @@
val systemId = Subject()
val systemKey = AuthKey()
val systemIdentity = Future.successful(Identity(systemId, EntityName(systemId.asString), systemKey, Privilege.ALL))
- override lazy val entitlementProvider = new TestingEntitlementProvider(whiskConfig, loadBalancer, iam)
+ override lazy val entitlementProvider = new TestingEntitlementProvider(whiskConfig, loadBalancer)
/** Meta API tests */
behavior of "Meta API"
@@ -805,9 +804,8 @@
class TestingEntitlementProvider(
config: WhiskConfig,
- loadBalancer: LoadBalancer,
- iam: NamespaceProvider)
- extends EntitlementProvider(config, loadBalancer, iam) {
+ loadBalancer: LoadBalancer)
+ extends EntitlementProvider(config, loadBalancer) {
protected[core] override def checkThrottles(user: Identity)(
implicit transid: TransactionId): Future[Unit] = {