You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by gi...@git.apache.org on 2017/08/01 01:43:28 UTC

[GitHub] ningyougang commented on a change in pull request #2517: Support client certificate verify on server side

ningyougang commented on a change in pull request #2517: Support client certificate verify on server side
URL: https://github.com/apache/incubator-openwhisk/pull/2517#discussion_r130503463
 
 

 ##########
 File path: common/scala/src/main/scala/whisk/core/entity/Identity.scala
 ##########
 @@ -74,6 +74,53 @@ object Identity extends MultipleReadersSingleWriterCache[Identity, DocInfo] with
         })
     }
 
+    /**
+      * Many subjects can be belonged to only one namespace
+      * Retrieves a key for namespace + subject.
+      *
+      */
+    def get(datastore: AuthStore, namespace: EntityName, subject: Subject)(
 
 Review comment:
   Does it make more sense to actually look up the doc by subject id (that's a primary key) 
   
   answer:can lookup the doc by subject?i find it doesn't exist find by subject id.
   regarding `_design/subjects`, the function define as followings
   
   {
      "identities": {
          "map": "function (doc) {
             if(doc.uuid && doc.key) {
               var v = {namespace: doc.subject, uuid: doc.uuid, key: doc.key};  
               `emit([doc.subject], v);  # actully, the key is namespace, because the subject value == namespace value. `
               emit([doc.uuid, doc.key], v);
             } 
             if(doc.namespaces) { 
               doc.namespaces.forEach(function(namespace) { 
               var v = {namespace: namespace.name, uuid: namespace.uuid, key: namespace.key};
               `emit([namespace.name], v); # The key is namespace`
               `emit([namespace.uuid, namespace.key], v); # The key is auth key`
               });
                }
               }"
      }
   }
   
   So you can see above function, it only supports query docs by namespace or auth key.
   If can look up the doc by subject id, can you show the gist?
   
   I first find doc query by namespace, then find the subject in that doc. it seems the solution
   is similar with your solution(first find doc by subject, then find the namepsace in that doc )
 
----------------------------------------------------------------
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