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/03/05 16:21:07 UTC

[GitHub] rabbah commented on a change in pull request #3371: Make AuthKey parsing leaner.

rabbah commented on a change in pull request #3371: Make AuthKey parsing leaner.
URL: https://github.com/apache/incubator-openwhisk/pull/3371#discussion_r172241948
 
 

 ##########
 File path: common/scala/src/main/scala/whisk/core/entity/AuthKey.scala
 ##########
 @@ -64,37 +60,22 @@ protected[core] object AuthKey {
    * the first two hence "k:v*" produces ("k","v").
    *
    * @param str the string containing uuid and key separated by colon
-   * @return AuthKey if argument is properly formated
+   * @return AuthKey if argument is properly formatted
    * @throws IllegalArgumentException if argument is not well formed
    */
   @throws[IllegalArgumentException]
   protected[core] def apply(str: String): AuthKey = {
-    val (k, v) = split(str)
-    new AuthKey(UUID(k), Secret(v))
-  }
+    val (uuid, secret) = str.split(':').toList match {
+      case k :: v :: _ => (k, v)
 
 Review comment:
   trim `k` and `v` (preserve existing split) or treat pedantically (new split)?

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