rabbah commented on a change in pull request #2530: Add a database flag to
completely block a given subject.
URL:
https://github.com/apache/incubator-openwhisk/pull/2530#discussion_r129582471
##########
File path: tests/src/test/scala/whisk/core/admin/WskAdminTests.scala
##########
@@ -91,4 +91,37 @@ class WskAdminTests
val ns = wsk.namespace.whois()
wskadmin.cli(Seq("user", "get", ns)).stdout.trim should
be(wskprops.authKey)
}
+
+ it should "block and unblock a user respectively" in {
+ val wskadmin = new RunWskAdminCmd {}
+ val auth = AuthKey()
+ val subject = Subject().asString
+ try {
+ println(s"CRD subject: $subject")
+ wskadmin.cli(Seq("user", "create", subject, "-u", auth.compact))
+
+ whisk.utils.retry({
+ // reverse lookup by namespace
+ wskadmin.cli(Seq("user", "list", "-k", subject)).stdout.trim
should be(auth.compact)
+ }, 10, Some(1.second))
+
+ // block the user
+ wskadmin.cli(Seq("user", "block", subject))
+
+ // wait until the user can no longer be found
+ whisk.utils.retry({
+ wskadmin.cli(Seq("user", "list", subject)).stdout.trim should
startWith("no identities")
Review comment:
this behavior might be a little confusing - i understand why it's done this
way: requires no schema changes but maybe in the wskadmin utility, listing
namespaces for a blocked subject could at least tell you the identities are
blocked... this could be helpful if for example an identity is blocked, but
without knowing so, someone tries to add new namespaces and end up "startled"
in that the addition will work but listing the spaces will return "no
identities".
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services