rabbah commented on a change in pull request #3752: Move uuid into namespace to 
decouple it from authkey
URL: 
https://github.com/apache/incubator-openwhisk/pull/3752#discussion_r194742820
 
 

 ##########
 File path: common/scala/src/main/scala/whisk/core/entity/WhiskAuth.scala
 ##########
 @@ -25,18 +25,18 @@ import scala.util.Try
  * database. Each namespace has its own key which is used to determine
  * the {@ Identity} of the user calling.
  */
-protected[core] case class WhiskNamespace(name: EntityName, authkey: AuthKey)
+protected[core] case class WhiskNamespace(namespace: Namespace, authkey: 
AuthKey)
 
 protected[core] object WhiskNamespace extends DefaultJsonProtocol {
   implicit val serdes = new RootJsonFormat[WhiskNamespace] {
     def write(w: WhiskNamespace) =
-      JsObject("name" -> w.name.toJson, "uuid" -> w.authkey.uuid.toJson, "key" 
-> w.authkey.key.toJson)
+      JsObject("name" -> w.namespace.name.toJson, "uuid" -> 
w.namespace.uuid.toJson, "key" -> w.authkey.key.toJson)
 
     def read(value: JsValue) =
       Try {
         value.asJsObject.getFields("name", "uuid", "key") match {
           case Seq(JsString(n), JsString(u), JsString(k)) =>
-            WhiskNamespace(EntityName(n), AuthKey(UUID(u), Secret(k)))
+            WhiskNamespace(Namespace(EntityName(n), UUID(u)), AuthKey(UUID(u), 
Secret(k)))
 
 Review comment:
   this implies a database schema change in the database.

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to