)]}'
{"barbican/plugin/interface/secret_store.py":[{"author":{"_account_id":7789,"name":"John Wood","email":"john.wood@rackspace.com","username":"woodster"},"change_message_id":"e70e1f3910e8dd43d509d0cf4ee27b7ba64f7683","unresolved":false,"context_lines":[{"line_number":619,"context_line":"        self.global_default_store_dict \u003d None"},{"line_number":620,"context_line":"        self.plugin_lookup_field \u003d \"store_plugin\""},{"line_number":621,"context_line":"        if utils.is_multiple_backends_enabled():"},{"line_number":622,"context_line":"            self.parsed_stores \u003d multiple_backends.\\"},{"line_number":623,"context_line":"                read_multiple_backends_config()"},{"line_number":624,"context_line":"            plugin_names \u003d [store.store_plugin for store in self.parsed_stores"},{"line_number":625,"context_line":"                            if store.store_plugin]"}],"source_content_type":"text/x-python","patch_set":8,"id":"9a89bdaa_80837d55","line":622,"updated":"2016-09-12 23:37:31.000000000","message":"Similar comment to other CR...not digging side effect setting in a getter...can these \u0027self.\u0027 setting things be pulled up to the init() method, including a self.is_multiple_backens_enabled instance var?","commit_id":"32025bf80ca0256048063a9157c455c2e53f70cc"},{"author":{"_account_id":1091,"name":"Arun Kant","email":"arukant@cisco.com","username":"arunkant-uws"},"change_message_id":"ae691d164d4c00958f72269722f0dd0e69bda1bb","unresolved":false,"context_lines":[{"line_number":619,"context_line":"        self.global_default_store_dict \u003d None"},{"line_number":620,"context_line":"        self.plugin_lookup_field \u003d \"store_plugin\""},{"line_number":621,"context_line":"        if utils.is_multiple_backends_enabled():"},{"line_number":622,"context_line":"            self.parsed_stores \u003d multiple_backends.\\"},{"line_number":623,"context_line":"                read_multiple_backends_config()"},{"line_number":624,"context_line":"            plugin_names \u003d [store.store_plugin for store in self.parsed_stores"},{"line_number":625,"context_line":"                            if store.store_plugin]"}],"source_content_type":"text/x-python","patch_set":8,"id":"9a89bdaa_eba086f6","line":622,"in_reply_to":"9a89bdaa_80837d55","updated":"2016-09-13 13:30:33.000000000","message":"Similar reply to part 1 review.\n\nI am not using \u0027multiple_secret_stores_enabled\u0027 variable anymore as I have consistently switched to using \u0027utils.is_multiple_backends_enabled()\u0027 method instead. That\u0027s why its removed here and in crypto manager logic.\n\nFor other question about calling from init method. \nThe method \u0027_get_internal_plugin_names\u0027 is called only from __init__ method at line # 64. Earlier I had part of __init__ method itself but then refactored as separate function to keep __init__ logic clean (earlier version in PS 10: https://review.openstack.org/#/c/354285/10/barbican/plugin/crypto/manager.py). \n\nIf preferred, I can move it back to __init__ method as there is no other caller of \u0027_get_internal_plugin_names\u0027 method. \n\nPlease advise. \n\nSame pattern is used for crypto manager as well.","commit_id":"32025bf80ca0256048063a9157c455c2e53f70cc"}],"barbican/plugin/util/multiple_backends.py":[{"author":{"_account_id":7789,"name":"John Wood","email":"john.wood@rackspace.com","username":"woodster"},"change_message_id":"e70e1f3910e8dd43d509d0cf4ee27b7ba64f7683","unresolved":false,"context_lines":[{"line_number":150,"context_line":"    conf_stores \u003d []"},{"line_number":151,"context_line":"    for parsed_store in secretstore_manager.parsed_stores:"},{"line_number":152,"context_line":"        crypto_plugin \u003d parsed_store.crypto_plugin"},{"line_number":153,"context_line":"        if not parsed_store.crypto_plugin:"},{"line_number":154,"context_line":"            crypto_plugin \u003d None"},{"line_number":155,"context_line":""},{"line_number":156,"context_line":"        friendly_name \u003d ss_friendly_names.get(parsed_store.store_plugin, None)"}],"source_content_type":"text/x-python","patch_set":8,"id":"9a89bdaa_00412da9","line":153,"updated":"2016-09-12 23:37:31.000000000","message":"Maybe this instead:\n\n    if not crypto_plugin:\n        crypto_plugin \u003d None","commit_id":"32025bf80ca0256048063a9157c455c2e53f70cc"},{"author":{"_account_id":1091,"name":"Arun Kant","email":"arukant@cisco.com","username":"arunkant-uws"},"change_message_id":"ae691d164d4c00958f72269722f0dd0e69bda1bb","unresolved":false,"context_lines":[{"line_number":150,"context_line":"    conf_stores \u003d []"},{"line_number":151,"context_line":"    for parsed_store in secretstore_manager.parsed_stores:"},{"line_number":152,"context_line":"        crypto_plugin \u003d parsed_store.crypto_plugin"},{"line_number":153,"context_line":"        if not parsed_store.crypto_plugin:"},{"line_number":154,"context_line":"            crypto_plugin \u003d None"},{"line_number":155,"context_line":""},{"line_number":156,"context_line":"        friendly_name \u003d ss_friendly_names.get(parsed_store.store_plugin, None)"}],"source_content_type":"text/x-python","patch_set":8,"id":"9a89bdaa_4bc5f28b","line":153,"in_reply_to":"9a89bdaa_00412da9","updated":"2016-09-13 13:30:33.000000000","message":"Okay..will make the change","commit_id":"32025bf80ca0256048063a9157c455c2e53f70cc"},{"author":{"_account_id":7789,"name":"John Wood","email":"john.wood@rackspace.com","username":"woodster"},"change_message_id":"e70e1f3910e8dd43d509d0cf4ee27b7ba64f7683","unresolved":false,"context_lines":[{"line_number":153,"context_line":"        if not parsed_store.crypto_plugin:"},{"line_number":154,"context_line":"            crypto_plugin \u003d None"},{"line_number":155,"context_line":""},{"line_number":156,"context_line":"        friendly_name \u003d ss_friendly_names.get(parsed_store.store_plugin, None)"},{"line_number":157,"context_line":"        if not friendly_name and crypto_plugin:"},{"line_number":158,"context_line":"            friendly_name \u003d crypto_friendly_names.get(crypto_plugin)"},{"line_number":159,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"9a89bdaa_e00e098b","line":156,"updated":"2016-09-12 23:37:31.000000000","message":", None is not needed\u0027\n\nAlso, thinkings it\u0027s better to do this to avoid unnecessary ss friendly name call if this is a crypto_plugin:\n\nif crypto_plugin:\n    friendly_name \u003d crypto_friendly_names.get(crypto_plugin)\nelse:\n    friendly_name \u003d ss_friendly_names.get(parsed_store.store_plugin)","commit_id":"32025bf80ca0256048063a9157c455c2e53f70cc"},{"author":{"_account_id":1091,"name":"Arun Kant","email":"arukant@cisco.com","username":"arunkant-uws"},"change_message_id":"ae691d164d4c00958f72269722f0dd0e69bda1bb","unresolved":false,"context_lines":[{"line_number":153,"context_line":"        if not parsed_store.crypto_plugin:"},{"line_number":154,"context_line":"            crypto_plugin \u003d None"},{"line_number":155,"context_line":""},{"line_number":156,"context_line":"        friendly_name \u003d ss_friendly_names.get(parsed_store.store_plugin, None)"},{"line_number":157,"context_line":"        if not friendly_name and crypto_plugin:"},{"line_number":158,"context_line":"            friendly_name \u003d crypto_friendly_names.get(crypto_plugin)"},{"line_number":159,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"9a89bdaa_cb2ca24c","line":156,"in_reply_to":"9a89bdaa_e00e098b","updated":"2016-09-13 13:30:33.000000000","message":"Okay. Will make that change.\n\nYes, None is not needed..just trying to make it explicit as I don\u0027t have None as default in line # 158","commit_id":"32025bf80ca0256048063a9157c455c2e53f70cc"},{"author":{"_account_id":9914,"name":"Ade Lee","email":"alee@redhat.com","username":"alee"},"change_message_id":"a70bedbf1b37457fdf61e39157eb231ab776c3a9","unresolved":false,"context_lines":[{"line_number":176,"context_line":"                if db_store_match.global_default !\u003d conf_store.global_default:"},{"line_number":177,"context_line":"                    db_store_match.global_default \u003d conf_store.global_default"},{"line_number":178,"context_line":"                    # persist flag change."},{"line_number":179,"context_line":"                    db_store_match.save()"},{"line_number":180,"context_line":"                # remove matches store from local list after processing"},{"line_number":181,"context_line":"                db_stores.remove(db_store_match)"},{"line_number":182,"context_line":"            else:  # new conf entry as no match found in existing entries"}],"source_content_type":"text/x-python","patch_set":8,"id":"9a89bdaa_ffd3d201","line":179,"updated":"2016-09-13 16:24:51.000000000","message":"Is there a database constraint that allows only one entry in the secret_store table to be set to the global default?\n\nIf so, will we run into possible conflicts here?","commit_id":"32025bf80ca0256048063a9157c455c2e53f70cc"},{"author":{"_account_id":1091,"name":"Arun Kant","email":"arukant@cisco.com","username":"arunkant-uws"},"change_message_id":"8a91eb3b46e130dbe8281285f1b026a2970791d0","unresolved":false,"context_lines":[{"line_number":176,"context_line":"                if db_store_match.global_default !\u003d conf_store.global_default:"},{"line_number":177,"context_line":"                    db_store_match.global_default \u003d conf_store.global_default"},{"line_number":178,"context_line":"                    # persist flag change."},{"line_number":179,"context_line":"                    db_store_match.save()"},{"line_number":180,"context_line":"                # remove matches store from local list after processing"},{"line_number":181,"context_line":"                db_stores.remove(db_store_match)"},{"line_number":182,"context_line":"            else:  # new conf entry as no match found in existing entries"}],"source_content_type":"text/x-python","patch_set":8,"id":"9a89bdaa_99158141","line":179,"in_reply_to":"9a89bdaa_ffd3d201","updated":"2016-09-13 18:34:18.000000000","message":"There is no db constraint defined (available) to have only one entry to have \u0027True\u0027 value.","commit_id":"32025bf80ca0256048063a9157c455c2e53f70cc"},{"author":{"_account_id":7789,"name":"John Wood","email":"john.wood@rackspace.com","username":"woodster"},"change_message_id":"e70e1f3910e8dd43d509d0cf4ee27b7ba64f7683","unresolved":false,"context_lines":[{"line_number":178,"context_line":"                    # persist flag change."},{"line_number":179,"context_line":"                    db_store_match.save()"},{"line_number":180,"context_line":"                # remove matches store from local list after processing"},{"line_number":181,"context_line":"                db_stores.remove(db_store_match)"},{"line_number":182,"context_line":"            else:  # new conf entry as no match found in existing entries"},{"line_number":183,"context_line":"                secret_stores_repo.create_from(conf_store)"},{"line_number":184,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"9a89bdaa_e06fe9f9","line":181,"updated":"2016-09-12 23:37:31.000000000","message":"This doesn\u0027t remove from sqlalchemy model (and delete the underlying entity) correct?","commit_id":"32025bf80ca0256048063a9157c455c2e53f70cc"},{"author":{"_account_id":1091,"name":"Arun Kant","email":"arukant@cisco.com","username":"arunkant-uws"},"change_message_id":"ae691d164d4c00958f72269722f0dd0e69bda1bb","unresolved":false,"context_lines":[{"line_number":178,"context_line":"                    # persist flag change."},{"line_number":179,"context_line":"                    db_store_match.save()"},{"line_number":180,"context_line":"                # remove matches store from local list after processing"},{"line_number":181,"context_line":"                db_stores.remove(db_store_match)"},{"line_number":182,"context_line":"            else:  # new conf entry as no match found in existing entries"},{"line_number":183,"context_line":"                secret_stores_repo.create_from(conf_store)"},{"line_number":184,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"9a89bdaa_2b850ece","line":181,"in_reply_to":"9a89bdaa_e06fe9f9","updated":"2016-09-13 13:30:33.000000000","message":"Yes..correct. It just removes item from the \u0027db_stores\u0027 list.","commit_id":"32025bf80ca0256048063a9157c455c2e53f70cc"},{"author":{"_account_id":9914,"name":"Ade Lee","email":"alee@redhat.com","username":"alee"},"change_message_id":"a70bedbf1b37457fdf61e39157eb231ab776c3a9","unresolved":false,"context_lines":[{"line_number":189,"context_line":"            if proj_store_repo.get_count_by_secret_store(db_store.id) \u003d\u003d 0:"},{"line_number":190,"context_line":"                secret_stores_repo.delete_entity_by_id(db_store.id, None)"},{"line_number":191,"context_line":"            else:"},{"line_number":192,"context_line":"                raise exception.MultipleStorePluginStillInUse(db_store.name)"},{"line_number":193,"context_line":"    else:  # initial setup case when there is no secret stores data in db"},{"line_number":194,"context_line":"        for conf_store in conf_stores:"},{"line_number":195,"context_line":"            secret_stores_repo.create_from(conf_store)"}],"source_content_type":"text/x-python","patch_set":8,"id":"9a89bdaa_9fcc8636","line":192,"updated":"2016-09-13 16:24:51.000000000","message":"What about secrets?  Should we remove the secret store if there are still secrets that have this secret_store set as their plugin?\n\nHow are we handling active/passive  secret stores?","commit_id":"32025bf80ca0256048063a9157c455c2e53f70cc"},{"author":{"_account_id":9914,"name":"Ade Lee","email":"alee@redhat.com","username":"alee"},"change_message_id":"d987963ac82f3e7523f3bc10c7949f5f6fb85b99","unresolved":false,"context_lines":[{"line_number":189,"context_line":"            if proj_store_repo.get_count_by_secret_store(db_store.id) \u003d\u003d 0:"},{"line_number":190,"context_line":"                secret_stores_repo.delete_entity_by_id(db_store.id, None)"},{"line_number":191,"context_line":"            else:"},{"line_number":192,"context_line":"                raise exception.MultipleStorePluginStillInUse(db_store.name)"},{"line_number":193,"context_line":"    else:  # initial setup case when there is no secret stores data in db"},{"line_number":194,"context_line":"        for conf_store in conf_stores:"},{"line_number":195,"context_line":"            secret_stores_repo.create_from(conf_store)"}],"source_content_type":"text/x-python","patch_set":8,"id":"7a8ec9b2_98d8ed1f","line":192,"in_reply_to":"7a8ec9b2_5eaad51a","updated":"2016-09-13 19:28:11.000000000","message":"I guess we never did implement active/passive secret stores.\n\nThe idea would be as follows.  Lets say I have secret store A which I have been using to store secrets , and now I want to switch to secret store B.  So all new secrets will be stored in B, but I still get to retrieve secrets in A.\n\nNow we can do this with the proposed mechanism.  We would simply set the global default to B.\n\nWhats missing here though is that some project admin could still set their project default to A.  The only way to prevent that currently is to remove the secret store from the config, which will in turn will break access to many secrets/KEKs.\n\nSeems like we need an active/passive field on the secret store.","commit_id":"32025bf80ca0256048063a9157c455c2e53f70cc"},{"author":{"_account_id":1091,"name":"Arun Kant","email":"arukant@cisco.com","username":"arunkant-uws"},"change_message_id":"d0d48488976069e64b3b0e6a5e655d73a724378c","unresolved":false,"context_lines":[{"line_number":189,"context_line":"            if proj_store_repo.get_count_by_secret_store(db_store.id) \u003d\u003d 0:"},{"line_number":190,"context_line":"                secret_stores_repo.delete_entity_by_id(db_store.id, None)"},{"line_number":191,"context_line":"            else:"},{"line_number":192,"context_line":"                raise exception.MultipleStorePluginStillInUse(db_store.name)"},{"line_number":193,"context_line":"    else:  # initial setup case when there is no secret stores data in db"},{"line_number":194,"context_line":"        for conf_store in conf_stores:"},{"line_number":195,"context_line":"            secret_stores_repo.create_from(conf_store)"}],"source_content_type":"text/x-python","patch_set":8,"id":"7a8ec9b2_457759d4","line":192,"in_reply_to":"7a8ec9b2_98d8ed1f","updated":"2016-09-13 20:31:46.000000000","message":"I am not sure what passive behavior means here.\n\nSo once secrets are stored in system, they are stamped with \nplugin names and will work as long as those plugin instances have been created/instantiated. Which means their (plugin) configuration still needs to be specified.\n\nIn above case, if global default is changed for some reason, then it will impact only projects which does not have preferred secret store and only for new secrets. When someone specifies a project preferred secret store, then thinking is that we don\u0027t want to change secret store regardless of what global default is.","commit_id":"32025bf80ca0256048063a9157c455c2e53f70cc"},{"author":{"_account_id":1091,"name":"Arun Kant","email":"arukant@cisco.com","username":"arunkant-uws"},"change_message_id":"8a91eb3b46e130dbe8281285f1b026a2970791d0","unresolved":false,"context_lines":[{"line_number":189,"context_line":"            if proj_store_repo.get_count_by_secret_store(db_store.id) \u003d\u003d 0:"},{"line_number":190,"context_line":"                secret_stores_repo.delete_entity_by_id(db_store.id, None)"},{"line_number":191,"context_line":"            else:"},{"line_number":192,"context_line":"                raise exception.MultipleStorePluginStillInUse(db_store.name)"},{"line_number":193,"context_line":"    else:  # initial setup case when there is no secret stores data in db"},{"line_number":194,"context_line":"        for conf_store in conf_stores:"},{"line_number":195,"context_line":"            secret_stores_repo.create_from(conf_store)"}],"source_content_type":"text/x-python","patch_set":8,"id":"7a8ec9b2_5eaad51a","line":192,"in_reply_to":"9a89bdaa_9fcc8636","updated":"2016-09-13 18:34:18.000000000","message":"There is no change made in existing behavior around this.\n\nSo currently if a deployment has some secrets created with one backend and then next switches to another backend by changing configuration, then existing secrets would not work and possibly existing project kek will be impacted as well as it might be encrypted using old backend.\n\nFor same reason, its recommended in multiple backend docs to use current secret store setting as global default plugin (line 69 in https://review.openstack.org/#/c/341803/13/doc/source/setup/plugin_backends.rst)\n\nExisting deployment should not be removing backend when secrets are already created using that backend regardless of multiple backend is enabled or not.\n\nNot sure about active/ passive plugin meaning. Currently, all plugins used in a system still need to be added in enabled plugins conf and related configuration needs to be provided (to instantiate plugin instances). Same concept applies for multiple backend case.","commit_id":"32025bf80ca0256048063a9157c455c2e53f70cc"},{"author":{"_account_id":9914,"name":"Ade Lee","email":"alee@redhat.com","username":"alee"},"change_message_id":"a70bedbf1b37457fdf61e39157eb231ab776c3a9","unresolved":false,"context_lines":[{"line_number":204,"context_line":"            default_ss \u003d secret_store"},{"line_number":205,"context_line":"            break"},{"line_number":206,"context_line":"    return default_ss"},{"line_number":207,"context_line":""},{"line_number":208,"context_line":""},{"line_number":209,"context_line":"def get_applicable_plugins(manager, project_id, existing_plugin_name):"},{"line_number":210,"context_line":"    \"\"\"Get list of plugins available for use."}],"source_content_type":"text/x-python","patch_set":8,"id":"9a89bdaa_b30a6b77","line":207,"updated":"2016-09-13 16:24:51.000000000","message":"I suppose one could do it this way, but given that the secret stores are stored in the database - and the global_default is a database field - would it not be cleaner to add a db query for global_default\u003dTrue?","commit_id":"32025bf80ca0256048063a9157c455c2e53f70cc"},{"author":{"_account_id":9914,"name":"Ade Lee","email":"alee@redhat.com","username":"alee"},"change_message_id":"2f0c801547e4549ce6ec40cb906d91f911984fd4","unresolved":false,"context_lines":[{"line_number":204,"context_line":"            default_ss \u003d secret_store"},{"line_number":205,"context_line":"            break"},{"line_number":206,"context_line":"    return default_ss"},{"line_number":207,"context_line":""},{"line_number":208,"context_line":""},{"line_number":209,"context_line":"def get_applicable_plugins(manager, project_id, existing_plugin_name):"},{"line_number":210,"context_line":"    \"\"\"Get list of plugins available for use."}],"source_content_type":"text/x-python","patch_set":8,"id":"7a8ec9b2_cd99d521","line":207,"in_reply_to":"7a8ec9b2_81907cee","updated":"2016-09-13 19:15:04.000000000","message":"This is only done at first use really, so its probably not a big deal.  I don\u0027t have a firm preference either way.","commit_id":"32025bf80ca0256048063a9157c455c2e53f70cc"},{"author":{"_account_id":1091,"name":"Arun Kant","email":"arukant@cisco.com","username":"arunkant-uws"},"change_message_id":"8a91eb3b46e130dbe8281285f1b026a2970791d0","unresolved":false,"context_lines":[{"line_number":204,"context_line":"            default_ss \u003d secret_store"},{"line_number":205,"context_line":"            break"},{"line_number":206,"context_line":"    return default_ss"},{"line_number":207,"context_line":""},{"line_number":208,"context_line":""},{"line_number":209,"context_line":"def get_applicable_plugins(manager, project_id, existing_plugin_name):"},{"line_number":210,"context_line":"    \"\"\"Get list of plugins available for use."}],"source_content_type":"text/x-python","patch_set":8,"id":"7a8ec9b2_81907cee","line":207,"in_reply_to":"9a89bdaa_b30a6b77","updated":"2016-09-13 18:34:18.000000000","message":"Yes, it can be done with DB query as well. I think i did not added new query just thinking that there are not many total entries so doing the same in memory should not have any impact whatsoever. \n\nIf there is preference for specific style, I can adjust that. Let me know.","commit_id":"32025bf80ca0256048063a9157c455c2e53f70cc"},{"author":{"_account_id":9914,"name":"Ade Lee","email":"alee@redhat.com","username":"alee"},"change_message_id":"a70bedbf1b37457fdf61e39157eb231ab776c3a9","unresolved":false,"context_lines":[{"line_number":209,"context_line":"def get_applicable_plugins(manager, project_id, existing_plugin_name):"},{"line_number":210,"context_line":"    \"\"\"Get list of plugins available for use."},{"line_number":211,"context_line":""},{"line_number":212,"context_line":"    :param: manager instance of secret store or crypto manager"},{"line_number":213,"context_line":"    :param: project_id project to identify preferred store if set"},{"line_number":214,"context_line":"    :param: existing_plugin_name full plugin name. Used when existing secret"},{"line_number":215,"context_line":"            already has plugin name defined and logic is to use that plugin"}],"source_content_type":"text/x-python","patch_set":8,"id":"9a89bdaa_e9608403","line":212,"updated":"2016-09-13 16:24:51.000000000","message":"I\u0027m not sure I\u0027m a big fan of this function doing double duty to find the appropriate plugin for both secret store and crypto manager.  For one thing, it makes you rely on thing like manager.plugin_lookup_field, which seems hacky.\n\nFor another, it means that you have a return of plugins \u003d [] on line 259 even in the case where the manager is a secret_store plugin.\n\nI think this might be clearer if we had two functions:\n\nget_applicable_secret_store_plugins() and get_applicable_crypto_plugins() with the common code refactored to a helper function.\n\nWhat do others think?","commit_id":"32025bf80ca0256048063a9157c455c2e53f70cc"},{"author":{"_account_id":9914,"name":"Ade Lee","email":"alee@redhat.com","username":"alee"},"change_message_id":"2f0c801547e4549ce6ec40cb906d91f911984fd4","unresolved":false,"context_lines":[{"line_number":209,"context_line":"def get_applicable_plugins(manager, project_id, existing_plugin_name):"},{"line_number":210,"context_line":"    \"\"\"Get list of plugins available for use."},{"line_number":211,"context_line":""},{"line_number":212,"context_line":"    :param: manager instance of secret store or crypto manager"},{"line_number":213,"context_line":"    :param: project_id project to identify preferred store if set"},{"line_number":214,"context_line":"    :param: existing_plugin_name full plugin name. Used when existing secret"},{"line_number":215,"context_line":"            already has plugin name defined and logic is to use that plugin"}],"source_content_type":"text/x-python","patch_set":8,"id":"7a8ec9b2_d21c147a","line":212,"in_reply_to":"7a8ec9b2_27ca5850","updated":"2016-09-13 19:15:04.000000000","message":"Whats different is the return in lines 256-259.\nIn the case of crypto manager, that is a return of []\n and in the case of secret_store_manager, that is likely an exception to be thrown.\n\nI\u0027m imagining something like this ..\n\nget_applicable_foo_plugin:\n    plugin_dict \u003d ....\n\n    if existing_plugin_name:\n         return .. list containing existing plugin\n    if multiple_backends_enabled ... :\n        store_data \u003d self._get_preferred_plugin()\n\n        plugin_name \u003d store_data[FOO_LABEL]\n        .. return logic here.  This will differ slightly ..\n    else:\n       return plugin_dict.values()","commit_id":"32025bf80ca0256048063a9157c455c2e53f70cc"},{"author":{"_account_id":1091,"name":"Arun Kant","email":"arukant@cisco.com","username":"arunkant-uws"},"change_message_id":"d0d48488976069e64b3b0e6a5e655d73a724378c","unresolved":false,"context_lines":[{"line_number":209,"context_line":"def get_applicable_plugins(manager, project_id, existing_plugin_name):"},{"line_number":210,"context_line":"    \"\"\"Get list of plugins available for use."},{"line_number":211,"context_line":""},{"line_number":212,"context_line":"    :param: manager instance of secret store or crypto manager"},{"line_number":213,"context_line":"    :param: project_id project to identify preferred store if set"},{"line_number":214,"context_line":"    :param: existing_plugin_name full plugin name. Used when existing secret"},{"line_number":215,"context_line":"            already has plugin name defined and logic is to use that plugin"}],"source_content_type":"text/x-python","patch_set":8,"id":"7a8ec9b2_053b91ec","line":212,"in_reply_to":"7a8ec9b2_d21c147a","updated":"2016-09-13 20:31:46.000000000","message":"Okay. Let me add 2 separate methods as I don\u0027t have strong preference either way.","commit_id":"32025bf80ca0256048063a9157c455c2e53f70cc"},{"author":{"_account_id":1091,"name":"Arun Kant","email":"arukant@cisco.com","username":"arunkant-uws"},"change_message_id":"8a91eb3b46e130dbe8281285f1b026a2970791d0","unresolved":false,"context_lines":[{"line_number":209,"context_line":"def get_applicable_plugins(manager, project_id, existing_plugin_name):"},{"line_number":210,"context_line":"    \"\"\"Get list of plugins available for use."},{"line_number":211,"context_line":""},{"line_number":212,"context_line":"    :param: manager instance of secret store or crypto manager"},{"line_number":213,"context_line":"    :param: project_id project to identify preferred store if set"},{"line_number":214,"context_line":"    :param: existing_plugin_name full plugin name. Used when existing secret"},{"line_number":215,"context_line":"            already has plugin name defined and logic is to use that plugin"}],"source_content_type":"text/x-python","patch_set":8,"id":"7a8ec9b2_27ca5850","line":212,"in_reply_to":"9a89bdaa_e9608403","updated":"2016-09-13 18:34:18.000000000","message":"It will be essentially a duplicate code as common code does not have clear separation. To have any common code, the logic will have to do if \"crypto specific\", do this else do \"secret manager specific\" kind of logic in common code.\n\nOther than 2 instances mentioned above, there is no other plugin manager specific logic here.\n\nIs that the preference to have separate methods? I will change it accordingly.","commit_id":"32025bf80ca0256048063a9157c455c2e53f70cc"},{"author":{"_account_id":9914,"name":"Ade Lee","email":"alee@redhat.com","username":"alee"},"change_message_id":"a70bedbf1b37457fdf61e39157eb231ab776c3a9","unresolved":false,"context_lines":[{"line_number":215,"context_line":"            already has plugin name defined and logic is to use that plugin"},{"line_number":216,"context_line":"            name regardless of there is preferred plugin defined for that"},{"line_number":217,"context_line":"            project or global default value."},{"line_number":218,"context_line":""},{"line_number":219,"context_line":"    When multiple backends support is enabled:"},{"line_number":220,"context_line":"    It return project preferred plugin as list when it is setup earlier."},{"line_number":221,"context_line":"    If project preferred plugin is not set, then it uses plugin from default"}],"source_content_type":"text/x-python","patch_set":8,"id":"9a89bdaa_e6cc336c","line":218,"updated":"2016-09-13 16:24:51.000000000","message":"I\u0027m a little confused.  The function below appears to be returning a list of active plugins when existing_plugin_name is not defined, rather than the existing_plugin_name.\n\nThe fact that this still works though makes me wonder if/when this additional parameter is needed.","commit_id":"32025bf80ca0256048063a9157c455c2e53f70cc"},{"author":{"_account_id":9914,"name":"Ade Lee","email":"alee@redhat.com","username":"alee"},"change_message_id":"2f0c801547e4549ce6ec40cb906d91f911984fd4","unresolved":false,"context_lines":[{"line_number":215,"context_line":"            already has plugin name defined and logic is to use that plugin"},{"line_number":216,"context_line":"            name regardless of there is preferred plugin defined for that"},{"line_number":217,"context_line":"            project or global default value."},{"line_number":218,"context_line":""},{"line_number":219,"context_line":"    When multiple backends support is enabled:"},{"line_number":220,"context_line":"    It return project preferred plugin as list when it is setup earlier."},{"line_number":221,"context_line":"    If project preferred plugin is not set, then it uses plugin from default"}],"source_content_type":"text/x-python","patch_set":8,"id":"7a8ec9b2_f234b04b","line":218,"in_reply_to":"7a8ec9b2_e4f22e06","updated":"2016-09-13 19:15:04.000000000","message":"Ok - what you have written in the comment does not match what you have indicated here.  The comment should say something like ..\n\nIf a secret has an existing plugin defined, then we do not care if any preferred plugins have been defined.  We will return all configured plugins as if multiple plugin support was not enabled.  Subsequent code in the caller will select the plugin by name.\n\n****\nThis seems to me to be a little clunky.  I think a more intuitive approach would be to return a list containing only the selected plugin.","commit_id":"32025bf80ca0256048063a9157c455c2e53f70cc"},{"author":{"_account_id":1091,"name":"Arun Kant","email":"arukant@cisco.com","username":"arunkant-uws"},"change_message_id":"d0d48488976069e64b3b0e6a5e655d73a724378c","unresolved":false,"context_lines":[{"line_number":215,"context_line":"            already has plugin name defined and logic is to use that plugin"},{"line_number":216,"context_line":"            name regardless of there is preferred plugin defined for that"},{"line_number":217,"context_line":"            project or global default value."},{"line_number":218,"context_line":""},{"line_number":219,"context_line":"    When multiple backends support is enabled:"},{"line_number":220,"context_line":"    It return project preferred plugin as list when it is setup earlier."},{"line_number":221,"context_line":"    If project preferred plugin is not set, then it uses plugin from default"}],"source_content_type":"text/x-python","patch_set":8,"id":"7a8ec9b2_68ac2cee","line":218,"in_reply_to":"7a8ec9b2_f234b04b","updated":"2016-09-13 20:31:46.000000000","message":"I tried to convey similar thing but its not worded clearly (explaining final behavior, not method behavior). I will update with suggestion.","commit_id":"32025bf80ca0256048063a9157c455c2e53f70cc"},{"author":{"_account_id":1091,"name":"Arun Kant","email":"arukant@cisco.com","username":"arunkant-uws"},"change_message_id":"8a91eb3b46e130dbe8281285f1b026a2970791d0","unresolved":false,"context_lines":[{"line_number":215,"context_line":"            already has plugin name defined and logic is to use that plugin"},{"line_number":216,"context_line":"            name regardless of there is preferred plugin defined for that"},{"line_number":217,"context_line":"            project or global default value."},{"line_number":218,"context_line":""},{"line_number":219,"context_line":"    When multiple backends support is enabled:"},{"line_number":220,"context_line":"    It return project preferred plugin as list when it is setup earlier."},{"line_number":221,"context_line":"    If project preferred plugin is not set, then it uses plugin from default"}],"source_content_type":"text/x-python","patch_set":8,"id":"7a8ec9b2_e4f22e06","line":218,"in_reply_to":"9a89bdaa_e6cc336c","updated":"2016-09-13 18:34:18.000000000","message":"In case of existing plugin name, all of configured plugin instances are returned and then logic is there to find matching plugin based on name. So same logic still applies in multiple backend case.\n\nhttps://github.com/openstack/barbican/blob/master/barbican/plugin/interface/secret_store.py#L523","commit_id":"32025bf80ca0256048063a9157c455c2e53f70cc"},{"author":{"_account_id":9914,"name":"Ade Lee","email":"alee@redhat.com","username":"alee"},"change_message_id":"a70bedbf1b37457fdf61e39157eb231ab776c3a9","unresolved":false,"context_lines":[{"line_number":259,"context_line":"            plugins \u003d []"},{"line_number":260,"context_line":"    else:"},{"line_number":261,"context_line":"        plugins \u003d plugin_dict.values()"},{"line_number":262,"context_line":""},{"line_number":263,"context_line":"    return plugins"}],"source_content_type":"text/x-python","patch_set":8,"id":"9a89bdaa_c4c807ab","line":262,"updated":"2016-09-13 16:24:51.000000000","message":"I don\u0027t have the code handy - but just to confirm -- this is the same effect as  plugin_utils.get_active_plugins() ?","commit_id":"32025bf80ca0256048063a9157c455c2e53f70cc"},{"author":{"_account_id":9914,"name":"Ade Lee","email":"alee@redhat.com","username":"alee"},"change_message_id":"2f0c801547e4549ce6ec40cb906d91f911984fd4","unresolved":false,"context_lines":[{"line_number":259,"context_line":"            plugins \u003d []"},{"line_number":260,"context_line":"    else:"},{"line_number":261,"context_line":"        plugins \u003d plugin_dict.values()"},{"line_number":262,"context_line":""},{"line_number":263,"context_line":"    return plugins"}],"source_content_type":"text/x-python","patch_set":8,"id":"7a8ec9b2_d2789492","line":262,"in_reply_to":"9a89bdaa_95046715","updated":"2016-09-13 19:15:04.000000000","message":"ok great.","commit_id":"32025bf80ca0256048063a9157c455c2e53f70cc"},{"author":{"_account_id":1091,"name":"Arun Kant","email":"arukant@cisco.com","username":"arunkant-uws"},"change_message_id":"8a91eb3b46e130dbe8281285f1b026a2970791d0","unresolved":false,"context_lines":[{"line_number":259,"context_line":"            plugins \u003d []"},{"line_number":260,"context_line":"    else:"},{"line_number":261,"context_line":"        plugins \u003d plugin_dict.values()"},{"line_number":262,"context_line":""},{"line_number":263,"context_line":"    return plugins"}],"source_content_type":"text/x-python","patch_set":8,"id":"9a89bdaa_95046715","line":262,"in_reply_to":"9a89bdaa_c4c807ab","updated":"2016-09-13 18:34:18.000000000","message":"Yes. If multiple backends is disabled, then logic comes directly to line #261 which is list of extension objects (i.e. actual plugin instances) \n\nMaster branch code: https://github.com/openstack/barbican/blob/master/barbican/plugin/util/utils.py#L54","commit_id":"32025bf80ca0256048063a9157c455c2e53f70cc"}]}
