)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"c547e16c2ff3e076bff91bb46895396fc17e294b","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Transition to \u0027keymaster\u0027"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Transitioned from \u0027trivial_keymaster\u0027 with constant root key to"},{"line_number":10,"context_line":"\u0027keymaster\u0027 with root key set in proxy-server.conf."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Change-Id: Ib5051bc402d5758f149c6afbaee7ccf06c44bbca"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"ba8a016a_e921c8b5","line":10,"updated":"2015-11-20 17:38:27.000000000","message":"nit s/root key/root secret/","commit_id":"8cb5505bf174c45cb72be65adc4217242fb247b5"}],"etc/proxy-server.conf-sample":[{"author":{"_account_id":18820,"name":"Peter Chng","email":"pchng@ca.ibm.com","username":"pchng"},"change_message_id":"6b292bf7c74f55ab8005191e6d49aeaf7731145a","unresolved":false,"context_lines":[{"line_number":726,"context_line":"use \u003d egg:swift#keymaster"},{"line_number":727,"context_line":"# Sets the root key from which encryption keys are derived. Change before"},{"line_number":728,"context_line":"# first use. After that, changing the key will result in data loss."},{"line_number":729,"context_line":"# encryption_root_key \u003d default_key"},{"line_number":730,"context_line":""},{"line_number":731,"context_line":"[filter:encrypter]"},{"line_number":732,"context_line":"use \u003d egg:swift#encrypter"}],"source_content_type":"application/octet-stream","patch_set":1,"id":"ba8a016a_1887b010","line":729,"updated":"2015-11-16 18:00:16.000000000","message":"Does this configuration parameter need to be added to any documentation, i.e. *.rst files or whatnot?","commit_id":"46ddb37447f4867bb49290ef0366e195ec85e579"},{"author":{"_account_id":16964,"name":"Jonathan Hinson","email":"jlhinson@us.ibm.com","username":"jlhinson"},"change_message_id":"765cb5cd3afaba2d6b942d0b3466fd0aa2d71ec1","unresolved":false,"context_lines":[{"line_number":726,"context_line":"use \u003d egg:swift#keymaster"},{"line_number":727,"context_line":"# Sets the root key from which encryption keys are derived. Change before"},{"line_number":728,"context_line":"# first use. After that, changing the key will result in data loss."},{"line_number":729,"context_line":"# encryption_root_key \u003d default_key"},{"line_number":730,"context_line":""},{"line_number":731,"context_line":"[filter:encrypter]"},{"line_number":732,"context_line":"use \u003d egg:swift#encrypter"}],"source_content_type":"application/octet-stream","patch_set":1,"id":"ba8a016a_3b6dc704","line":729,"in_reply_to":"ba8a016a_1887b010","updated":"2015-11-16 21:12:24.000000000","message":"I think this is enough, but I\u0027m not sure. I was using \u0027allow_versioned_writes\u0027 from versioned_writes.py as a reference. I couldn\u0027t find it mentioned in any *.rst file","commit_id":"46ddb37447f4867bb49290ef0366e195ec85e579"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"5244ac8d977b85f32243e0c17834548862d79f41","unresolved":false,"context_lines":[{"line_number":726,"context_line":"use \u003d egg:swift#keymaster"},{"line_number":727,"context_line":"# Sets the root key from which encryption keys are derived. Change before"},{"line_number":728,"context_line":"# first use. After that, changing the key will result in data loss."},{"line_number":729,"context_line":"# encryption_root_key \u003d default_key"},{"line_number":730,"context_line":""},{"line_number":731,"context_line":"[filter:encrypter]"},{"line_number":732,"context_line":"use \u003d egg:swift#encrypter"}],"source_content_type":"application/octet-stream","patch_set":1,"id":"ba8a016a_7317f3a3","line":729,"in_reply_to":"ba8a016a_3b6dc704","updated":"2015-11-16 22:15:15.000000000","message":"Peter - yes,  we will need to document this value.  BUT, we haven\u0027t added any crypto docs, so it would be best if we leave that work to be done in one review patch (apart from this).\n\nAs for the value - I am wondering if this is really a key, or a \u0027salt\u0027 or something else.  If its an actual \u0027key\u0027, then i think it has to be 32-bits.  Otherwise, its probably fine.\n\nAs for the fact that it is commented out by default: \n1) what\u0027s the behavior if its not found?  let\u0027s make it good and make sure we all agree, cause it will happen a lot.\n2) we could have the default set, but then that could be bad if somebody sets up a cluster and wants to the change the value later when they realize its the same as every other swift cluster out of the box.\n\nI wonder if we could have some sort of \"cluster init\" file or something that only gets read when the cluster is created - rather than a config that would break things if it changes.  having in config usually implies it can change.  but this really ... can\u0027t.","commit_id":"46ddb37447f4867bb49290ef0366e195ec85e579"},{"author":{"_account_id":18820,"name":"Peter Chng","email":"pchng@ca.ibm.com","username":"pchng"},"change_message_id":"63d606675e439ccd1603a84c3a4d42d8c020a008","unresolved":false,"context_lines":[{"line_number":726,"context_line":"use \u003d egg:swift#keymaster"},{"line_number":727,"context_line":"# Sets the root key from which encryption keys are derived. Change before"},{"line_number":728,"context_line":"# first use. After that, changing the key will result in data loss."},{"line_number":729,"context_line":"# encryption_root_key \u003d default_key"},{"line_number":730,"context_line":""},{"line_number":731,"context_line":"[filter:encrypter]"},{"line_number":732,"context_line":"use \u003d egg:swift#encrypter"}],"source_content_type":"application/octet-stream","patch_set":1,"id":"ba8a016a_3f45656f","line":729,"in_reply_to":"ba8a016a_7317f3a3","updated":"2015-11-18 16:25:12.000000000","message":"I think the behaviour if it\u0027s not found, i.e. left commented out is that the keymaster will throw a ValueError indicating this and the proxy server won\u0027t start. Likely that should be enough to make an admin go back and change the configuration.\n\nAs for the length of the key value, it\u0027s used in in hmac.new(), which doesn\u0027t seem to impose any restrictions on the key length[2][3]. However, according to RFC 2104, which HMAC is based upon[1], the minimal key length is recommended to be L bytes, where L is the byte-length of the hash output. Since keymaster is currently using SHA-256, this would imply a minimum key length of 32 bytes. (There is no maximum key length, but going larger than this doesn\u0027t make it any more \"secure\")\n\nWe should probably document this recommendation.\n\n1. http://tools.ietf.org/html/rfc2104.html#section-3\n2. https://docs.python.org/2/library/hmac.html\n3. https://hg.python.org/cpython/file/2.7/Lib/hmac.py","commit_id":"46ddb37447f4867bb49290ef0366e195ec85e579"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"fda397cd71215b69d1eba1aa05ec722edbf36f6b","unresolved":false,"context_lines":[{"line_number":726,"context_line":"use \u003d egg:swift#keymaster"},{"line_number":727,"context_line":"# Sets the root key from which encryption keys are derived. Change before"},{"line_number":728,"context_line":"# first use. After that, changing the key will result in data loss."},{"line_number":729,"context_line":"# encryption_root_key \u003d default_key"},{"line_number":730,"context_line":""},{"line_number":731,"context_line":"[filter:encrypter]"},{"line_number":732,"context_line":"use \u003d egg:swift#encrypter"}],"source_content_type":"application/octet-stream","patch_set":2,"id":"ba8a016a_a3561428","line":729,"updated":"2015-11-18 10:38:46.000000000","message":"2 things:\n\n- since the option is inside the \u0027keymaster\u0027 section and its name is therefore qualified by the section name, it seems unnecessary to include \u0027encryption_\u0027 in its name i.e. \u0027root_key\u0027 would suffice (modulo comment i left elsewhere about whether \u0027key\u0027 is appropriate name).\n\n- the convention in the sample conf files is (mostly) that the value shown for an option is the default, ie is the value used if none is actually specified, and the value show here (default_key) suggests that is the case, whereas we raise an Error is no option is explicitly specified.\n\nUnfortunately I\u0027m not aware of any convention for options that must be set and have no default value, but my suggestion in this case would be:\n\n  # Sets the root key from which encryption keys are derived. This option\n  # has no default value and must be set to a string value. Changing the\n  # value may result in data loss.\n  # root_key \u003d\n\nI\u0027m suggesting putting no example value, as that invites users to use the sample value :/ Also I soften \u0027will result in data loss\u0027 to \u0027may result in data loss\u0027 because changing and then changing back to original value will not result in data loss.","commit_id":"438740b62acc7a1e7f33aa3d637edb7b044478c0"},{"author":{"_account_id":18820,"name":"Peter Chng","email":"pchng@ca.ibm.com","username":"pchng"},"change_message_id":"649eb318679b26819f1d0aabffd401f3476d8d7a","unresolved":false,"context_lines":[{"line_number":726,"context_line":"use \u003d egg:swift#keymaster"},{"line_number":727,"context_line":"# Sets the root key from which encryption keys are derived. Change before"},{"line_number":728,"context_line":"# first use. After that, changing the key will result in data loss."},{"line_number":729,"context_line":"# encryption_root_key \u003d default_key"},{"line_number":730,"context_line":""},{"line_number":731,"context_line":"[filter:encrypter]"},{"line_number":732,"context_line":"use \u003d egg:swift#encrypter"}],"source_content_type":"application/octet-stream","patch_set":2,"id":"ba8a016a_8fc8bca9","line":729,"in_reply_to":"ba8a016a_19f09ac8","updated":"2015-11-18 17:21:31.000000000","message":"Okay, so I\u0027m in agreement with Janie that this should be called a \"secret\" or a passphrase since it\u0027s used to derive the actual key being used in create_key() in keymaster.py. (Sort of like your WiFi passphrase)\n\nYou can ignore my previous comments about the length - it should not matter since the value is not being used in an actual HMAC value, instead the HMAC is being used as a key derivation function effectively. (Sorry, I completely missed this before)","commit_id":"438740b62acc7a1e7f33aa3d637edb7b044478c0"},{"author":{"_account_id":16964,"name":"Jonathan Hinson","email":"jlhinson@us.ibm.com","username":"jlhinson"},"change_message_id":"76d47f43f1436ec7d67956adec8038736901fc59","unresolved":false,"context_lines":[{"line_number":726,"context_line":"use \u003d egg:swift#keymaster"},{"line_number":727,"context_line":"# Sets the root key from which encryption keys are derived. Change before"},{"line_number":728,"context_line":"# first use. After that, changing the key will result in data loss."},{"line_number":729,"context_line":"# encryption_root_key \u003d default_key"},{"line_number":730,"context_line":""},{"line_number":731,"context_line":"[filter:encrypter]"},{"line_number":732,"context_line":"use \u003d egg:swift#encrypter"}],"source_content_type":"application/octet-stream","patch_set":2,"id":"ba8a016a_71ff00ab","line":729,"in_reply_to":"ba8a016a_6697c83a","updated":"2015-11-20 16:54:20.000000000","message":"Done","commit_id":"438740b62acc7a1e7f33aa3d637edb7b044478c0"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"a383003194d9fed2543c388559b1c6d6761a58fa","unresolved":false,"context_lines":[{"line_number":726,"context_line":"use \u003d egg:swift#keymaster"},{"line_number":727,"context_line":"# Sets the root key from which encryption keys are derived. Change before"},{"line_number":728,"context_line":"# first use. After that, changing the key will result in data loss."},{"line_number":729,"context_line":"# encryption_root_key \u003d default_key"},{"line_number":730,"context_line":""},{"line_number":731,"context_line":"[filter:encrypter]"},{"line_number":732,"context_line":"use \u003d egg:swift#encrypter"}],"source_content_type":"application/octet-stream","patch_set":2,"id":"ba8a016a_9a2e718a","line":729,"in_reply_to":"ba8a016a_6697c83a","updated":"2015-11-20 17:29:34.000000000","message":"I am also thinking that we should have a default for now, since I don\u0027t know how the gate would handle the insertion of a value into the config.  If somebody knows a good way to do that, then i am open to ideas.\n\nAnyway, I think for now, let\u0027s have a default in config so that hand modifications are not required to run.  We will re-examine that decision later.","commit_id":"438740b62acc7a1e7f33aa3d637edb7b044478c0"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"a383003194d9fed2543c388559b1c6d6761a58fa","unresolved":false,"context_lines":[{"line_number":726,"context_line":"use \u003d egg:swift#keymaster"},{"line_number":727,"context_line":"# Sets the root key from which encryption keys are derived. Change before"},{"line_number":728,"context_line":"# first use. After that, changing the key will result in data loss."},{"line_number":729,"context_line":"# encryption_root_key \u003d default_key"},{"line_number":730,"context_line":""},{"line_number":731,"context_line":"[filter:encrypter]"},{"line_number":732,"context_line":"use \u003d egg:swift#encrypter"}],"source_content_type":"application/octet-stream","patch_set":2,"id":"ba8a016a_faa3fdfd","line":729,"in_reply_to":"ba8a016a_8fc8bca9","updated":"2015-11-20 17:29:34.000000000","message":"yes, I think that in this case where the only result for us is a key of the correct length, and its different, that is all that matters.  There is reallly  no way to be a \"better\" key, per se.","commit_id":"438740b62acc7a1e7f33aa3d637edb7b044478c0"},{"author":{"_account_id":18820,"name":"Peter Chng","email":"pchng@ca.ibm.com","username":"pchng"},"change_message_id":"4880821fea9951f1feef1f3bc8c1eab2afcf16ab","unresolved":false,"context_lines":[{"line_number":726,"context_line":"use \u003d egg:swift#keymaster"},{"line_number":727,"context_line":"# Sets the root key from which encryption keys are derived. Change before"},{"line_number":728,"context_line":"# first use. After that, changing the key will result in data loss."},{"line_number":729,"context_line":"# encryption_root_key \u003d default_key"},{"line_number":730,"context_line":""},{"line_number":731,"context_line":"[filter:encrypter]"},{"line_number":732,"context_line":"use \u003d egg:swift#encrypter"}],"source_content_type":"application/octet-stream","patch_set":2,"id":"ba8a016a_19f09ac8","line":729,"in_reply_to":"ba8a016a_a3561428","updated":"2015-11-18 16:51:28.000000000","message":"I agree with not setting/providing an example value.\n\nAs for the length of the key value, it\u0027s used in in hmac.new(), which doesn\u0027t seem to impose any restrictions on the key length[2][3]. However, according to RFC 2104, which HMAC is based upon[1], the minimal key length is recommended to be L bytes, where L is the byte-length of the hash output. Since keymaster is currently using SHA-256, this would imply a minimum key length of 32 bytes. (There is no maximum key length, but going larger than this doesn\u0027t make it any more \"secure\")\n\nWe should probably document this recommendation, OR use some key-derivation function that takes the value of root_key and outputs a 32-byte/256-bit value that\u0027s of optimal length to use in HMAC-SHA256 as a key.\n\n1. http://tools.ietf.org/html/rfc2104.html#section-3\n2. https://docs.python.org/2/library/hmac.html\n3. https://hg.python.org/cpython/file/2.7/Lib/hmac.py","commit_id":"438740b62acc7a1e7f33aa3d637edb7b044478c0"},{"author":{"_account_id":330,"name":"John Dickinson","email":"me@not.mn","username":"notmyname"},"change_message_id":"6c69f435bd5f92671c3667eb0d7833f1a2add694","unresolved":false,"context_lines":[{"line_number":726,"context_line":"use \u003d egg:swift#keymaster"},{"line_number":727,"context_line":"# Sets the root key from which encryption keys are derived. Change before"},{"line_number":728,"context_line":"# first use. After that, changing the key will result in data loss."},{"line_number":729,"context_line":"# encryption_root_key \u003d default_key"},{"line_number":730,"context_line":""},{"line_number":731,"context_line":"[filter:encrypter]"},{"line_number":732,"context_line":"use \u003d egg:swift#encrypter"}],"source_content_type":"application/octet-stream","patch_set":2,"id":"ba8a016a_6697c83a","line":729,"in_reply_to":"ba8a016a_a3561428","updated":"2015-11-18 15:54:44.000000000","message":"The advantage of the \"encryption_\" prefix is that it protects against other future uses of \"root_key\" that might one day show up in a DEFAULT section.\n\nIf there is no default for a config option (ie something that the operator is required to set), our convention has been to leave it uncommented and with an \"obvious\" value. see bind_port and swift_hash_path_suffix.","commit_id":"438740b62acc7a1e7f33aa3d637edb7b044478c0"}],"swift/common/middleware/keymaster.py":[{"author":{"_account_id":18820,"name":"Peter Chng","email":"pchng@ca.ibm.com","username":"pchng"},"change_message_id":"6b292bf7c74f55ab8005191e6d49aeaf7731145a","unresolved":false,"context_lines":[{"line_number":174,"context_line":"    def __init__(self, app, conf):"},{"line_number":175,"context_line":"        self.app \u003d app"},{"line_number":176,"context_line":"        self.logger \u003d get_logger(conf, log_route\u003d\"keymaster\")"},{"line_number":177,"context_line":"        # TODO: consider optionally loading root key from conf"},{"line_number":178,"context_line":"        self.root_key \u003d conf.get(\u0027encryption_root_key\u0027, None)"},{"line_number":179,"context_line":"        if not self.root_key:"},{"line_number":180,"context_line":"            raise ValueError(\u0027Encryption key not set in proxy-server.conf\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba8a016a_98c5e05c","line":177,"updated":"2015-11-16 18:00:16.000000000","message":"Probably don\u0027t need this TODO anymore. (Since it\u0027s now a DONE)","commit_id":"46ddb37447f4867bb49290ef0366e195ec85e579"},{"author":{"_account_id":16964,"name":"Jonathan Hinson","email":"jlhinson@us.ibm.com","username":"jlhinson"},"change_message_id":"765cb5cd3afaba2d6b942d0b3466fd0aa2d71ec1","unresolved":false,"context_lines":[{"line_number":174,"context_line":"    def __init__(self, app, conf):"},{"line_number":175,"context_line":"        self.app \u003d app"},{"line_number":176,"context_line":"        self.logger \u003d get_logger(conf, log_route\u003d\"keymaster\")"},{"line_number":177,"context_line":"        # TODO: consider optionally loading root key from conf"},{"line_number":178,"context_line":"        self.root_key \u003d conf.get(\u0027encryption_root_key\u0027, None)"},{"line_number":179,"context_line":"        if not self.root_key:"},{"line_number":180,"context_line":"            raise ValueError(\u0027Encryption key not set in proxy-server.conf\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba8a016a_6f887123","line":177,"in_reply_to":"ba8a016a_98c5e05c","updated":"2015-11-16 21:12:24.000000000","message":"Heh, yeah. I\u0027m not sure how that slipped past me. I\u0027ll fix that once I get more feedback.","commit_id":"46ddb37447f4867bb49290ef0366e195ec85e579"},{"author":{"_account_id":18820,"name":"Peter Chng","email":"pchng@ca.ibm.com","username":"pchng"},"change_message_id":"6b292bf7c74f55ab8005191e6d49aeaf7731145a","unresolved":false,"context_lines":[{"line_number":177,"context_line":"        # TODO: consider optionally loading root key from conf"},{"line_number":178,"context_line":"        self.root_key \u003d conf.get(\u0027encryption_root_key\u0027, None)"},{"line_number":179,"context_line":"        if not self.root_key:"},{"line_number":180,"context_line":"            raise ValueError(\u0027Encryption key not set in proxy-server.conf\u0027)"},{"line_number":181,"context_line":""},{"line_number":182,"context_line":"    def __call__(self, env, start_response):"},{"line_number":183,"context_line":"        req \u003d Request(env)"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba8a016a_78491cd0","line":180,"updated":"2015-11-16 18:00:16.000000000","message":"Opinion: Maybe say \u0027encryption_root_key not set in proxy-server.conf\u0027 if this is going to be read by a user/administrator.","commit_id":"46ddb37447f4867bb49290ef0366e195ec85e579"},{"author":{"_account_id":16964,"name":"Jonathan Hinson","email":"jlhinson@us.ibm.com","username":"jlhinson"},"change_message_id":"765cb5cd3afaba2d6b942d0b3466fd0aa2d71ec1","unresolved":false,"context_lines":[{"line_number":177,"context_line":"        # TODO: consider optionally loading root key from conf"},{"line_number":178,"context_line":"        self.root_key \u003d conf.get(\u0027encryption_root_key\u0027, None)"},{"line_number":179,"context_line":"        if not self.root_key:"},{"line_number":180,"context_line":"            raise ValueError(\u0027Encryption key not set in proxy-server.conf\u0027)"},{"line_number":181,"context_line":""},{"line_number":182,"context_line":"    def __call__(self, env, start_response):"},{"line_number":183,"context_line":"        req \u003d Request(env)"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba8a016a_2f99096f","line":180,"in_reply_to":"ba8a016a_78491cd0","updated":"2015-11-16 21:12:24.000000000","message":"I agree. I\u0027ll change that.","commit_id":"46ddb37447f4867bb49290ef0366e195ec85e579"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"fda397cd71215b69d1eba1aa05ec722edbf36f6b","unresolved":false,"context_lines":[{"line_number":174,"context_line":"    def __init__(self, app, conf):"},{"line_number":175,"context_line":"        self.app \u003d app"},{"line_number":176,"context_line":"        self.logger \u003d get_logger(conf, log_route\u003d\"keymaster\")"},{"line_number":177,"context_line":"        self.root_key \u003d conf.get(\u0027encryption_root_key\u0027, None)"},{"line_number":178,"context_line":"        if not self.root_key:"},{"line_number":179,"context_line":"            raise ValueError(\u0027encryption_root_key not set in \u0027"},{"line_number":180,"context_line":"                             \u0027proxy-server.conf\u0027)"}],"source_content_type":"text/x-python","patch_set":2,"id":"ba8a016a_5175b595","line":177,"updated":"2015-11-18 10:38:46.000000000","message":"nit: is it strictly accurate to call this a \"key\" - real keys must be a certain fixed length, this is arbitrary length and never passed to the crypto engine as a key. That said I don\u0027t have a better suggestion right now! \u0027root_secret\u0027 perhaps?","commit_id":"438740b62acc7a1e7f33aa3d637edb7b044478c0"},{"author":{"_account_id":16964,"name":"Jonathan Hinson","email":"jlhinson@us.ibm.com","username":"jlhinson"},"change_message_id":"76d47f43f1436ec7d67956adec8038736901fc59","unresolved":false,"context_lines":[{"line_number":174,"context_line":"    def __init__(self, app, conf):"},{"line_number":175,"context_line":"        self.app \u003d app"},{"line_number":176,"context_line":"        self.logger \u003d get_logger(conf, log_route\u003d\"keymaster\")"},{"line_number":177,"context_line":"        self.root_key \u003d conf.get(\u0027encryption_root_key\u0027, None)"},{"line_number":178,"context_line":"        if not self.root_key:"},{"line_number":179,"context_line":"            raise ValueError(\u0027encryption_root_key not set in \u0027"},{"line_number":180,"context_line":"                             \u0027proxy-server.conf\u0027)"}],"source_content_type":"text/x-python","patch_set":2,"id":"ba8a016a_76e1369a","line":177,"in_reply_to":"ba8a016a_5175b595","updated":"2015-11-20 16:54:20.000000000","message":"Done","commit_id":"438740b62acc7a1e7f33aa3d637edb7b044478c0"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"a383003194d9fed2543c388559b1c6d6761a58fa","unresolved":false,"context_lines":[{"line_number":174,"context_line":"    def __init__(self, app, conf):"},{"line_number":175,"context_line":"        self.app \u003d app"},{"line_number":176,"context_line":"        self.logger \u003d get_logger(conf, log_route\u003d\"keymaster\")"},{"line_number":177,"context_line":"        self.root_key \u003d conf.get(\u0027encryption_root_key\u0027, None)"},{"line_number":178,"context_line":"        if not self.root_key:"},{"line_number":179,"context_line":"            raise ValueError(\u0027encryption_root_key not set in \u0027"},{"line_number":180,"context_line":"                             \u0027proxy-server.conf\u0027)"}],"source_content_type":"text/x-python","patch_set":2,"id":"ba8a016a_ba99f5c5","line":177,"in_reply_to":"ba8a016a_5175b595","updated":"2015-11-20 17:29:34.000000000","message":"i\u0027m good with \u0027root_secret\u0027","commit_id":"438740b62acc7a1e7f33aa3d637edb7b044478c0"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"fda397cd71215b69d1eba1aa05ec722edbf36f6b","unresolved":false,"context_lines":[{"line_number":175,"context_line":"        self.app \u003d app"},{"line_number":176,"context_line":"        self.logger \u003d get_logger(conf, log_route\u003d\"keymaster\")"},{"line_number":177,"context_line":"        self.root_key \u003d conf.get(\u0027encryption_root_key\u0027, None)"},{"line_number":178,"context_line":"        if not self.root_key:"},{"line_number":179,"context_line":"            raise ValueError(\u0027encryption_root_key not set in \u0027"},{"line_number":180,"context_line":"                             \u0027proxy-server.conf\u0027)"},{"line_number":181,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"ba8a016a_51005501","line":178,"updated":"2015-11-18 10:38:46.000000000","message":"do we have any restrictions on the length of the root key? I don\u0027t think so but just asking to be sure.","commit_id":"438740b62acc7a1e7f33aa3d637edb7b044478c0"},{"author":{"_account_id":18820,"name":"Peter Chng","email":"pchng@ca.ibm.com","username":"pchng"},"change_message_id":"5803ac42cdab4e59d3a4b9d1771e88aa2d1b146d","unresolved":false,"context_lines":[{"line_number":175,"context_line":"        self.app \u003d app"},{"line_number":176,"context_line":"        self.logger \u003d get_logger(conf, log_route\u003d\"keymaster\")"},{"line_number":177,"context_line":"        self.root_key \u003d conf.get(\u0027encryption_root_key\u0027, None)"},{"line_number":178,"context_line":"        if not self.root_key:"},{"line_number":179,"context_line":"            raise ValueError(\u0027encryption_root_key not set in \u0027"},{"line_number":180,"context_line":"                             \u0027proxy-server.conf\u0027)"},{"line_number":181,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"ba8a016a_7cb2ed95","line":178,"in_reply_to":"ba8a016a_51005501","updated":"2015-11-18 19:12:09.000000000","message":"I don\u0027t think there\u0027s any length restrictions since effectively, the \"key\" is fed into an HMAC which is used as a key derivation function.\n\nI agree that it shouldn\u0027t be named a key, more of a \"secret\" since it\u0027s just used to derive the actual key.","commit_id":"438740b62acc7a1e7f33aa3d637edb7b044478c0"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"fda397cd71215b69d1eba1aa05ec722edbf36f6b","unresolved":false,"context_lines":[{"line_number":199,"context_line":"        return self.app(env, start_response)"},{"line_number":200,"context_line":""},{"line_number":201,"context_line":"    def create_key(self, key_id):"},{"line_number":202,"context_line":"        key_id \u003d \u0027fixed\u0027  # temporary workaround"},{"line_number":203,"context_line":"        return hmac.new(self.root_key, key_id,"},{"line_number":204,"context_line":"                        digestmod\u003dhashlib.sha256).digest()"},{"line_number":205,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"ba8a016a_f65a9f4f","line":202,"updated":"2015-11-18 10:38:46.000000000","message":"could you make this a #TODO: style comment so that later when we search for TODO\u0027s we\u0027ll be sure to find this, since it really is temporary\n\nthanks","commit_id":"438740b62acc7a1e7f33aa3d637edb7b044478c0"},{"author":{"_account_id":16964,"name":"Jonathan Hinson","email":"jlhinson@us.ibm.com","username":"jlhinson"},"change_message_id":"76d47f43f1436ec7d67956adec8038736901fc59","unresolved":false,"context_lines":[{"line_number":199,"context_line":"        return self.app(env, start_response)"},{"line_number":200,"context_line":""},{"line_number":201,"context_line":"    def create_key(self, key_id):"},{"line_number":202,"context_line":"        key_id \u003d \u0027fixed\u0027  # temporary workaround"},{"line_number":203,"context_line":"        return hmac.new(self.root_key, key_id,"},{"line_number":204,"context_line":"                        digestmod\u003dhashlib.sha256).digest()"},{"line_number":205,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"ba8a016a_6546d050","line":202,"in_reply_to":"ba8a016a_f65a9f4f","updated":"2015-11-20 16:54:20.000000000","message":"Done","commit_id":"438740b62acc7a1e7f33aa3d637edb7b044478c0"},{"author":{"_account_id":18820,"name":"Peter Chng","email":"pchng@ca.ibm.com","username":"pchng"},"change_message_id":"5803ac42cdab4e59d3a4b9d1771e88aa2d1b146d","unresolved":false,"context_lines":[{"line_number":200,"context_line":""},{"line_number":201,"context_line":"    def create_key(self, key_id):"},{"line_number":202,"context_line":"        key_id \u003d \u0027fixed\u0027  # temporary workaround"},{"line_number":203,"context_line":"        return hmac.new(self.root_key, key_id,"},{"line_number":204,"context_line":"                        digestmod\u003dhashlib.sha256).digest()"},{"line_number":205,"context_line":""},{"line_number":206,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"ba8a016a_7c8bcdc3","line":203,"updated":"2015-11-18 19:12:09.000000000","message":"I\u0027m kind of wondering whether this is sufficient as a key derivation. Usually, KDF does a number of iterations [0], whereas this appears to be only doing one round of HMAC. Maybe I\u0027m missing something.\n\n0. https://en.wikipedia.org/wiki/PBKDF2","commit_id":"438740b62acc7a1e7f33aa3d637edb7b044478c0"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"e2083fe09b932b2d86ba28ffdb1e087830d20eab","unresolved":false,"context_lines":[{"line_number":200,"context_line":""},{"line_number":201,"context_line":"    def create_key(self, key_id):"},{"line_number":202,"context_line":"        key_id \u003d \u0027fixed\u0027  # temporary workaround"},{"line_number":203,"context_line":"        return hmac.new(self.root_key, key_id,"},{"line_number":204,"context_line":"                        digestmod\u003dhashlib.sha256).digest()"},{"line_number":205,"context_line":""},{"line_number":206,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"ba8a016a_c4471e76","line":203,"in_reply_to":"ba8a016a_7c8bcdc3","updated":"2015-11-20 11:42:38.000000000","message":"Could be true but if so I suggest we address that in another patch rather than expanding the scope of this one.","commit_id":"438740b62acc7a1e7f33aa3d637edb7b044478c0"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"a383003194d9fed2543c388559b1c6d6761a58fa","unresolved":false,"context_lines":[{"line_number":200,"context_line":""},{"line_number":201,"context_line":"    def create_key(self, key_id):"},{"line_number":202,"context_line":"        key_id \u003d \u0027fixed\u0027  # temporary workaround"},{"line_number":203,"context_line":"        return hmac.new(self.root_key, key_id,"},{"line_number":204,"context_line":"                        digestmod\u003dhashlib.sha256).digest()"},{"line_number":205,"context_line":""},{"line_number":206,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"ba8a016a_dadb997a","line":203,"in_reply_to":"ba8a016a_7c8bcdc3","updated":"2015-11-20 17:29:34.000000000","message":"I think for our use of the key derivation, we only care that the resulting key is of the proper length, and is different for a different path.  I think we hit that requirement as is.","commit_id":"438740b62acc7a1e7f33aa3d637edb7b044478c0"}],"test/unit/common/middleware/test_keymaster.py":[{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"fda397cd71215b69d1eba1aa05ec722edbf36f6b","unresolved":false,"context_lines":[{"line_number":180,"context_line":""},{"line_number":181,"context_line":"    def test_no_root_key_error(self):"},{"line_number":182,"context_line":"        run_with_no_key \u003d lambda: keymaster.KeyMaster(self.swift, {})"},{"line_number":183,"context_line":"        self.assertRaises(ValueError, run_with_no_key)"},{"line_number":184,"context_line":""},{"line_number":185,"context_line":""},{"line_number":186,"context_line":"if __name__ \u003d\u003d \u0027__main__\u0027:"}],"source_content_type":"text/x-python","patch_set":2,"id":"ba8a016a_261eb25f","line":183,"updated":"2015-11-18 10:38:46.000000000","message":"could you add a check for the expected message string in the ValueError.\n\n(using the context manager version of self.assertRaises will probably be the easiest way to access the error and thereby its message)","commit_id":"438740b62acc7a1e7f33aa3d637edb7b044478c0"},{"author":{"_account_id":16964,"name":"Jonathan Hinson","email":"jlhinson@us.ibm.com","username":"jlhinson"},"change_message_id":"76d47f43f1436ec7d67956adec8038736901fc59","unresolved":false,"context_lines":[{"line_number":180,"context_line":""},{"line_number":181,"context_line":"    def test_no_root_key_error(self):"},{"line_number":182,"context_line":"        run_with_no_key \u003d lambda: keymaster.KeyMaster(self.swift, {})"},{"line_number":183,"context_line":"        self.assertRaises(ValueError, run_with_no_key)"},{"line_number":184,"context_line":""},{"line_number":185,"context_line":""},{"line_number":186,"context_line":"if __name__ \u003d\u003d \u0027__main__\u0027:"}],"source_content_type":"text/x-python","patch_set":2,"id":"ba8a016a_255448fd","line":183,"in_reply_to":"ba8a016a_261eb25f","updated":"2015-11-20 16:54:20.000000000","message":"Done","commit_id":"438740b62acc7a1e7f33aa3d637edb7b044478c0"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"c547e16c2ff3e076bff91bb46895396fc17e294b","unresolved":false,"context_lines":[{"line_number":177,"context_line":"        start_response, _ \u003d capture_start_response()"},{"line_number":178,"context_line":"        self.assertRaises(Exception, app, req.environ, start_response)"},{"line_number":179,"context_line":""},{"line_number":180,"context_line":"    def test_key_loaded(self):"},{"line_number":181,"context_line":"        app \u003d keymaster.KeyMaster(self.swift,"},{"line_number":182,"context_line":"                                  {\u0027encryption_root_secret\u0027: \u0027secret\u0027})"},{"line_number":183,"context_line":"        self.assertEqual(app.root_secret, \u0027secret\u0027)"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba8a016a_29483087","line":180,"updated":"2015-11-20 17:38:27.000000000","message":"nit: change test name to test_root_secret_loaded","commit_id":"8cb5505bf174c45cb72be65adc4217242fb247b5"}]}
