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/06/28 16:38:30 UTC

[GitHub] chetanmeh commented on a change in pull request #3821: Avoid regenerating auth key multiple times

chetanmeh commented on a change in pull request #3821: Avoid regenerating auth key multiple times
URL: https://github.com/apache/incubator-openwhisk/pull/3821#discussion_r198908228
 
 

 ##########
 File path: tools/admin/src/main/scala/whisk/core/database/UserCommand.scala
 ##########
 @@ -85,9 +85,7 @@ class UserCommand extends Subcommand("user") with WhiskCommand {
 
     def isUUID(u: String) = Try(UUID.fromString(u)).isSuccess
 
-    def desiredNamespace = Namespace(EntityName(namespace.getOrElse(subject()).trim), authKey.uuid)
-
-    def authKey: AuthKey = auth.map(AuthKey(_)).getOrElse(AuthKey())
+    def desiredNamespace(authKey: AuthKey) = Namespace(EntityName(namespace.getOrElse(subject()).trim), authKey.uuid)
 
 Review comment:
   `subject` here is of type [ScallopOption[String]][1] and `subject()` invokes the [apply][2] method to extract the underlying value. Hence need to use `subject()` approach
   
   [1]: http://scallop.github.io/scallop/org/rogach/scallop/ScallopOption.html
   [2]: http://scallop.github.io/scallop/org/rogach/scallop/ScallopOption.html#apply():A

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