)]}'
{"barbican/api/controllers/secrets.py":[{"author":{"_account_id":6783,"name":"Nathan Reller","email":"nathan.s.reller@gmail.com","username":"rellerreller"},"change_message_id":"39949be9c8c83a3b31aecba42bc1a8672fb04b61","unresolved":false,"context_lines":[{"line_number":65,"context_line":"                                       secret_repo\u003dsecret_repo,"},{"line_number":66,"context_line":"                                       datum_repo\u003ddatum_repo,"},{"line_number":67,"context_line":"                                       kek_repo\u003dkek_repo,"},{"line_number":68,"context_line":"                                       secret_meta_repo\u003dsecret_meta_repo)"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"    @pecan.expose(generic\u003dTrue)"},{"line_number":71,"context_line":"    @allow_all_content_types"}],"source_content_type":"text/x-python","patch_set":1,"id":"baada198_d136d8b3","line":68,"updated":"2014-07-17 21:20:39.000000000","message":"As we discussed at the summit, I think these repos should be created or found via a factory. That way we do not have to pass them down through all of the layers.","commit_id":"dc9640d8212251bbc46fa94695c6a0ae260e98d8"},{"author":{"_account_id":11860,"name":"Yang Li","email":"yang.li14@hp.com","username":"yangli"},"change_message_id":"2286d0a804c0ea1b44715c6e65045cb2821c6a5e","unresolved":false,"context_lines":[{"line_number":65,"context_line":"                                       secret_repo\u003dsecret_repo,"},{"line_number":66,"context_line":"                                       datum_repo\u003ddatum_repo,"},{"line_number":67,"context_line":"                                       kek_repo\u003dkek_repo,"},{"line_number":68,"context_line":"                                       secret_meta_repo\u003dsecret_meta_repo)"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"    @pecan.expose(generic\u003dTrue)"},{"line_number":71,"context_line":"    @allow_all_content_types"}],"source_content_type":"text/x-python","patch_set":1,"id":"baada198_fdf0a6fe","line":68,"in_reply_to":"baada198_d136d8b3","updated":"2014-07-21 21:50:30.000000000","message":"Agree. Repos should be created via a factory.","commit_id":"dc9640d8212251bbc46fa94695c6a0ae260e98d8"},{"author":{"_account_id":9914,"name":"Ade Lee","email":"alee@redhat.com","username":"alee"},"change_message_id":"d1f9af75ad80a2d500650aeb5741ef1d10a006fc","unresolved":false,"context_lines":[{"line_number":65,"context_line":"                                       secret_repo\u003dsecret_repo,"},{"line_number":66,"context_line":"                                       datum_repo\u003ddatum_repo,"},{"line_number":67,"context_line":"                                       kek_repo\u003dkek_repo,"},{"line_number":68,"context_line":"                                       secret_meta_repo\u003dsecret_meta_repo)"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"    @pecan.expose(generic\u003dTrue)"},{"line_number":71,"context_line":"    @allow_all_content_types"}],"source_content_type":"text/x-python","patch_set":1,"id":"baada198_41198886","line":68,"in_reply_to":"baada198_fdf0a6fe","updated":"2014-07-29 05:40:57.000000000","message":"Agreed.  That change should be part of a separate CR though.","commit_id":"dc9640d8212251bbc46fa94695c6a0ae260e98d8"},{"author":{"_account_id":7789,"name":"John Wood","email":"john.wood@rackspace.com","username":"woodster"},"change_message_id":"dce832ff73e7676f4021076260a4847fbd8059e6","unresolved":false,"context_lines":[{"line_number":84,"context_line":"            pecan.override_template(\u0027json\u0027, \u0027application/json\u0027)"},{"line_number":85,"context_line":"            secret_fields \u003d putil.mime_types.augment_fields_with_content_types("},{"line_number":86,"context_line":"                secret)"},{"line_number":87,"context_line":"            tkey_id \u003d plugin.get_transport_key_for_retrieval(secret)"},{"line_number":88,"context_line":"            if tkey_id is not None:"},{"line_number":89,"context_line":"                secret_fields[\u0027transport_key_id\u0027] \u003d tkey_id"},{"line_number":90,"context_line":"            return hrefs.convert_to_hrefs(keystone_id, secret_fields)"}],"source_content_type":"text/x-python","patch_set":1,"id":"baada198_0f24f2ad","line":87,"updated":"2014-07-16 13:57:39.000000000","message":"Shouldn\u0027t the client be passing in the transport key ID they use to wrap the secret here?. I don\u0027t think we should stamp the transport key onto the secret meta data itself. If a client wishes to retrieve the secret later without a transport key, that should be fine. To me, the transport key is a short-lived concept...just supporting immediate store/retrieve operations, and not otherwise making a permanent change to how the secret is retrieved for all time. \n\nIn this context then, the transport key information should not actually ever need to be stored with the secret information. One the secret is securely stored in Dogtag for example, we should be able to later retrieve it without a transport key if we wish I\u0027d think. Is this not the case though?","commit_id":"dc9640d8212251bbc46fa94695c6a0ae260e98d8"},{"author":{"_account_id":9914,"name":"Ade Lee","email":"alee@redhat.com","username":"alee"},"change_message_id":"c75117f72421497c667af5512e816e04cf2a0155","unresolved":false,"context_lines":[{"line_number":84,"context_line":"            pecan.override_template(\u0027json\u0027, \u0027application/json\u0027)"},{"line_number":85,"context_line":"            secret_fields \u003d putil.mime_types.augment_fields_with_content_types("},{"line_number":86,"context_line":"                secret)"},{"line_number":87,"context_line":"            tkey_id \u003d plugin.get_transport_key_for_retrieval(secret)"},{"line_number":88,"context_line":"            if tkey_id is not None:"},{"line_number":89,"context_line":"                secret_fields[\u0027transport_key_id\u0027] \u003d tkey_id"},{"line_number":90,"context_line":"            return hrefs.convert_to_hrefs(keystone_id, secret_fields)"}],"source_content_type":"text/x-python","patch_set":1,"id":"baada198_e62b2b31","line":87,"in_reply_to":"baada198_0f24f2ad","updated":"2014-07-17 17:39:10.000000000","message":"In this case, the client is getting the secret metadata.  If the plugin that stored the secret is capable of returning a wrapped secret - then the metadata will include a reference to the transport key,\n\nNote that this transport key is the current transport key used by the plugin.  It may or may not be the same as the transport key used during secret storage.  The retrieval operation has nothing to do with the storage operation.\n\nThe client can then choose to retrieve the key using wrapping or not.\nThe wrapping mechanism during retrieval is as follows:\n\n1. The client generates a session key and wraps that session key with the plugin transport key.\n2. The client sends this wrapped session key (the transport key wrapped session key - twsk) with the GET request.\n3.  The plugin --- or actually in this case the DRM -- unwraps the session key -- and the DRM is the only one that can do so.\n4.  The DRM retrieves the secret and wrap it in the session key and returns to the client.\n5.  The client gets the wrapped secret and unwraps it.  It is the only one that can do so because it generated the session key to begin with.\n\nBasically this is encryption end-to-end on the retrieval side.","commit_id":"dc9640d8212251bbc46fa94695c6a0ae260e98d8"},{"author":{"_account_id":9914,"name":"Ade Lee","email":"alee@redhat.com","username":"alee"},"change_message_id":"0b682eb46c7d65bdc46d6bcce6e7eebf26e158eb","unresolved":false,"context_lines":[{"line_number":84,"context_line":"            pecan.override_template(\u0027json\u0027, \u0027application/json\u0027)"},{"line_number":85,"context_line":"            secret_fields \u003d putil.mime_types.augment_fields_with_content_types("},{"line_number":86,"context_line":"                secret)"},{"line_number":87,"context_line":"            tkey_id \u003d plugin.get_transport_key_for_retrieval(secret)"},{"line_number":88,"context_line":"            if tkey_id is not None:"},{"line_number":89,"context_line":"                secret_fields[\u0027transport_key_id\u0027] \u003d tkey_id"},{"line_number":90,"context_line":"            return hrefs.convert_to_hrefs(keystone_id, secret_fields)"}],"source_content_type":"text/x-python","patch_set":1,"id":"baada198_8e5de84a","line":87,"in_reply_to":"baada198_a94c9477","updated":"2014-07-19 17:24:09.000000000","message":"Sure, I can add that.","commit_id":"dc9640d8212251bbc46fa94695c6a0ae260e98d8"},{"author":{"_account_id":7789,"name":"John Wood","email":"john.wood@rackspace.com","username":"woodster"},"change_message_id":"276c95758c49b8db3348a016f38aeace6f27ed04","unresolved":false,"context_lines":[{"line_number":84,"context_line":"            pecan.override_template(\u0027json\u0027, \u0027application/json\u0027)"},{"line_number":85,"context_line":"            secret_fields \u003d putil.mime_types.augment_fields_with_content_types("},{"line_number":86,"context_line":"                secret)"},{"line_number":87,"context_line":"            tkey_id \u003d plugin.get_transport_key_for_retrieval(secret)"},{"line_number":88,"context_line":"            if tkey_id is not None:"},{"line_number":89,"context_line":"                secret_fields[\u0027transport_key_id\u0027] \u003d tkey_id"},{"line_number":90,"context_line":"            return hrefs.convert_to_hrefs(keystone_id, secret_fields)"}],"source_content_type":"text/x-python","patch_set":1,"id":"baada198_a94c9477","line":87,"in_reply_to":"baada198_e62b2b31","updated":"2014-07-18 05:59:51.000000000","message":"Sorry, you are correct, I think I was thinking storage for some reason. I do think line 87 should only be executed if a query parameter such as \u0027use_transport_key\u003dtrue\u0027 is passed in, to avoid having to hit up the plugin framework when transport key wrapping isn\u0027t needed.","commit_id":"dc9640d8212251bbc46fa94695c6a0ae260e98d8"},{"author":{"_account_id":7789,"name":"John Wood","email":"john.wood@rackspace.com","username":"woodster"},"change_message_id":"276c95758c49b8db3348a016f38aeace6f27ed04","unresolved":false,"context_lines":[{"line_number":92,"context_line":"            tenant \u003d res.get_or_create_tenant(keystone_id,"},{"line_number":93,"context_line":"                                              self.repos.tenant_repo)"},{"line_number":94,"context_line":"            pecan.override_template(\u0027\u0027, pecan.request.accept.header_value)"},{"line_number":95,"context_line":"            twsk \u003d kwargs.get(\u0027trans_wrapped_session_key\u0027, None)"},{"line_number":96,"context_line":""},{"line_number":97,"context_line":"            return plugin.get_secret(pecan.request.accept.header_value,"},{"line_number":98,"context_line":"                                     secret,"}],"source_content_type":"text/x-python","patch_set":1,"id":"baada198_29dc0474","line":95,"updated":"2014-07-18 05:59:51.000000000","message":"If the client don\u0027t also provide the transport key id, then the plugin will just assume that it\u0027s latest transport key was used to wrap the session key? I think it would be more robust for clients to also (or optionally) pass in the transport key id?","commit_id":"dc9640d8212251bbc46fa94695c6a0ae260e98d8"},{"author":{"_account_id":9914,"name":"Ade Lee","email":"alee@redhat.com","username":"alee"},"change_message_id":"0b682eb46c7d65bdc46d6bcce6e7eebf26e158eb","unresolved":false,"context_lines":[{"line_number":92,"context_line":"            tenant \u003d res.get_or_create_tenant(keystone_id,"},{"line_number":93,"context_line":"                                              self.repos.tenant_repo)"},{"line_number":94,"context_line":"            pecan.override_template(\u0027\u0027, pecan.request.accept.header_value)"},{"line_number":95,"context_line":"            twsk \u003d kwargs.get(\u0027trans_wrapped_session_key\u0027, None)"},{"line_number":96,"context_line":""},{"line_number":97,"context_line":"            return plugin.get_secret(pecan.request.accept.header_value,"},{"line_number":98,"context_line":"                                     secret,"}],"source_content_type":"text/x-python","patch_set":1,"id":"baada198_6e133465","line":95,"in_reply_to":"baada198_29dc0474","updated":"2014-07-19 17:24:09.000000000","message":"We can do that.  The plugin can throw an exception if the transport key is no longer valid.  I\u0027ll add an optional transport_key_id.","commit_id":"dc9640d8212251bbc46fa94695c6a0ae260e98d8"},{"author":{"_account_id":7789,"name":"John Wood","email":"john.wood@rackspace.com","username":"woodster"},"change_message_id":"276c95758c49b8db3348a016f38aeace6f27ed04","unresolved":false,"context_lines":[{"line_number":139,"context_line":"        content_encoding \u003d pecan.request.headers.get(\u0027Content-Encoding\u0027)"},{"line_number":140,"context_line":""},{"line_number":141,"context_line":"        plugin.store_secret(payload, content_type,"},{"line_number":142,"context_line":"                            content_encoding, secret_model.to_dict_fields(),"},{"line_number":143,"context_line":"                            secret_model, tenant_model, self.repos,"},{"line_number":144,"context_line":"                            tkey_id)"},{"line_number":145,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"baada198_69e6fc45","line":142,"updated":"2014-07-18 05:59:51.000000000","message":"Good catch!","commit_id":"dc9640d8212251bbc46fa94695c6a0ae260e98d8"}],"barbican/plugin/dogtag.py":[{"author":{"_account_id":6783,"name":"Nathan Reller","email":"nathan.s.reller@gmail.com","username":"rellerreller"},"change_message_id":"39949be9c8c83a3b31aecba42bc1a8672fb04b61","unresolved":false,"context_lines":[{"line_number":177,"context_line":"        The second way is to provide a wrapping key that would be generated"},{"line_number":178,"context_line":"        on the barbican client.  That way only the client will be"},{"line_number":179,"context_line":"        able to unwrap the secret.  This wrapping key is provided in the"},{"line_number":180,"context_line":"        secret_metadata by Barbican core."},{"line_number":181,"context_line":"        \"\"\""},{"line_number":182,"context_line":"        key_id \u003d secret_metadata[DogtagPlugin.KEY_ID]"},{"line_number":183,"context_line":"        twsk \u003d None"}],"source_content_type":"text/x-python","patch_set":1,"id":"baada198_d1b978ed","line":180,"updated":"2014-07-17 21:20:39.000000000","message":"Could we not have Barbican core retrieve the wrapping key? I would like for any key to be used to wrap the key. Therefore a client could create key1 then tell it to retrieve key2 and wrap it using key1. This way Barbican core does not have to know anything about where the transport keys are stored as well.","commit_id":"dc9640d8212251bbc46fa94695c6a0ae260e98d8"},{"author":{"_account_id":9914,"name":"Ade Lee","email":"alee@redhat.com","username":"alee"},"change_message_id":"0b682eb46c7d65bdc46d6bcce6e7eebf26e158eb","unresolved":false,"context_lines":[{"line_number":177,"context_line":"        The second way is to provide a wrapping key that would be generated"},{"line_number":178,"context_line":"        on the barbican client.  That way only the client will be"},{"line_number":179,"context_line":"        able to unwrap the secret.  This wrapping key is provided in the"},{"line_number":180,"context_line":"        secret_metadata by Barbican core."},{"line_number":181,"context_line":"        \"\"\""},{"line_number":182,"context_line":"        key_id \u003d secret_metadata[DogtagPlugin.KEY_ID]"},{"line_number":183,"context_line":"        twsk \u003d None"}],"source_content_type":"text/x-python","patch_set":1,"id":"baada198_81405936","line":180,"in_reply_to":"baada198_c92e2842","updated":"2014-07-19 17:24:09.000000000","message":"Nathan, the idea of the wrapping here is that only the client can decrypt the returned secret.  Barbican core cannot decrypt the key at any time because the session key used to wrap the secret has been sent to Dogtag/KMIP wrapped by the Dogtag/KMIP transport key.","commit_id":"dc9640d8212251bbc46fa94695c6a0ae260e98d8"},{"author":{"_account_id":7789,"name":"John Wood","email":"john.wood@rackspace.com","username":"woodster"},"change_message_id":"276c95758c49b8db3348a016f38aeace6f27ed04","unresolved":false,"context_lines":[{"line_number":177,"context_line":"        The second way is to provide a wrapping key that would be generated"},{"line_number":178,"context_line":"        on the barbican client.  That way only the client will be"},{"line_number":179,"context_line":"        able to unwrap the secret.  This wrapping key is provided in the"},{"line_number":180,"context_line":"        secret_metadata by Barbican core."},{"line_number":181,"context_line":"        \"\"\""},{"line_number":182,"context_line":"        key_id \u003d secret_metadata[DogtagPlugin.KEY_ID]"},{"line_number":183,"context_line":"        twsk \u003d None"}],"source_content_type":"text/x-python","patch_set":1,"id":"baada198_c92e2842","line":180,"in_reply_to":"baada198_d1b978ed","updated":"2014-07-18 05:59:51.000000000","message":"Well, I think Barbican needs to store transport key information if the sequence is: (1) clients make a GET request to Barbican to return a transport key UUID, then (2) they make a GET call to the transport key resource to get the transport key, and then (3) make make a final GET call with their session key wrapped by that transport key. Those three calls could be handled by three different API nodes, so have to be consistent across them...db storage makes the most sense.\n\nAlso, the transport key is just a public key for the private key the plugin ultimately deals with...so clients would not bel able to specify their own transport keys if that is what you are referring to.","commit_id":"dc9640d8212251bbc46fa94695c6a0ae260e98d8"}],"barbican/plugin/resources.py":[{"author":{"_account_id":7789,"name":"John Wood","email":"john.wood@rackspace.com","username":"woodster"},"change_message_id":"276c95758c49b8db3348a016f38aeace6f27ed04","unresolved":false,"context_lines":[{"line_number":90,"context_line":"    return secret_model, None"},{"line_number":91,"context_line":""},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"def get_secret(requesting_content_type, secret_model, tenant_model, twsk\u003dNone):"},{"line_number":94,"context_line":"    tr.analyze_before_decryption(requesting_content_type)"},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"    # Construct metadata dict from data model."}],"source_content_type":"text/x-python","patch_set":1,"id":"baada198_09a820da","line":93,"updated":"2014-07-18 05:59:51.000000000","message":"Just checking...the secret_store process shouldn\u0027t also need a session key wrapped by transport key....the client can just encrypt their secret via the public transport key and POST up to Barbican, correct?","commit_id":"dc9640d8212251bbc46fa94695c6a0ae260e98d8"},{"author":{"_account_id":6783,"name":"Nathan Reller","email":"nathan.s.reller@gmail.com","username":"rellerreller"},"change_message_id":"39949be9c8c83a3b31aecba42bc1a8672fb04b61","unresolved":false,"context_lines":[{"line_number":113,"context_line":"    secret_dto \u003d retrieve_plugin.get_secret(secret_metadata, context)"},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"    if twsk is not None:"},{"line_number":116,"context_line":"        del secret_metadata[\u0027trans_wrapped_session_key\u0027]"},{"line_number":117,"context_line":"    # Denormalize the secret."},{"line_number":118,"context_line":"    return tr.denormalize_after_decryption(secret_dto.secret,"},{"line_number":119,"context_line":"                                           requesting_content_type)"}],"source_content_type":"text/x-python","patch_set":1,"id":"baada198_f1067c84","line":116,"updated":"2014-07-17 21:20:39.000000000","message":"Again comment about passing in ID instead of actual key.","commit_id":"dc9640d8212251bbc46fa94695c6a0ae260e98d8"},{"author":{"_account_id":7789,"name":"John Wood","email":"john.wood@rackspace.com","username":"woodster"},"change_message_id":"276c95758c49b8db3348a016f38aeace6f27ed04","unresolved":false,"context_lines":[{"line_number":113,"context_line":"    secret_dto \u003d retrieve_plugin.get_secret(secret_metadata, context)"},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"    if twsk is not None:"},{"line_number":116,"context_line":"        del secret_metadata[\u0027trans_wrapped_session_key\u0027]"},{"line_number":117,"context_line":"    # Denormalize the secret."},{"line_number":118,"context_line":"    return tr.denormalize_after_decryption(secret_dto.secret,"},{"line_number":119,"context_line":"                                           requesting_content_type)"}],"source_content_type":"text/x-python","patch_set":1,"id":"baada198_496218da","line":116,"in_reply_to":"baada198_f1067c84","updated":"2014-07-18 05:59:51.000000000","message":"This is actually the full \u0027session key wrapped by transport key\u0027 blob here, rather than the transport key by itself.","commit_id":"dc9640d8212251bbc46fa94695c6a0ae260e98d8"}]}
