nitikagarw commented on a change in pull request #4989:
URL: https://github.com/apache/openwhisk/pull/4989#discussion_r499470017



##########
File path: 
tests/src/test/scala/org/apache/openwhisk/core/cli/test/WskWebActionsTests.scala
##########
@@ -147,6 +147,25 @@ class WskWebActionsTests extends TestHelpers with 
WskTestHelpers with RestUtil w
       
authorizedResponse.body.asString.parseJson.asJsObject.fields("__ow_user").convertTo[String]
 shouldBe namespace
   }
 
+  /**
+   * Tests web action not requiring authentication.
+   */
+  it should "create a web action not requiring authentication accessible via 
HTTPS" in withAssetCleaner(wskprops) {
+    (wp, assetHelper) =>
+      val name = "webaction"
+      val file = Some(TestUtils.getTestActionFilename("echo.js"))
+      val host = getServiceURL()
+      val url = s"$host$testRoutePath/$namespace/default/$name.json"
+
+      assetHelper.withCleaner(wsk.action, name) { (action, _) =>
+        action.create(name, file, web = Some("true"), annotations = 
Map("require-whisk-auth" -> false.toJson))
+      }
+
+      val unauthorizedResponse = RestAssured.given().config(sslconfig).get(url)
+      unauthorizedResponse.statusCode shouldBe 200
+      
unauthorizedResponse.body.asString.parseJson.asJsObject.fields("__ow_user").convertTo[String]
 shouldBe namespace

Review comment:
       I think this field is set only in the case of an Authenticated user and 
this assert should be removed?
   Reference:  
https://github.com/apache/openwhisk/blob/master/core/routemgmt/getApi/getApi.js#L27




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to