)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":7725,"name":"David Stanek","email":"dstanek@dstanek.com","username":"dstanek"},"change_message_id":"057311fb9a47852a39fd5a63ccd35cff780ffeda","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"The trunc_password function attempts to correct and truncate passwords"},{"line_number":10,"context_line":"that are over the MAX_PASSWORD_LENGTH value (default 4096). As the"},{"line_number":11,"context_line":"MAX_PASSWORD_LENGTH field is globally mutable it could be modified"},{"line_number":12,"context_line":"to restrict all passwords to length \u003d 1. This scenario might be unlikely"},{"line_number":13,"context_line":"but generally speaking we should not try to \u0027fix\u0027 invalid input and"},{"line_number":14,"context_line":"continue on processing and logging it."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"AAAAVn%2F%2Fdi0%3D","line":11,"updated":"2014-03-05 23:39:12.000000000","message":"I think everything from \u0027As the\u0027 all the way to \u0027but generally speaking\u0027 should be deleted. Pretty much everything in Python can be monkey patched if you decide to allow malicious code to run. I don\u0027t think it adds any value and takes away from what this change is about.","commit_id":"2070950ef6e52ea1d2c1b4667d3b302a834fbd8d"},{"author":{"_account_id":7725,"name":"David Stanek","email":"dstanek@dstanek.com","username":"dstanek"},"change_message_id":"057311fb9a47852a39fd5a63ccd35cff780ffeda","unresolved":false,"context_lines":[{"line_number":11,"context_line":"MAX_PASSWORD_LENGTH field is globally mutable it could be modified"},{"line_number":12,"context_line":"to restrict all passwords to length \u003d 1. This scenario might be unlikely"},{"line_number":13,"context_line":"but generally speaking we should not try to \u0027fix\u0027 invalid input and"},{"line_number":14,"context_line":"continue on processing and logging it."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Change-Id: I560daa843b94a05412af59a059de5a98bad2925e"},{"line_number":17,"context_line":"Closes-Bug: #1175904"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"AAAAVn%2F%2Fdjk%3D","line":14,"updated":"2014-03-05 23:39:12.000000000","message":"You\u0027re no longer logging it. This should say that long passwords force a validation error.","commit_id":"2070950ef6e52ea1d2c1b4667d3b302a834fbd8d"}],"etc/keystone.conf.sample":[{"author":{"_account_id":2903,"name":"Morgan Fainberg","email":"morgan.fainberg@gmail.com","username":"mdrnstm"},"change_message_id":"3a19c422dc1ae1440aabbdce4dbda6ee53ae9ca5","unresolved":false,"context_lines":[{"line_number":121,"context_line":"# ValidationError. When it is set to false, passwords are"},{"line_number":122,"context_line":"# automatically truncated to the maximum length, which is"},{"line_number":123,"context_line":"# the default behavior in old releases."},{"line_number":124,"context_line":"#strict_password_length\u003dtrue"},{"line_number":125,"context_line":""},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"#"}],"source_content_type":"application/octet-stream","patch_set":5,"id":"AAAAW3%2F%2Fl%2Bo%3D","line":124,"updated":"2014-04-11 22:23:21.000000000","message":"This should be optional and defaulted to off.","commit_id":"f60f2858d0b654d372705dd75ea5a26147a286c0"},{"author":{"_account_id":7805,"name":"Li Ma","email":"skywalker.nick@gmail.com","username":"Nick"},"change_message_id":"d321c83ba825ba6d79f50eec32705f99ed320ec7","unresolved":false,"context_lines":[{"line_number":121,"context_line":"# ValidationError. When it is set to false, passwords are"},{"line_number":122,"context_line":"# automatically truncated to the maximum length, which is"},{"line_number":123,"context_line":"# the default behavior in old releases."},{"line_number":124,"context_line":"#strict_password_length\u003dtrue"},{"line_number":125,"context_line":""},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"#"}],"source_content_type":"application/octet-stream","patch_set":5,"id":"AAAAW3%2F%2Figk%3D","line":124,"in_reply_to":"AAAAW3%2F%2Fl%2Bo%3D","updated":"2014-04-13 11:16:14.000000000","message":"Done","commit_id":"f60f2858d0b654d372705dd75ea5a26147a286c0"},{"author":{"_account_id":11387,"name":"Sam Leong","email":"chio-fai-sam.leong@hpe.com","username":"Chioleong"},"change_message_id":"ba9ea32e7e4bede5607793cb74ae633c0cc2fe29","unresolved":false,"context_lines":[{"line_number":114,"context_line":"# If a password exceeds the maximum length, the operation will"},{"line_number":115,"context_line":"# fail with 403 Forbidden Error."},{"line_number":116,"context_line":"# If set to false, passwords are automatically truncated to"},{"line_number":117,"context_line":"# the maximum length."},{"line_number":118,"context_line":"#strict_password_length\u003dfalse"},{"line_number":119,"context_line":""},{"line_number":120,"context_line":""}],"source_content_type":"application/octet-stream","patch_set":17,"id":"1ae5cdf2_cec82178","line":117,"updated":"2014-06-10 06:48:19.000000000","message":"Using strict_password_length sounds like a number is expected. I suggest to use strick_password_check so that a reader knows a boolean is expected","commit_id":"331b68ffd62b522b37f57000b7463175fb08b9cb"},{"author":{"_account_id":7805,"name":"Li Ma","email":"skywalker.nick@gmail.com","username":"Nick"},"change_message_id":"91e2806b0da47cbe73aeef00ef69c6d8063f5e36","unresolved":false,"context_lines":[{"line_number":114,"context_line":"# If a password exceeds the maximum length, the operation will"},{"line_number":115,"context_line":"# fail with 403 Forbidden Error."},{"line_number":116,"context_line":"# If set to false, passwords are automatically truncated to"},{"line_number":117,"context_line":"# the maximum length."},{"line_number":118,"context_line":"#strict_password_length\u003dfalse"},{"line_number":119,"context_line":""},{"line_number":120,"context_line":""}],"source_content_type":"application/octet-stream","patch_set":17,"id":"1ae5cdf2_555342e1","line":117,"in_reply_to":"1ae5cdf2_222fd189","updated":"2014-06-13 02:43:27.000000000","message":"Done","commit_id":"331b68ffd62b522b37f57000b7463175fb08b9cb"},{"author":{"_account_id":10873,"name":"Juan Antonio Osorio Robles","email":"jaosorior@redhat.com","username":"ejuaoso"},"change_message_id":"e264bb27085fcfdf3986d49c1f73a74064469ef1","unresolved":false,"context_lines":[{"line_number":114,"context_line":"# If a password exceeds the maximum length, the operation will"},{"line_number":115,"context_line":"# fail with 403 Forbidden Error."},{"line_number":116,"context_line":"# If set to false, passwords are automatically truncated to"},{"line_number":117,"context_line":"# the maximum length."},{"line_number":118,"context_line":"#strict_password_length\u003dfalse"},{"line_number":119,"context_line":""},{"line_number":120,"context_line":""}],"source_content_type":"application/octet-stream","patch_set":17,"id":"1ae5cdf2_222fd189","line":117,"in_reply_to":"1ae5cdf2_cec82178","updated":"2014-06-10 10:51:54.000000000","message":"++","commit_id":"331b68ffd62b522b37f57000b7463175fb08b9cb"},{"author":{"_account_id":7805,"name":"Li Ma","email":"skywalker.nick@gmail.com","username":"Nick"},"change_message_id":"91e2806b0da47cbe73aeef00ef69c6d8063f5e36","unresolved":false,"context_lines":[{"line_number":114,"context_line":"# If a password exceeds the maximum length, the operation will"},{"line_number":115,"context_line":"# fail with 403 Forbidden Error."},{"line_number":116,"context_line":"# If set to false, passwords are automatically truncated to"},{"line_number":117,"context_line":"# the maximum length."},{"line_number":118,"context_line":"#strict_password_length\u003dfalse"},{"line_number":119,"context_line":""},{"line_number":120,"context_line":""}],"source_content_type":"application/octet-stream","patch_set":17,"id":"1ae5cdf2_3548762c","line":117,"in_reply_to":"1ae5cdf2_cec82178","updated":"2014-06-13 02:43:27.000000000","message":"Done","commit_id":"331b68ffd62b522b37f57000b7463175fb08b9cb"}],"keystone/common/config.py":[{"author":{"_account_id":2903,"name":"Morgan Fainberg","email":"morgan.fainberg@gmail.com","username":"mdrnstm"},"change_message_id":"3a19c422dc1ae1440aabbdce4dbda6ee53ae9ca5","unresolved":false,"context_lines":[{"line_number":127,"context_line":"                         \u0027restricted by use of an appropriate policy file \u0027"},{"line_number":128,"context_line":"                         \u0027(see policy.v3cloudsample as an example).\u0027),"},{"line_number":129,"context_line":"        cfg.BoolOpt(\u0027strict_password_length\u0027, default\u003dTrue,"},{"line_number":130,"context_line":"                    help\u003d\u0027Set this to true if you want to strictly check \u0027"},{"line_number":131,"context_line":"                         \u0027the length of the password. Invalid length of \u0027"},{"line_number":132,"context_line":"                         \u0027password will throw ValidationError. When it is \u0027"},{"line_number":133,"context_line":"                         \u0027set to false, passwords are automatically truncated \u0027"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAW3%2F%2Fl78%3D","line":130,"updated":"2014-04-11 22:23:21.000000000","message":"Suggest changing the help string to: \"If set to True, strict password length checking is performed. If a password exceeds the maximum length a ValidationError will be raised. If set to False, passwords are automatically truncated to the maximum length.\"\n\nThe extra information about pre-Juno old releases, etc is superfluous in this case, see my comment below about why this needs to default to False.","commit_id":"f60f2858d0b654d372705dd75ea5a26147a286c0"},{"author":{"_account_id":7805,"name":"Li Ma","email":"skywalker.nick@gmail.com","username":"Nick"},"change_message_id":"d321c83ba825ba6d79f50eec32705f99ed320ec7","unresolved":false,"context_lines":[{"line_number":127,"context_line":"                         \u0027restricted by use of an appropriate policy file \u0027"},{"line_number":128,"context_line":"                         \u0027(see policy.v3cloudsample as an example).\u0027),"},{"line_number":129,"context_line":"        cfg.BoolOpt(\u0027strict_password_length\u0027, default\u003dTrue,"},{"line_number":130,"context_line":"                    help\u003d\u0027Set this to true if you want to strictly check \u0027"},{"line_number":131,"context_line":"                         \u0027the length of the password. Invalid length of \u0027"},{"line_number":132,"context_line":"                         \u0027password will throw ValidationError. When it is \u0027"},{"line_number":133,"context_line":"                         \u0027set to false, passwords are automatically truncated \u0027"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAW3%2F%2Figg%3D","line":130,"in_reply_to":"AAAAW3%2F%2Fl78%3D","updated":"2014-04-13 11:16:14.000000000","message":"Done","commit_id":"f60f2858d0b654d372705dd75ea5a26147a286c0"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"5967e5b82840b7b80631d478fc78d9f9289b2901","unresolved":false,"context_lines":[{"line_number":132,"context_line":"                         \u0027password will throw ValidationError. When it is \u0027"},{"line_number":133,"context_line":"                         \u0027set to false, passwords are automatically truncated \u0027"},{"line_number":134,"context_line":"                         \u0027to the maximum length, which is the default \u0027"},{"line_number":135,"context_line":"                         \u0027behavior in old releases.\u0027)],"},{"line_number":136,"context_line":"    \u0027identity\u0027: ["},{"line_number":137,"context_line":"        cfg.StrOpt(\u0027default_domain_id\u0027, default\u003d\u0027default\u0027,"},{"line_number":138,"context_line":"                   help\u003d\u0027This references the domain to use for all \u0027"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAW3%2F%2FyOQ%3D","line":135,"updated":"2014-04-10 13:09:24.000000000","message":"We should give a specific release here, instead of \u0027old release\u0027 use pre-Juno or something along those lines, which will be more informative for the end user.","commit_id":"f60f2858d0b654d372705dd75ea5a26147a286c0"},{"author":{"_account_id":7805,"name":"Li Ma","email":"skywalker.nick@gmail.com","username":"Nick"},"change_message_id":"d321c83ba825ba6d79f50eec32705f99ed320ec7","unresolved":false,"context_lines":[{"line_number":132,"context_line":"                         \u0027password will throw ValidationError. When it is \u0027"},{"line_number":133,"context_line":"                         \u0027set to false, passwords are automatically truncated \u0027"},{"line_number":134,"context_line":"                         \u0027to the maximum length, which is the default \u0027"},{"line_number":135,"context_line":"                         \u0027behavior in old releases.\u0027)],"},{"line_number":136,"context_line":"    \u0027identity\u0027: ["},{"line_number":137,"context_line":"        cfg.StrOpt(\u0027default_domain_id\u0027, default\u003d\u0027default\u0027,"},{"line_number":138,"context_line":"                   help\u003d\u0027This references the domain to use for all \u0027"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAW3%2F%2FigY%3D","line":135,"in_reply_to":"AAAAW3%2F%2Fl%2BQ%3D","updated":"2014-04-13 11:16:14.000000000","message":"Yes, we need to deal with it carefully. Thanks for reminding. I\u0027ll fix it soon.","commit_id":"f60f2858d0b654d372705dd75ea5a26147a286c0"},{"author":{"_account_id":2903,"name":"Morgan Fainberg","email":"morgan.fainberg@gmail.com","username":"mdrnstm"},"change_message_id":"3a19c422dc1ae1440aabbdce4dbda6ee53ae9ca5","unresolved":false,"context_lines":[{"line_number":132,"context_line":"                         \u0027password will throw ValidationError. When it is \u0027"},{"line_number":133,"context_line":"                         \u0027set to false, passwords are automatically truncated \u0027"},{"line_number":134,"context_line":"                         \u0027to the maximum length, which is the default \u0027"},{"line_number":135,"context_line":"                         \u0027behavior in old releases.\u0027)],"},{"line_number":136,"context_line":"    \u0027identity\u0027: ["},{"line_number":137,"context_line":"        cfg.StrOpt(\u0027default_domain_id\u0027, default\u003d\u0027default\u0027,"},{"line_number":138,"context_line":"                   help\u003d\u0027This references the domain to use for all \u0027"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAW3%2F%2Fl%2BQ%3D","line":135,"in_reply_to":"AAAAW3%2F%2FyOQ%3D","updated":"2014-04-11 22:23:21.000000000","message":"Set default to False with the way the code is structured, this would prevent users from logging in if their password was truncated in the past. This will need to be (unfortunately) an opt-in bit of functionality that the operator/deployer will need to communicate to their users when/if enabled.","commit_id":"f60f2858d0b654d372705dd75ea5a26147a286c0"},{"author":{"_account_id":7725,"name":"David Stanek","email":"dstanek@dstanek.com","username":"dstanek"},"change_message_id":"5bed2e6d7ab65d296979cc820d0d7896e7c7d452","unresolved":false,"context_lines":[{"line_number":126,"context_line":"                         \u0027recommended if the scope of a domain admin is being \u0027"},{"line_number":127,"context_line":"                         \u0027restricted by use of an appropriate policy file \u0027"},{"line_number":128,"context_line":"                         \u0027(see policy.v3cloudsample as an example).\u0027),"},{"line_number":129,"context_line":"        cfg.BoolOpt(\u0027strict_password_length\u0027, default\u003dFalse,"},{"line_number":130,"context_line":"                    help\u003d\u0027If set to True, strict password length checking is \u0027"},{"line_number":131,"context_line":"                         \u0027performed. If a password exceeds the maximum length \u0027"},{"line_number":132,"context_line":"                         \u0027a ValidationError will be raised. If set to False, \u0027"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAW3%2F%2FRaI%3D","line":129,"updated":"2014-04-15 16:35:18.000000000","message":"It seems like this should be reworded a little bit. While technically true, I think this is too detailed. Someone setting this option won\u0027t care that a certain exception is raised, only that the request will be rejected with a certain HTTP status code.","commit_id":"cc847f146c3e3369a7cce77d290df4d60a8858ac"},{"author":{"_account_id":7725,"name":"David Stanek","email":"dstanek@dstanek.com","username":"dstanek"},"change_message_id":"79f9c0b852dde5b3cc2a08ba2d3f0f506b718528","unresolved":false,"context_lines":[{"line_number":127,"context_line":"                         \u0027restricted by use of an appropriate policy file \u0027"},{"line_number":128,"context_line":"                         \u0027(see policy.v3cloudsample as an example).\u0027),"},{"line_number":129,"context_line":"        cfg.BoolOpt(\u0027strict_password_length\u0027, default\u003dFalse,"},{"line_number":130,"context_line":"                    help\u003d\u0027If set to True, strict password length checking is \u0027"},{"line_number":131,"context_line":"                         \u0027performed. If a password exceeds the maximum \u0027"},{"line_number":132,"context_line":"                         \u0027length, HTTP status 400 will be raised. \u0027"},{"line_number":133,"context_line":"                         \u0027If set to False, passwords are automatically \u0027"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAAXH%2F%2FVjY%3D","line":130,"updated":"2014-04-22 13:04:28.000000000","message":"It looks like \u0027True\u0027 should be \u0027true\u0027 to match the other help entries.","commit_id":"147118a6a485ee0f5a51322ee201e806be3d3879"},{"author":{"_account_id":7805,"name":"Li Ma","email":"skywalker.nick@gmail.com","username":"Nick"},"change_message_id":"324099a160e7107a8f997003fc9ad1f4f76b71ae","unresolved":false,"context_lines":[{"line_number":127,"context_line":"                         \u0027restricted by use of an appropriate policy file \u0027"},{"line_number":128,"context_line":"                         \u0027(see policy.v3cloudsample as an example).\u0027),"},{"line_number":129,"context_line":"        cfg.BoolOpt(\u0027strict_password_length\u0027, default\u003dFalse,"},{"line_number":130,"context_line":"                    help\u003d\u0027If set to True, strict password length checking is \u0027"},{"line_number":131,"context_line":"                         \u0027performed. If a password exceeds the maximum \u0027"},{"line_number":132,"context_line":"                         \u0027length, HTTP status 400 will be raised. \u0027"},{"line_number":133,"context_line":"                         \u0027If set to False, passwords are automatically \u0027"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAAXH%2F%2FMyE%3D","line":130,"in_reply_to":"AAAAXH%2F%2FVjY%3D","updated":"2014-04-23 11:43:24.000000000","message":"Done","commit_id":"147118a6a485ee0f5a51322ee201e806be3d3879"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"26d71aecf3538bf8bb4ffdc300e3b61927eb0eb4","unresolved":false,"context_lines":[{"line_number":129,"context_line":"        cfg.BoolOpt(\u0027strict_password_length\u0027, default\u003dFalse,"},{"line_number":130,"context_line":"                    help\u003d\u0027If set to true, strict password length checking is \u0027"},{"line_number":131,"context_line":"                         \u0027performed. If a password exceeds the maximum \u0027"},{"line_number":132,"context_line":"                         \u0027length, HTTP status 400 will be raised. \u0027"},{"line_number":133,"context_line":"                         \u0027If set to false, passwords are automatically \u0027"},{"line_number":134,"context_line":"                         \u0027truncated to the maximum length.\u0027)],"},{"line_number":135,"context_line":"    \u0027identity\u0027: ["}],"source_content_type":"text/x-python","patch_set":16,"id":"3ae8d1ca_3c659145","line":132,"updated":"2014-05-27 00:02:22.000000000","message":"this should say for what operations. For example, it should say that it\u0027s for creating a user, updating a user to change the password, and changing a user\u0027s password.\n\nAlso, suggest change \"HTTP status 400 will be raised.\" to \"the operation will fail with a 403 Forbidden error.\"\n\nThe server should respond with a 403 error. 400 Bad Request indicates \"The request could not be understood by the server due to malformed syntax.\"  ( http://tools.ietf.org/html/rfc2616#section-10.4.1 ). In this case, the server understands the request and is refusing to do it ( http://tools.ietf.org/html/rfc2616#section-10.4.4 ).","commit_id":"037af8305f7cc6412b95cae8835cde1a12997110"},{"author":{"_account_id":7805,"name":"Li Ma","email":"skywalker.nick@gmail.com","username":"Nick"},"change_message_id":"057075e73efefe47921767a56aa403ad85390578","unresolved":false,"context_lines":[{"line_number":129,"context_line":"        cfg.BoolOpt(\u0027strict_password_length\u0027, default\u003dFalse,"},{"line_number":130,"context_line":"                    help\u003d\u0027If set to true, strict password length checking is \u0027"},{"line_number":131,"context_line":"                         \u0027performed. If a password exceeds the maximum \u0027"},{"line_number":132,"context_line":"                         \u0027length, HTTP status 400 will be raised. \u0027"},{"line_number":133,"context_line":"                         \u0027If set to false, passwords are automatically \u0027"},{"line_number":134,"context_line":"                         \u0027truncated to the maximum length.\u0027)],"},{"line_number":135,"context_line":"    \u0027identity\u0027: ["}],"source_content_type":"text/x-python","patch_set":16,"id":"3ae8d1ca_e5338cf4","line":132,"in_reply_to":"3ae8d1ca_3c659145","updated":"2014-05-27 02:30:58.000000000","message":"Done","commit_id":"037af8305f7cc6412b95cae8835cde1a12997110"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"eeb12edb885f61b6b46da8b54e60dca629498c3d","unresolved":false,"context_lines":[{"line_number":123,"context_line":"                    help\u003d\u0027If set to true, strict password length checking is \u0027"},{"line_number":124,"context_line":"                         \u0027performed for password manipulation.\u0027"},{"line_number":125,"context_line":"                         \u0027If a password exceeds the maximum length, \u0027"},{"line_number":126,"context_line":"                         \u0027the operation will fail with 403 Forbidden Error.\u0027"},{"line_number":127,"context_line":"                         \u0027If set to false, passwords are automatically \u0027"},{"line_number":128,"context_line":"                         \u0027truncated to the maximum length.\u0027)],"},{"line_number":129,"context_line":"    \u0027identity\u0027: ["}],"source_content_type":"text/x-python","patch_set":17,"id":"1ae5cdf2_9fec8e2b","line":126,"updated":"2014-06-09 23:48:22.000000000","message":"change \"Error\" to \"error\"","commit_id":"331b68ffd62b522b37f57000b7463175fb08b9cb"}],"keystone/common/utils.py":[{"author":{"_account_id":2903,"name":"Morgan Fainberg","email":"morgan.fainberg@gmail.com","username":"mdrnstm"},"change_message_id":"df62c7050bed816b7c3e8016ce4361c303cc3156","unresolved":false,"context_lines":[{"line_number":76,"context_line":"                _(\u0027User password length exceeds the max_length \u0027"},{"line_number":77,"context_line":"                  \u0027to %s characters.\u0027), (len(password) - max_length))"},{"line_number":78,"context_line":"        # Truncate the password will make it insecure."},{"line_number":79,"context_line":"        # Just return the original password and log it."},{"line_number":80,"context_line":"        return password"},{"line_number":81,"context_line":"    except TypeError:"},{"line_number":82,"context_line":"        raise exception.ValidationError(attribute\u003d\u0027string\u0027, target\u003d\u0027password\u0027)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAVn%2F%2Fxfc%3D","line":79,"updated":"2014-03-04 07:02:08.000000000","message":"NIT: don\u0027t explain previous functionality in comments, there is no reference unless the developer knows about the change, which is not expected.\n\nSuggest removing comment (see my comment on the review as a whole though as to why this is not a good approach).","commit_id":"b8abff6c32aa1ff546c4168ea30ae8996f7430c3"},{"author":{"_account_id":7725,"name":"David Stanek","email":"dstanek@dstanek.com","username":"dstanek"},"change_message_id":"057311fb9a47852a39fd5a63ccd35cff780ffeda","unresolved":false,"context_lines":[{"line_number":74,"context_line":"        if len(password) \u003e max_length:"},{"line_number":75,"context_line":"            raise exception.ValidationError("},{"line_number":76,"context_line":"                _(\u0027User password length exceeds the max_length \u0027"},{"line_number":77,"context_line":"                  \u0027to %s characters.\u0027), (len(password) - max_length))"},{"line_number":78,"context_line":"        return password"},{"line_number":79,"context_line":"    except TypeError:"},{"line_number":80,"context_line":"        raise exception.ValidationError(attribute\u003d\u0027string\u0027, target\u003d\u0027password\u0027)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAVn%2F%2Fdic%3D","line":77,"updated":"2014-03-05 23:39:12.000000000","message":"Suggest replacing \u0027to %s\u0027 with \u0027by %d\u0027","commit_id":"2070950ef6e52ea1d2c1b4667d3b302a834fbd8d"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"5967e5b82840b7b80631d478fc78d9f9289b2901","unresolved":false,"context_lines":[{"line_number":86,"context_line":"    try:"},{"line_number":87,"context_line":"        if len(password) \u003e max_length:"},{"line_number":88,"context_line":"            raise exception.ValidationError("},{"line_number":89,"context_line":"                _(\u0027User password length exceeds the max_length \u0027"},{"line_number":90,"context_line":"                  \u0027to %d characters.\u0027), (len(password) - max_length))"},{"line_number":91,"context_line":"        return password"},{"line_number":92,"context_line":"    except TypeError:"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAW3%2F%2FyKo%3D","line":89,"updated":"2014-04-10 13:09:24.000000000","message":"(NIT): \ns/max_length/max_password_length/ \n\nReference the configuration option.","commit_id":"f60f2858d0b654d372705dd75ea5a26147a286c0"},{"author":{"_account_id":2903,"name":"Morgan Fainberg","email":"morgan.fainberg@gmail.com","username":"mdrnstm"},"change_message_id":"3a19c422dc1ae1440aabbdce4dbda6ee53ae9ca5","unresolved":false,"context_lines":[{"line_number":86,"context_line":"    try:"},{"line_number":87,"context_line":"        if len(password) \u003e max_length:"},{"line_number":88,"context_line":"            raise exception.ValidationError("},{"line_number":89,"context_line":"                _(\u0027User password length exceeds the max_length \u0027"},{"line_number":90,"context_line":"                  \u0027to %d characters.\u0027), (len(password) - max_length))"},{"line_number":91,"context_line":"        return password"},{"line_number":92,"context_line":"    except TypeError:"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAW3%2F%2Fl70%3D","line":89,"in_reply_to":"AAAAW3%2F%2FyKo%3D","updated":"2014-04-11 22:23:21.000000000","message":"++","commit_id":"f60f2858d0b654d372705dd75ea5a26147a286c0"},{"author":{"_account_id":7805,"name":"Li Ma","email":"skywalker.nick@gmail.com","username":"Nick"},"change_message_id":"d321c83ba825ba6d79f50eec32705f99ed320ec7","unresolved":false,"context_lines":[{"line_number":86,"context_line":"    try:"},{"line_number":87,"context_line":"        if len(password) \u003e max_length:"},{"line_number":88,"context_line":"            raise exception.ValidationError("},{"line_number":89,"context_line":"                _(\u0027User password length exceeds the max_length \u0027"},{"line_number":90,"context_line":"                  \u0027to %d characters.\u0027), (len(password) - max_length))"},{"line_number":91,"context_line":"        return password"},{"line_number":92,"context_line":"    except TypeError:"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAW3%2F%2Figw%3D","line":89,"in_reply_to":"AAAAW3%2F%2FyKo%3D","updated":"2014-04-13 11:16:14.000000000","message":"Done","commit_id":"f60f2858d0b654d372705dd75ea5a26147a286c0"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"5967e5b82840b7b80631d478fc78d9f9289b2901","unresolved":false,"context_lines":[{"line_number":87,"context_line":"        if len(password) \u003e max_length:"},{"line_number":88,"context_line":"            raise exception.ValidationError("},{"line_number":89,"context_line":"                _(\u0027User password length exceeds the max_length \u0027"},{"line_number":90,"context_line":"                  \u0027to %d characters.\u0027), (len(password) - max_length))"},{"line_number":91,"context_line":"        return password"},{"line_number":92,"context_line":"    except TypeError:"},{"line_number":93,"context_line":"        raise exception.ValidationError(attribute\u003d\u0027string\u0027, target\u003d\u0027password\u0027)"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAW3%2F%2FyMQ%3D","line":90,"updated":"2014-04-10 13:09:24.000000000","message":"(NIT): suggest substituting \u0027to\u0027 with \u0027by\u0027.","commit_id":"f60f2858d0b654d372705dd75ea5a26147a286c0"},{"author":{"_account_id":7805,"name":"Li Ma","email":"skywalker.nick@gmail.com","username":"Nick"},"change_message_id":"d321c83ba825ba6d79f50eec32705f99ed320ec7","unresolved":false,"context_lines":[{"line_number":87,"context_line":"        if len(password) \u003e max_length:"},{"line_number":88,"context_line":"            raise exception.ValidationError("},{"line_number":89,"context_line":"                _(\u0027User password length exceeds the max_length \u0027"},{"line_number":90,"context_line":"                  \u0027to %d characters.\u0027), (len(password) - max_length))"},{"line_number":91,"context_line":"        return password"},{"line_number":92,"context_line":"    except TypeError:"},{"line_number":93,"context_line":"        raise exception.ValidationError(attribute\u003d\u0027string\u0027, target\u003d\u0027password\u0027)"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAW3%2F%2Figs%3D","line":90,"in_reply_to":"AAAAW3%2F%2FyMQ%3D","updated":"2014-04-13 11:16:14.000000000","message":"Done","commit_id":"f60f2858d0b654d372705dd75ea5a26147a286c0"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"5967e5b82840b7b80631d478fc78d9f9289b2901","unresolved":false,"context_lines":[{"line_number":123,"context_line":"        password_utf8 \u003d verify_password_length(password).encode(\u0027utf-8\u0027)"},{"line_number":124,"context_line":"    else:"},{"line_number":125,"context_line":"        password_utf8 \u003d trunc_password(password).encode(\u0027utf-8\u0027)"},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"    return passlib.hash.sha512_crypt.encrypt("},{"line_number":128,"context_line":"        password_utf8, rounds\u003dCONF.crypt_strength)"},{"line_number":129,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAW3%2F%2FyEk%3D","line":126,"updated":"2014-04-10 13:09:24.000000000","message":"Since we are checking the same flow in all four methods, wouldn\u0027t it make sense to combine both verify_password_length and trunc_password? \n\nThat way the hash_passwords methods just have to call def verify_and_trunc_password() and they get back what ever is appropriate. Then we only have to check CONF.strict_password_length in one place too. This might make it easier to maintain in the future and should prevent regression. \n\n    def hash_password(password):\n        \"\"\"Hash a password. Hard.\"\"\"\n        password_utf8 \u003d verify_and_trunc_password(password).encode(\u0027utf-8\u0027)\n        return passlib.hash.sha512_crypt.encrypt(password_utf8, rounds\u003dCONF.crypt_strength)\n\n    def verify_and_trunc_password(password):\n        max_length \u003d CONF.identity.max_password_length\n        try:\n            if len(password) \u003e max_length and CONF.strict_password_length:\n                #raise because we have strict password checking enabled\n                raise exception.ValidationError\n            elif len(password) \u003e max_length and not CONF.strict_password_length:\n                #go ahead and truncate since we don\u0027t have strict password checking enabled.\n                LOG.warning()\n                return password[:max_length]\n            else:\n                #password length checks out\n                return password\n        except TypeError:\n            ....\n\nThoughts?","commit_id":"f60f2858d0b654d372705dd75ea5a26147a286c0"},{"author":{"_account_id":7805,"name":"Li Ma","email":"skywalker.nick@gmail.com","username":"Nick"},"change_message_id":"d321c83ba825ba6d79f50eec32705f99ed320ec7","unresolved":false,"context_lines":[{"line_number":123,"context_line":"        password_utf8 \u003d verify_password_length(password).encode(\u0027utf-8\u0027)"},{"line_number":124,"context_line":"    else:"},{"line_number":125,"context_line":"        password_utf8 \u003d trunc_password(password).encode(\u0027utf-8\u0027)"},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"    return passlib.hash.sha512_crypt.encrypt("},{"line_number":128,"context_line":"        password_utf8, rounds\u003dCONF.crypt_strength)"},{"line_number":129,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAW3%2F%2Figo%3D","line":126,"in_reply_to":"AAAAW3%2F%2FyEk%3D","updated":"2014-04-13 11:16:14.000000000","message":"Good point. This is more concise. Thanks.","commit_id":"f60f2858d0b654d372705dd75ea5a26147a286c0"},{"author":{"_account_id":9569,"name":"Sergey Nikitin","email":"nikitinserv@gmail.com","username":"snikitin"},"change_message_id":"d37bbbdca582b9d887144be9a9dc38d7808b88b2","unresolved":false,"context_lines":[{"line_number":94,"context_line":"            raise exception.ValidationError("},{"line_number":95,"context_line":"                _(\u0027User password length exceeds the max_length \u0027"},{"line_number":96,"context_line":"                  \u0027by %d characters.\u0027), (len(password) - max_length))"},{"line_number":97,"context_line":"        elif len(password) \u003e max_length and not CONF.strict_password_length:"},{"line_number":98,"context_line":"            LOG.warning("},{"line_number":99,"context_line":"                _(\u0027Truncating user password to %s characters.\u0027), max_length)"},{"line_number":100,"context_line":"            return password[:max_length]"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAW3%2F%2FTAw%3D","line":97,"updated":"2014-04-15 14:10:03.000000000","message":"Here we checked length of password twice. I think it would be better If you will use:\n\n if len(password) \u003e max_length:\n     if CONF.strict_password_length:\n          ...\n     else \n          ...\n else\n     return password","commit_id":"cc847f146c3e3369a7cce77d290df4d60a8858ac"},{"author":{"_account_id":7725,"name":"David Stanek","email":"dstanek@dstanek.com","username":"dstanek"},"change_message_id":"5bed2e6d7ab65d296979cc820d0d7896e7c7d452","unresolved":false,"context_lines":[{"line_number":94,"context_line":"            raise exception.ValidationError("},{"line_number":95,"context_line":"                _(\u0027User password length exceeds the max_length \u0027"},{"line_number":96,"context_line":"                  \u0027by %d characters.\u0027), (len(password) - max_length))"},{"line_number":97,"context_line":"        elif len(password) \u003e max_length and not CONF.strict_password_length:"},{"line_number":98,"context_line":"            LOG.warning("},{"line_number":99,"context_line":"                _(\u0027Truncating user password to %s characters.\u0027), max_length)"},{"line_number":100,"context_line":"            return password[:max_length]"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAW3%2F%2FRcg%3D","line":97,"in_reply_to":"AAAAW3%2F%2FTAw%3D","updated":"2014-04-15 16:35:18.000000000","message":"++","commit_id":"cc847f146c3e3369a7cce77d290df4d60a8858ac"},{"author":{"_account_id":2903,"name":"Morgan Fainberg","email":"morgan.fainberg@gmail.com","username":"mdrnstm"},"change_message_id":"3e7af41ac8af2f07107585d50883c50aec49714c","unresolved":false,"context_lines":[{"line_number":98,"context_line":"            else:"},{"line_number":99,"context_line":"                LOG.warning("},{"line_number":100,"context_line":"                    _(\u0027Truncating user password to \u0027"},{"line_number":101,"context_line":"                      \u0027%d characters.\u0027), max_length)"},{"line_number":102,"context_line":"            return password[:max_length]"},{"line_number":103,"context_line":"        else:"},{"line_number":104,"context_line":"            return password"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAXH%2F%2F2sA%3D","line":101,"updated":"2014-04-16 23:00:10.000000000","message":"I don\u0027t think this is something that needs to be a WARNING. There is nothing that the operator can do besides tell the users \"hey, that\u0027s a long password\". Suggest downgrade to INFO. I just don\u0027t see this as something the operator cares to see anytime a long password is hashed / used.\n\nEven though previously we warned on this, I think we should be more selective about use of the higher log levels (to indicate legitimate errors / things the deployer or operator needs to act upon)\n\nI would like input from other keystone core members on this topic.","commit_id":"ccc165a1d080df8fd11820be877eb14775ad36e0"},{"author":{"_account_id":6460,"name":"Brad Topol","email":"btopol@us.ibm.com","username":"btopol"},"change_message_id":"cf9abee2ba4b985e784c968c197844961ec7df43","unresolved":false,"context_lines":[{"line_number":98,"context_line":"            else:"},{"line_number":99,"context_line":"                LOG.warning("},{"line_number":100,"context_line":"                    _(\u0027Truncating user password to \u0027"},{"line_number":101,"context_line":"                      \u0027%d characters.\u0027), max_length)"},{"line_number":102,"context_line":"            return password[:max_length]"},{"line_number":103,"context_line":"        else:"},{"line_number":104,"context_line":"            return password"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAXH%2F%2F2i8%3D","line":101,"updated":"2014-04-16 23:44:30.000000000","message":"agreed. This should be info","commit_id":"ccc165a1d080df8fd11820be877eb14775ad36e0"},{"author":{"_account_id":7725,"name":"David Stanek","email":"dstanek@dstanek.com","username":"dstanek"},"change_message_id":"7ef38ef906e8d083a2c87456527ecb27237b7cd7","unresolved":false,"context_lines":[{"line_number":98,"context_line":"            else:"},{"line_number":99,"context_line":"                LOG.warning("},{"line_number":100,"context_line":"                    _(\u0027Truncating user password to \u0027"},{"line_number":101,"context_line":"                      \u0027%d characters.\u0027), max_length)"},{"line_number":102,"context_line":"            return password[:max_length]"},{"line_number":103,"context_line":"        else:"},{"line_number":104,"context_line":"            return password"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAXH%2F%2FyBk%3D","line":101,"in_reply_to":"AAAAXH%2F%2F2sA%3D","updated":"2014-04-17 14:33:50.000000000","message":"I agree with this. We should definitely highlight this new setting in the release notes so that the operator can decide whether to use it or not. If they decide not use enforce strict password length I see no reason to keep reminding them.","commit_id":"ccc165a1d080df8fd11820be877eb14775ad36e0"},{"author":{"_account_id":6460,"name":"Brad Topol","email":"btopol@us.ibm.com","username":"btopol"},"change_message_id":"3b6b0819f82534c6f26228ac140ea017fd0e9f99","unresolved":false,"context_lines":[{"line_number":86,"context_line":"        return super(SmarterEncoder, self).default(obj)"},{"line_number":87,"context_line":""},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"def verify_and_truc_password_length(password):"},{"line_number":90,"context_line":"    \"\"\"Verify and truncate the max_password_length of the password.\"\"\""},{"line_number":91,"context_line":"    max_length \u003d CONF.identity.max_password_length"},{"line_number":92,"context_line":"    try:"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAXH%2F%2Fimw%3D","line":89,"updated":"2014-04-19 21:02:46.000000000","message":"I prefer that this be called verify_and_trunc_password_length.  trunc is an easier to understand abbreviation for truncate than truc","commit_id":"3123d094160f67770d3df674ba9a751f87f4568e"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"19d0f61e0013851ab6e561bc96da9751224c1bdb","unresolved":false,"context_lines":[{"line_number":93,"context_line":"        if len(password) \u003e max_length:"},{"line_number":94,"context_line":"            if CONF.strict_password_length:"},{"line_number":95,"context_line":"                raise exception.ValidationError("},{"line_number":96,"context_line":"                    _(\u0027User password length exceeds the max_length \u0027"},{"line_number":97,"context_line":"                      \u0027by %d characters.\u0027), (len(password) - max_length))"},{"line_number":98,"context_line":"            else:"},{"line_number":99,"context_line":"                LOG.info("}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAXH%2F%2FcMs%3D","line":96,"updated":"2014-04-21 19:05:38.000000000","message":"use configuration option here since the end user doesn\u0027t necessarily know the code. \n\n    \u0027User password length exceeds the max_password_length\u0027","commit_id":"64cda84f1c5a7e63b0cea8ad474d20d951810928"},{"author":{"_account_id":7805,"name":"Li Ma","email":"skywalker.nick@gmail.com","username":"Nick"},"change_message_id":"2dfb07d6137054b5e5d54906730eea6a223dcdc1","unresolved":false,"context_lines":[{"line_number":93,"context_line":"        if len(password) \u003e max_length:"},{"line_number":94,"context_line":"            if CONF.strict_password_length:"},{"line_number":95,"context_line":"                raise exception.ValidationError("},{"line_number":96,"context_line":"                    _(\u0027User password length exceeds the max_length \u0027"},{"line_number":97,"context_line":"                      \u0027by %d characters.\u0027), (len(password) - max_length))"},{"line_number":98,"context_line":"            else:"},{"line_number":99,"context_line":"                LOG.info("}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAXH%2F%2FZiI%3D","line":96,"in_reply_to":"AAAAXH%2F%2FcMs%3D","updated":"2014-04-22 04:07:33.000000000","message":"Done","commit_id":"64cda84f1c5a7e63b0cea8ad474d20d951810928"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"19d0f61e0013851ab6e561bc96da9751224c1bdb","unresolved":false,"context_lines":[{"line_number":99,"context_line":"                LOG.info("},{"line_number":100,"context_line":"                    _(\u0027Truncating user password to \u0027"},{"line_number":101,"context_line":"                      \u0027%d characters.\u0027), max_length)"},{"line_number":102,"context_line":"            return password[:max_length]"},{"line_number":103,"context_line":"        else:"},{"line_number":104,"context_line":"            return password"},{"line_number":105,"context_line":"    except TypeError:"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAXH%2F%2FcMA%3D","line":102,"updated":"2014-04-21 19:05:38.000000000","message":"could this be rolled into the else above?","commit_id":"64cda84f1c5a7e63b0cea8ad474d20d951810928"},{"author":{"_account_id":7805,"name":"Li Ma","email":"skywalker.nick@gmail.com","username":"Nick"},"change_message_id":"2dfb07d6137054b5e5d54906730eea6a223dcdc1","unresolved":false,"context_lines":[{"line_number":99,"context_line":"                LOG.info("},{"line_number":100,"context_line":"                    _(\u0027Truncating user password to \u0027"},{"line_number":101,"context_line":"                      \u0027%d characters.\u0027), max_length)"},{"line_number":102,"context_line":"            return password[:max_length]"},{"line_number":103,"context_line":"        else:"},{"line_number":104,"context_line":"            return password"},{"line_number":105,"context_line":"    except TypeError:"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAXH%2F%2FZiA%3D","line":102,"in_reply_to":"AAAAXH%2F%2FcMA%3D","updated":"2014-04-22 04:07:33.000000000","message":"Done","commit_id":"64cda84f1c5a7e63b0cea8ad474d20d951810928"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"19d0f61e0013851ab6e561bc96da9751224c1bdb","unresolved":false,"context_lines":[{"line_number":137,"context_line":"    \"\"\""},{"line_number":138,"context_line":"    if password is None or hashed is None:"},{"line_number":139,"context_line":"        return False"},{"line_number":140,"context_line":""},{"line_number":141,"context_line":"    password_utf8 \u003d verify_and_trunc_password_length(password).encode(\u0027utf-8\u0027)"},{"line_number":142,"context_line":"    return passlib.hash.sha512_crypt.verify(password_utf8, hashed)"},{"line_number":143,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAXH%2F%2FcL0%3D","line":140,"updated":"2014-04-21 19:05:38.000000000","message":"extra newline?","commit_id":"64cda84f1c5a7e63b0cea8ad474d20d951810928"},{"author":{"_account_id":7805,"name":"Li Ma","email":"skywalker.nick@gmail.com","username":"Nick"},"change_message_id":"2dfb07d6137054b5e5d54906730eea6a223dcdc1","unresolved":false,"context_lines":[{"line_number":137,"context_line":"    \"\"\""},{"line_number":138,"context_line":"    if password is None or hashed is None:"},{"line_number":139,"context_line":"        return False"},{"line_number":140,"context_line":""},{"line_number":141,"context_line":"    password_utf8 \u003d verify_and_trunc_password_length(password).encode(\u0027utf-8\u0027)"},{"line_number":142,"context_line":"    return passlib.hash.sha512_crypt.verify(password_utf8, hashed)"},{"line_number":143,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAXH%2F%2FZh8%3D","line":140,"in_reply_to":"AAAAXH%2F%2FcL0%3D","updated":"2014-04-22 04:07:33.000000000","message":"Done","commit_id":"64cda84f1c5a7e63b0cea8ad474d20d951810928"},{"author":{"_account_id":7725,"name":"David Stanek","email":"dstanek@dstanek.com","username":"dstanek"},"change_message_id":"79f9c0b852dde5b3cc2a08ba2d3f0f506b718528","unresolved":false,"context_lines":[{"line_number":92,"context_line":"    try:"},{"line_number":93,"context_line":"        if len(password) \u003e max_length:"},{"line_number":94,"context_line":"            if CONF.strict_password_length:"},{"line_number":95,"context_line":"                raise exception.ValidationError("},{"line_number":96,"context_line":"                    _(\u0027User password length exceeds the max_password_length \u0027"},{"line_number":97,"context_line":"                      \u0027by %d characters.\u0027), (len(password) - max_length))"},{"line_number":98,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAAXH%2F%2FVbQ%3D","line":95,"updated":"2014-04-22 13:04:28.000000000","message":"This code doesn\u0027t actually work. It doesn\u0027t actually raise a ValidationError it raises a TypeError. This TypeError is then caught by the except below. The test passes because a ValidationError is eventually raised, but it\u0027s not the one with the correct message.","commit_id":"147118a6a485ee0f5a51322ee201e806be3d3879"},{"author":{"_account_id":7805,"name":"Li Ma","email":"skywalker.nick@gmail.com","username":"Nick"},"change_message_id":"324099a160e7107a8f997003fc9ad1f4f76b71ae","unresolved":false,"context_lines":[{"line_number":92,"context_line":"    try:"},{"line_number":93,"context_line":"        if len(password) \u003e max_length:"},{"line_number":94,"context_line":"            if CONF.strict_password_length:"},{"line_number":95,"context_line":"                raise exception.ValidationError("},{"line_number":96,"context_line":"                    _(\u0027User password length exceeds the max_password_length \u0027"},{"line_number":97,"context_line":"                      \u0027by %d characters.\u0027), (len(password) - max_length))"},{"line_number":98,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAAXH%2F%2FMyo%3D","line":95,"in_reply_to":"AAAAXH%2F%2FVbQ%3D","updated":"2014-04-23 11:43:24.000000000","message":"Wow, thanks a lot, I\u0027ve found the problem, and will fix it asap.","commit_id":"147118a6a485ee0f5a51322ee201e806be3d3879"},{"author":{"_account_id":7725,"name":"David Stanek","email":"dstanek@dstanek.com","username":"dstanek"},"change_message_id":"bffdcc49d81a15e93a1a6371ab792aa5ac69c00a","unresolved":false,"context_lines":[{"line_number":98,"context_line":"            else:"},{"line_number":99,"context_line":"                LOG.info("},{"line_number":100,"context_line":"                    _(\u0027Truncating user password to \u0027"},{"line_number":101,"context_line":"                      \u0027%d characters.\u0027) % max_length)"},{"line_number":102,"context_line":"                return password[:max_length]"},{"line_number":103,"context_line":"        else:"},{"line_number":104,"context_line":"            return password"}],"source_content_type":"text/x-python","patch_set":13,"id":"9ad9bd40_444b4559","line":101,"updated":"2014-04-30 19:43:58.000000000","message":"A \u0027,\u0027 should be used in log statements instead of \u0027%\u0027.","commit_id":"6556a90775979eb1020e153684173427c1a06816"},{"author":{"_account_id":7725,"name":"David Stanek","email":"dstanek@dstanek.com","username":"dstanek"},"change_message_id":"951eee3ed28a41b7dba2cd417153a9cf8f9d69aa","unresolved":false,"context_lines":[{"line_number":98,"context_line":"            else:"},{"line_number":99,"context_line":"                LOG.info("},{"line_number":100,"context_line":"                    _(\u0027Truncating user password to \u0027"},{"line_number":101,"context_line":"                      \u0027%d characters.\u0027) % max_length)"},{"line_number":102,"context_line":"                return password[:max_length]"},{"line_number":103,"context_line":"        else:"},{"line_number":104,"context_line":"            return password"}],"source_content_type":"text/x-python","patch_set":14,"id":"9ad9bd40_d8fc3175","line":101,"updated":"2014-05-05 16:54:25.000000000","message":"Still has the % operator here.","commit_id":"e4bb7be4b4c6a83e53c53d7df410f566ec8eca36"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"26d71aecf3538bf8bb4ffdc300e3b61927eb0eb4","unresolved":false,"context_lines":[{"line_number":86,"context_line":"        return super(SmarterEncoder, self).default(obj)"},{"line_number":87,"context_line":""},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"def verify_and_trunc_password_length(password):"},{"line_number":90,"context_line":"    \"\"\"Verify and truncate the max_password_length of the password.\"\"\""},{"line_number":91,"context_line":"    max_length \u003d CONF.identity.max_password_length"},{"line_number":92,"context_line":"    try:"}],"source_content_type":"text/x-python","patch_set":16,"id":"3ae8d1ca_9c01453c","line":89,"updated":"2014-05-27 00:02:22.000000000","message":"I\u0027d prefer it if the name stayed the same as it was before. The new name is more confusing.","commit_id":"037af8305f7cc6412b95cae8835cde1a12997110"},{"author":{"_account_id":7805,"name":"Li Ma","email":"skywalker.nick@gmail.com","username":"Nick"},"change_message_id":"503e7314430a567a7f388b5a91ec1fca60ac9ea0","unresolved":false,"context_lines":[{"line_number":86,"context_line":"        return super(SmarterEncoder, self).default(obj)"},{"line_number":87,"context_line":""},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"def verify_and_trunc_password_length(password):"},{"line_number":90,"context_line":"    \"\"\"Verify and truncate the max_password_length of the password.\"\"\""},{"line_number":91,"context_line":"    max_length \u003d CONF.identity.max_password_length"},{"line_number":92,"context_line":"    try:"}],"source_content_type":"text/x-python","patch_set":16,"id":"3ae8d1ca_f199636f","line":89,"in_reply_to":"3ae8d1ca_4b77dc02","updated":"2014-05-28 05:59:57.000000000","message":"Done","commit_id":"037af8305f7cc6412b95cae8835cde1a12997110"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"fe31ffcd5c2071e7378d8f3c58ad4e495b290f3e","unresolved":false,"context_lines":[{"line_number":86,"context_line":"        return super(SmarterEncoder, self).default(obj)"},{"line_number":87,"context_line":""},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"def verify_and_trunc_password_length(password):"},{"line_number":90,"context_line":"    \"\"\"Verify and truncate the max_password_length of the password.\"\"\""},{"line_number":91,"context_line":"    max_length \u003d CONF.identity.max_password_length"},{"line_number":92,"context_line":"    try:"}],"source_content_type":"text/x-python","patch_set":16,"id":"3ae8d1ca_4b77dc02","line":89,"in_reply_to":"3ae8d1ca_8573a8b0","updated":"2014-05-27 16:26:14.000000000","message":"Shouldn\u0027t it be verify_length_and_trunc_password? Putting _length at the end doesn\u0027t mean anything to me... truncating a string obviously involves its length so it\u0027s redundant.","commit_id":"037af8305f7cc6412b95cae8835cde1a12997110"},{"author":{"_account_id":7805,"name":"Li Ma","email":"skywalker.nick@gmail.com","username":"Nick"},"change_message_id":"057075e73efefe47921767a56aa403ad85390578","unresolved":false,"context_lines":[{"line_number":86,"context_line":"        return super(SmarterEncoder, self).default(obj)"},{"line_number":87,"context_line":""},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"def verify_and_trunc_password_length(password):"},{"line_number":90,"context_line":"    \"\"\"Verify and truncate the max_password_length of the password.\"\"\""},{"line_number":91,"context_line":"    max_length \u003d CONF.identity.max_password_length"},{"line_number":92,"context_line":"    try:"}],"source_content_type":"text/x-python","patch_set":16,"id":"3ae8d1ca_8573a8b0","line":89,"in_reply_to":"3ae8d1ca_9c01453c","updated":"2014-05-27 02:30:58.000000000","message":"IMO, trunc_password name cannot cover the main functionality. In this method, verification is conducted prior to truncation. After that, truncation is performed due to user\u0027s preference.","commit_id":"037af8305f7cc6412b95cae8835cde1a12997110"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"26d71aecf3538bf8bb4ffdc300e3b61927eb0eb4","unresolved":false,"context_lines":[{"line_number":92,"context_line":"    try:"},{"line_number":93,"context_line":"        if len(password) \u003e max_length:"},{"line_number":94,"context_line":"            if CONF.strict_password_length:"},{"line_number":95,"context_line":"                raise exception.ValidationError("},{"line_number":96,"context_line":"                    _(\u0027User password length exceeds the max_password_length \u0027"},{"line_number":97,"context_line":"                      \u0027by %d characters.\u0027) % (len(password) - max_length))"},{"line_number":98,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":16,"id":"3ae8d1ca_fc540923","line":95,"updated":"2014-05-27 00:02:22.000000000","message":"This should be an exception that results in a 403 Forbidden. Create a new exception then the string doesn\u0027t have to be here.","commit_id":"037af8305f7cc6412b95cae8835cde1a12997110"},{"author":{"_account_id":7725,"name":"David Stanek","email":"dstanek@dstanek.com","username":"dstanek"},"change_message_id":"6f9b3afce2973ca47e79955d3f10b1c1a31a5666","unresolved":false,"context_lines":[{"line_number":92,"context_line":"    try:"},{"line_number":93,"context_line":"        if len(password) \u003e max_length:"},{"line_number":94,"context_line":"            if CONF.strict_password_length:"},{"line_number":95,"context_line":"                raise exception.ValidationError("},{"line_number":96,"context_line":"                    _(\u0027User password length exceeds the max_password_length \u0027"},{"line_number":97,"context_line":"                      \u0027by %d characters.\u0027) % (len(password) - max_length))"},{"line_number":98,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":16,"id":"3ae8d1ca_c8b055f7","line":95,"in_reply_to":"3ae8d1ca_05b6b83d","updated":"2014-05-27 14:53:21.000000000","message":"This is a tough one because I think this method is actually used both for logging in (which would be nice to 403) and for storing a new password (which should get a validation error). To me this hints at the level of abstraction being wrong.","commit_id":"037af8305f7cc6412b95cae8835cde1a12997110"},{"author":{"_account_id":7805,"name":"Li Ma","email":"skywalker.nick@gmail.com","username":"Nick"},"change_message_id":"69bacf34a99dfe6bccb0b08c8d5362f0fcf3468c","unresolved":false,"context_lines":[{"line_number":92,"context_line":"    try:"},{"line_number":93,"context_line":"        if len(password) \u003e max_length:"},{"line_number":94,"context_line":"            if CONF.strict_password_length:"},{"line_number":95,"context_line":"                raise exception.ValidationError("},{"line_number":96,"context_line":"                    _(\u0027User password length exceeds the max_password_length \u0027"},{"line_number":97,"context_line":"                      \u0027by %d characters.\u0027) % (len(password) - max_length))"},{"line_number":98,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":16,"id":"3ae8d1ca_83cc6e37","line":95,"in_reply_to":"3ae8d1ca_c8b055f7","updated":"2014-05-27 15:18:42.000000000","message":"I checked RFC definition once again. I just noticed that 400 usually means inappropriate syntax is used in the request. Maybe 403 is better then.\nWhat do you think of it?","commit_id":"037af8305f7cc6412b95cae8835cde1a12997110"},{"author":{"_account_id":7805,"name":"Li Ma","email":"skywalker.nick@gmail.com","username":"Nick"},"change_message_id":"057075e73efefe47921767a56aa403ad85390578","unresolved":false,"context_lines":[{"line_number":92,"context_line":"    try:"},{"line_number":93,"context_line":"        if len(password) \u003e max_length:"},{"line_number":94,"context_line":"            if CONF.strict_password_length:"},{"line_number":95,"context_line":"                raise exception.ValidationError("},{"line_number":96,"context_line":"                    _(\u0027User password length exceeds the max_password_length \u0027"},{"line_number":97,"context_line":"                      \u0027by %d characters.\u0027) % (len(password) - max_length))"},{"line_number":98,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":16,"id":"3ae8d1ca_05b6b83d","line":95,"in_reply_to":"3ae8d1ca_fc540923","updated":"2014-05-27 02:30:58.000000000","message":"Is it a must? The message string here is straightforward and validation error is also appropriate for the situation, right?","commit_id":"037af8305f7cc6412b95cae8835cde1a12997110"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"26d71aecf3538bf8bb4ffdc300e3b61927eb0eb4","unresolved":false,"context_lines":[{"line_number":96,"context_line":"                    _(\u0027User password length exceeds the max_password_length \u0027"},{"line_number":97,"context_line":"                      \u0027by %d characters.\u0027) % (len(password) - max_length))"},{"line_number":98,"context_line":"            else:"},{"line_number":99,"context_line":"                LOG.info("},{"line_number":100,"context_line":"                    _(\u0027Truncating user password to \u0027"},{"line_number":101,"context_line":"                      \u0027%d characters.\u0027), max_length)"},{"line_number":102,"context_line":"                return password[:max_length]"}],"source_content_type":"text/x-python","patch_set":16,"id":"3ae8d1ca_9c53056c","line":99,"updated":"2014-05-27 00:02:22.000000000","message":"Either keep the behavior the same as it was before (log at warning level) or mention the change in the commit message. If this is going to change, it should be in a separate commit anyways.","commit_id":"037af8305f7cc6412b95cae8835cde1a12997110"},{"author":{"_account_id":7805,"name":"Li Ma","email":"skywalker.nick@gmail.com","username":"Nick"},"change_message_id":"69bacf34a99dfe6bccb0b08c8d5362f0fcf3468c","unresolved":false,"context_lines":[{"line_number":96,"context_line":"                    _(\u0027User password length exceeds the max_password_length \u0027"},{"line_number":97,"context_line":"                      \u0027by %d characters.\u0027) % (len(password) - max_length))"},{"line_number":98,"context_line":"            else:"},{"line_number":99,"context_line":"                LOG.info("},{"line_number":100,"context_line":"                    _(\u0027Truncating user password to \u0027"},{"line_number":101,"context_line":"                      \u0027%d characters.\u0027), max_length)"},{"line_number":102,"context_line":"                return password[:max_length]"}],"source_content_type":"text/x-python","patch_set":16,"id":"3ae8d1ca_e34a9226","line":99,"in_reply_to":"3ae8d1ca_08cebd5a","updated":"2014-05-27 15:18:42.000000000","message":"Sorry, almost forgot it. As operator chooses which method to use, the message logged to info is OK then.","commit_id":"037af8305f7cc6412b95cae8835cde1a12997110"},{"author":{"_account_id":7725,"name":"David Stanek","email":"dstanek@dstanek.com","username":"dstanek"},"change_message_id":"6f9b3afce2973ca47e79955d3f10b1c1a31a5666","unresolved":false,"context_lines":[{"line_number":96,"context_line":"                    _(\u0027User password length exceeds the max_password_length \u0027"},{"line_number":97,"context_line":"                      \u0027by %d characters.\u0027) % (len(password) - max_length))"},{"line_number":98,"context_line":"            else:"},{"line_number":99,"context_line":"                LOG.info("},{"line_number":100,"context_line":"                    _(\u0027Truncating user password to \u0027"},{"line_number":101,"context_line":"                      \u0027%d characters.\u0027), max_length)"},{"line_number":102,"context_line":"                return password[:max_length]"}],"source_content_type":"text/x-python","patch_set":16,"id":"3ae8d1ca_08cebd5a","line":99,"in_reply_to":"3ae8d1ca_45a0c0f4","updated":"2014-05-27 14:53:21.000000000","message":"This was actually a change requested by Morgan in patchset 8.","commit_id":"037af8305f7cc6412b95cae8835cde1a12997110"},{"author":{"_account_id":7805,"name":"Li Ma","email":"skywalker.nick@gmail.com","username":"Nick"},"change_message_id":"503e7314430a567a7f388b5a91ec1fca60ac9ea0","unresolved":false,"context_lines":[{"line_number":96,"context_line":"                    _(\u0027User password length exceeds the max_password_length \u0027"},{"line_number":97,"context_line":"                      \u0027by %d characters.\u0027) % (len(password) - max_length))"},{"line_number":98,"context_line":"            else:"},{"line_number":99,"context_line":"                LOG.info("},{"line_number":100,"context_line":"                    _(\u0027Truncating user password to \u0027"},{"line_number":101,"context_line":"                      \u0027%d characters.\u0027), max_length)"},{"line_number":102,"context_line":"                return password[:max_length]"}],"source_content_type":"text/x-python","patch_set":16,"id":"3ae8d1ca_7282b250","line":99,"in_reply_to":"3ae8d1ca_6b4bb8b0","updated":"2014-05-28 05:59:57.000000000","message":"OK.","commit_id":"037af8305f7cc6412b95cae8835cde1a12997110"},{"author":{"_account_id":7805,"name":"Li Ma","email":"skywalker.nick@gmail.com","username":"Nick"},"change_message_id":"057075e73efefe47921767a56aa403ad85390578","unresolved":false,"context_lines":[{"line_number":96,"context_line":"                    _(\u0027User password length exceeds the max_password_length \u0027"},{"line_number":97,"context_line":"                      \u0027by %d characters.\u0027) % (len(password) - max_length))"},{"line_number":98,"context_line":"            else:"},{"line_number":99,"context_line":"                LOG.info("},{"line_number":100,"context_line":"                    _(\u0027Truncating user password to \u0027"},{"line_number":101,"context_line":"                      \u0027%d characters.\u0027), max_length)"},{"line_number":102,"context_line":"                return password[:max_length]"}],"source_content_type":"text/x-python","patch_set":16,"id":"3ae8d1ca_45a0c0f4","line":99,"in_reply_to":"3ae8d1ca_9c53056c","updated":"2014-05-27 02:30:58.000000000","message":"Done","commit_id":"037af8305f7cc6412b95cae8835cde1a12997110"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"fe31ffcd5c2071e7378d8f3c58ad4e495b290f3e","unresolved":false,"context_lines":[{"line_number":96,"context_line":"                    _(\u0027User password length exceeds the max_password_length \u0027"},{"line_number":97,"context_line":"                      \u0027by %d characters.\u0027) % (len(password) - max_length))"},{"line_number":98,"context_line":"            else:"},{"line_number":99,"context_line":"                LOG.info("},{"line_number":100,"context_line":"                    _(\u0027Truncating user password to \u0027"},{"line_number":101,"context_line":"                      \u0027%d characters.\u0027), max_length)"},{"line_number":102,"context_line":"                return password[:max_length]"}],"source_content_type":"text/x-python","patch_set":16,"id":"3ae8d1ca_6b4bb8b0","line":99,"in_reply_to":"3ae8d1ca_e34a9226","updated":"2014-05-27 16:26:14.000000000","message":"I\u0027m ok with the change, but mention it in the commit message. Sometimes reviewers ask for a change that\u0027s not related to the fix. Unrelated changes should be done in a separate review. See https://wiki.openstack.org/wiki/GitCommitMessages#Things_to_avoid_when_creating_commits","commit_id":"037af8305f7cc6412b95cae8835cde1a12997110"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"26d71aecf3538bf8bb4ffdc300e3b61927eb0eb4","unresolved":false,"context_lines":[{"line_number":98,"context_line":"            else:"},{"line_number":99,"context_line":"                LOG.info("},{"line_number":100,"context_line":"                    _(\u0027Truncating user password to \u0027"},{"line_number":101,"context_line":"                      \u0027%d characters.\u0027), max_length)"},{"line_number":102,"context_line":"                return password[:max_length]"},{"line_number":103,"context_line":"        else:"},{"line_number":104,"context_line":"            return password"}],"source_content_type":"text/x-python","patch_set":16,"id":"3ae8d1ca_7cd639c7","line":101,"updated":"2014-05-27 00:02:22.000000000","message":"Why did this need to change? Leave it as %s.","commit_id":"037af8305f7cc6412b95cae8835cde1a12997110"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"fe31ffcd5c2071e7378d8f3c58ad4e495b290f3e","unresolved":false,"context_lines":[{"line_number":98,"context_line":"            else:"},{"line_number":99,"context_line":"                LOG.info("},{"line_number":100,"context_line":"                    _(\u0027Truncating user password to \u0027"},{"line_number":101,"context_line":"                      \u0027%d characters.\u0027), max_length)"},{"line_number":102,"context_line":"                return password[:max_length]"},{"line_number":103,"context_line":"        else:"},{"line_number":104,"context_line":"            return password"}],"source_content_type":"text/x-python","patch_set":16,"id":"3ae8d1ca_6be2d8a0","line":101,"in_reply_to":"3ae8d1ca_055f980f","updated":"2014-05-27 16:26:14.000000000","message":"We\u0027ve been running with this code for a long time and nobody has ever complained about it, so I don\u0027t see why it should change.","commit_id":"037af8305f7cc6412b95cae8835cde1a12997110"},{"author":{"_account_id":7805,"name":"Li Ma","email":"skywalker.nick@gmail.com","username":"Nick"},"change_message_id":"503e7314430a567a7f388b5a91ec1fca60ac9ea0","unresolved":false,"context_lines":[{"line_number":98,"context_line":"            else:"},{"line_number":99,"context_line":"                LOG.info("},{"line_number":100,"context_line":"                    _(\u0027Truncating user password to \u0027"},{"line_number":101,"context_line":"                      \u0027%d characters.\u0027), max_length)"},{"line_number":102,"context_line":"                return password[:max_length]"},{"line_number":103,"context_line":"        else:"},{"line_number":104,"context_line":"            return password"}],"source_content_type":"text/x-python","patch_set":16,"id":"3ae8d1ca_9173bf4c","line":101,"in_reply_to":"3ae8d1ca_6be2d8a0","updated":"2014-05-28 05:59:57.000000000","message":"Someone requested to change it to %d before. I\u0027m OK to change it back..","commit_id":"037af8305f7cc6412b95cae8835cde1a12997110"},{"author":{"_account_id":7805,"name":"Li Ma","email":"skywalker.nick@gmail.com","username":"Nick"},"change_message_id":"057075e73efefe47921767a56aa403ad85390578","unresolved":false,"context_lines":[{"line_number":98,"context_line":"            else:"},{"line_number":99,"context_line":"                LOG.info("},{"line_number":100,"context_line":"                    _(\u0027Truncating user password to \u0027"},{"line_number":101,"context_line":"                      \u0027%d characters.\u0027), max_length)"},{"line_number":102,"context_line":"                return password[:max_length]"},{"line_number":103,"context_line":"        else:"},{"line_number":104,"context_line":"            return password"}],"source_content_type":"text/x-python","patch_set":16,"id":"3ae8d1ca_055f980f","line":101,"in_reply_to":"3ae8d1ca_7cd639c7","updated":"2014-05-27 02:30:58.000000000","message":"max_length is exactly the integer.","commit_id":"037af8305f7cc6412b95cae8835cde1a12997110"},{"author":{"_account_id":11387,"name":"Sam Leong","email":"chio-fai-sam.leong@hpe.com","username":"Chioleong"},"change_message_id":"ba9ea32e7e4bede5607793cb74ae633c0cc2fe29","unresolved":false,"context_lines":[{"line_number":86,"context_line":"        return super(SmarterEncoder, self).default(obj)"},{"line_number":87,"context_line":""},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"def verify_length_and_trunc_password(password):"},{"line_number":90,"context_line":"    \"\"\"Verify and truncate the max_password_length of the password.\"\"\""},{"line_number":91,"context_line":"    max_length \u003d CONF.identity.max_password_length"},{"line_number":92,"context_line":"    try:"}],"source_content_type":"text/x-python","patch_set":17,"id":"1ae5cdf2_2e2b45ec","line":89,"updated":"2014-06-10 06:48:19.000000000","message":"I think it\u0027s clear to say -\nVerify and truncate the provided password to the max_password_length.","commit_id":"331b68ffd62b522b37f57000b7463175fb08b9cb"},{"author":{"_account_id":7805,"name":"Li Ma","email":"skywalker.nick@gmail.com","username":"Nick"},"change_message_id":"91e2806b0da47cbe73aeef00ef69c6d8063f5e36","unresolved":false,"context_lines":[{"line_number":86,"context_line":"        return super(SmarterEncoder, self).default(obj)"},{"line_number":87,"context_line":""},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"def verify_length_and_trunc_password(password):"},{"line_number":90,"context_line":"    \"\"\"Verify and truncate the max_password_length of the password.\"\"\""},{"line_number":91,"context_line":"    max_length \u003d CONF.identity.max_password_length"},{"line_number":92,"context_line":"    try:"}],"source_content_type":"text/x-python","patch_set":17,"id":"1ae5cdf2_356f9693","line":89,"in_reply_to":"1ae5cdf2_2e2b45ec","updated":"2014-06-13 02:43:27.000000000","message":"Done","commit_id":"331b68ffd62b522b37f57000b7463175fb08b9cb"},{"author":{"_account_id":7725,"name":"David Stanek","email":"dstanek@dstanek.com","username":"dstanek"},"change_message_id":"8b1c98b71e82d416b8a5dd5ec3746a2193ce0703","unresolved":false,"context_lines":[{"line_number":94,"context_line":"            if CONF.strict_password_check:"},{"line_number":95,"context_line":"                raise exception.PasswordVerificationError(size\u003dmax_length)"},{"line_number":96,"context_line":"            else:"},{"line_number":97,"context_line":"                LOG.warn("},{"line_number":98,"context_line":"                    _(\u0027Truncating user password to \u0027"},{"line_number":99,"context_line":"                      \u0027%d characters.\u0027), max_length)"},{"line_number":100,"context_line":"                return password[:max_length]"}],"source_content_type":"text/x-python","patch_set":19,"id":"1ae5cdf2_f946e9be","line":97,"updated":"2014-06-13 23:21:05.000000000","message":"Why is this LOG.warn instead of LOG.warning? Future versions of Python have deprecated \u0027warn\u0027: http://hg.python.org/cpython/rev/4a90d1ed115d","commit_id":"d5d284688059daf1401a9305e312a229cc802a1c"}],"keystone/tests/test_utils.py":[{"author":{"_account_id":4,"name":"Dolph Mathews","email":"dolph.mathews@gmail.com","username":"dolph"},"change_message_id":"c97ddef073afc70692a35c83853de0cbf93004d2","unresolved":false,"context_lines":[{"line_number":36,"context_line":"from keystone import exception"},{"line_number":37,"context_line":"from keystone import service"},{"line_number":38,"context_line":"from keystone import tests"},{"line_number":39,"context_line":"#import passlib.utils.handlers as pass_handlers"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"TZ \u003d None"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAVn%2F%2FgfY%3D","line":39,"updated":"2014-03-05 17:43:27.000000000","message":"don\u0027t propose commented-out code","commit_id":"2070950ef6e52ea1d2c1b4667d3b302a834fbd8d"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"5967e5b82840b7b80631d478fc78d9f9289b2901","unresolved":false,"context_lines":[{"line_number":73,"context_line":"        self.assertFalse(utils.check_password(wrong, hashed))"},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"    def test_hash_long_password_truncation(self):"},{"line_number":76,"context_line":"        CONF.strict_password_length \u003d False"},{"line_number":77,"context_line":"        bigboy \u003d \u00270\u0027 * 9999999"},{"line_number":78,"context_line":"        hashed \u003d utils.hash_password(bigboy)"},{"line_number":79,"context_line":"        self.assertTrue(utils.check_password(bigboy, hashed))"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAW3%2F%2FyAE%3D","line":76,"updated":"2014-04-10 13:09:24.000000000","message":"Shouldn\u0027t we use config_fixtures here?","commit_id":"f60f2858d0b654d372705dd75ea5a26147a286c0"},{"author":{"_account_id":7805,"name":"Li Ma","email":"skywalker.nick@gmail.com","username":"Nick"},"change_message_id":"d321c83ba825ba6d79f50eec32705f99ed320ec7","unresolved":false,"context_lines":[{"line_number":73,"context_line":"        self.assertFalse(utils.check_password(wrong, hashed))"},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"    def test_hash_long_password_truncation(self):"},{"line_number":76,"context_line":"        CONF.strict_password_length \u003d False"},{"line_number":77,"context_line":"        bigboy \u003d \u00270\u0027 * 9999999"},{"line_number":78,"context_line":"        hashed \u003d utils.hash_password(bigboy)"},{"line_number":79,"context_line":"        self.assertTrue(utils.check_password(bigboy, hashed))"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAW3%2F%2FigA%3D","line":76,"in_reply_to":"AAAAW3%2F%2Fl7Q%3D","updated":"2014-04-13 11:16:14.000000000","message":"Done","commit_id":"f60f2858d0b654d372705dd75ea5a26147a286c0"},{"author":{"_account_id":2903,"name":"Morgan Fainberg","email":"morgan.fainberg@gmail.com","username":"mdrnstm"},"change_message_id":"3a19c422dc1ae1440aabbdce4dbda6ee53ae9ca5","unresolved":false,"context_lines":[{"line_number":73,"context_line":"        self.assertFalse(utils.check_password(wrong, hashed))"},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"    def test_hash_long_password_truncation(self):"},{"line_number":76,"context_line":"        CONF.strict_password_length \u003d False"},{"line_number":77,"context_line":"        bigboy \u003d \u00270\u0027 * 9999999"},{"line_number":78,"context_line":"        hashed \u003d utils.hash_password(bigboy)"},{"line_number":79,"context_line":"        self.assertTrue(utils.check_password(bigboy, hashed))"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAW3%2F%2Fl7Q%3D","line":76,"in_reply_to":"AAAAW3%2F%2FyAE%3D","updated":"2014-04-11 22:23:21.000000000","message":"Do not set CONF values directly, use:\n\n    self.config_fixture.config(strict_password_length\u003dFalse)","commit_id":"f60f2858d0b654d372705dd75ea5a26147a286c0"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"5967e5b82840b7b80631d478fc78d9f9289b2901","unresolved":false,"context_lines":[{"line_number":79,"context_line":"        self.assertTrue(utils.check_password(bigboy, hashed))"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"    def test_hash_long_password_strict(self):"},{"line_number":82,"context_line":"        CONF.strict_password_length \u003d True"},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"        bigboy \u003d \u00270\u0027 * 9999999"},{"line_number":85,"context_line":"        self.assertRaises(exception.ValidationError,"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAW3%2F%2Fx%2F8%3D","line":82,"updated":"2014-04-10 13:09:24.000000000","message":"Same comment as above","commit_id":"f60f2858d0b654d372705dd75ea5a26147a286c0"},{"author":{"_account_id":7805,"name":"Li Ma","email":"skywalker.nick@gmail.com","username":"Nick"},"change_message_id":"d321c83ba825ba6d79f50eec32705f99ed320ec7","unresolved":false,"context_lines":[{"line_number":79,"context_line":"        self.assertTrue(utils.check_password(bigboy, hashed))"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"    def test_hash_long_password_strict(self):"},{"line_number":82,"context_line":"        CONF.strict_password_length \u003d True"},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"        bigboy \u003d \u00270\u0027 * 9999999"},{"line_number":85,"context_line":"        self.assertRaises(exception.ValidationError,"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAW3%2F%2Fif8%3D","line":82,"in_reply_to":"AAAAW3%2F%2Fx%2F8%3D","updated":"2014-04-13 11:16:14.000000000","message":"Done","commit_id":"f60f2858d0b654d372705dd75ea5a26147a286c0"},{"author":{"_account_id":7725,"name":"David Stanek","email":"dstanek@dstanek.com","username":"dstanek"},"change_message_id":"5bed2e6d7ab65d296979cc820d0d7896e7c7d452","unresolved":false,"context_lines":[{"line_number":33,"context_line":"import time"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"from keystone.common import utils"},{"line_number":36,"context_line":"from keystone import config"},{"line_number":37,"context_line":"from keystone import exception"},{"line_number":38,"context_line":"from keystone import service"},{"line_number":39,"context_line":"from keystone import tests"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAW3%2F%2FRcA%3D","line":36,"updated":"2014-04-15 16:35:18.000000000","message":"Is this actually needed? It\u0027s not used in you changes at all.","commit_id":"cc847f146c3e3369a7cce77d290df4d60a8858ac"},{"author":{"_account_id":7725,"name":"David Stanek","email":"dstanek@dstanek.com","username":"dstanek"},"change_message_id":"5bed2e6d7ab65d296979cc820d0d7896e7c7d452","unresolved":false,"context_lines":[{"line_number":38,"context_line":"from keystone import service"},{"line_number":39,"context_line":"from keystone import tests"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"CONF \u003d config.CONF"},{"line_number":42,"context_line":"TZ \u003d None"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAW3%2F%2FRcI%3D","line":41,"updated":"2014-04-15 16:35:18.000000000","message":"Is this actually needed? It\u0027s not used in your changes at all.","commit_id":"cc847f146c3e3369a7cce77d290df4d60a8858ac"},{"author":{"_account_id":2903,"name":"Morgan Fainberg","email":"morgan.fainberg@gmail.com","username":"mdrnstm"},"change_message_id":"3e7af41ac8af2f07107585d50883c50aec49714c","unresolved":false,"context_lines":[{"line_number":36,"context_line":"from keystone import exception"},{"line_number":37,"context_line":"from keystone import service"},{"line_number":38,"context_line":"from keystone import tests"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"TZ \u003d None"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAXH%2F%2F2sk%3D","line":39,"updated":"2014-04-16 23:00:10.000000000","message":"revert whitespace change on previous line. https://wiki.openstack.org/wiki/GitCommitMessages#Things_to_avoid_when_creating_commits","commit_id":"ccc165a1d080df8fd11820be877eb14775ad36e0"},{"author":{"_account_id":6460,"name":"Brad Topol","email":"btopol@us.ibm.com","username":"btopol"},"change_message_id":"31923591b9af17544fba2424992656b05365c2df","unresolved":false,"context_lines":[{"line_number":79,"context_line":""},{"line_number":80,"context_line":"    def test_hash_long_password_strict(self):"},{"line_number":81,"context_line":"        self.config_fixture.config(strict_password_length\u003dTrue)"},{"line_number":82,"context_line":"        bigboy \u003d \u00270\u0027 * 9999999"},{"line_number":83,"context_line":"        self.assertRaises(exception.ValidationError,"},{"line_number":84,"context_line":"                          utils.hash_password,"},{"line_number":85,"context_line":"                          bigboy)"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAXX%2F%2F0m4%3D","line":82,"updated":"2014-04-26 03:19:42.000000000","message":"I know you are just following what was here but since you are updating the code anyway please update the bigboy  variable to something like invalid_length_password in both test_hash_long_password_truncation and test_hash_long_password_strict.  I\u0027m not sure how bigboy got in as a variable name in the first place but it really shouldn\u0027t be there.","commit_id":"8a73654eca67660114fa1eb3200c94de5a42956e"},{"author":{"_account_id":7805,"name":"Li Ma","email":"skywalker.nick@gmail.com","username":"Nick"},"change_message_id":"4b113d345fe0f7e8e4bd0eeca6bb88ab71f1a442","unresolved":false,"context_lines":[{"line_number":79,"context_line":""},{"line_number":80,"context_line":"    def test_hash_long_password_strict(self):"},{"line_number":81,"context_line":"        self.config_fixture.config(strict_password_length\u003dTrue)"},{"line_number":82,"context_line":"        bigboy \u003d \u00270\u0027 * 9999999"},{"line_number":83,"context_line":"        self.assertRaises(exception.ValidationError,"},{"line_number":84,"context_line":"                          utils.hash_password,"},{"line_number":85,"context_line":"                          bigboy)"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAXX%2F%2Fz1o%3D","line":82,"in_reply_to":"AAAAXX%2F%2F0m4%3D","updated":"2014-04-26 11:27:53.000000000","message":"Done","commit_id":"8a73654eca67660114fa1eb3200c94de5a42956e"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"f73de3d9df10a1e91f52f3c31f7177f689ff6161","unresolved":false,"context_lines":[{"line_number":75,"context_line":"        self.config_fixture.config(strict_password_length\u003dFalse)"},{"line_number":76,"context_line":"        invalid_length_password \u003d \u00270\u0027 * 9999999"},{"line_number":77,"context_line":"        hashed \u003d utils.hash_password(invalid_length_password)"},{"line_number":78,"context_line":"        self.assertTrue(utils.check_password(invalid_length_password, hashed))"},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"    def test_hash_long_password_strict(self):"},{"line_number":81,"context_line":"        self.config_fixture.config(strict_password_length\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":13,"id":"9ad9bd40_1c9b3b19","line":78,"updated":"2014-05-01 19:12:14.000000000","message":"Would it be possible to elaborate on this test case a little more? Something like: \n\nhttp://paste.openstack.org/show/78287/\n\nWhere we can test with both max_password_length and strict_password_length config values and calling utils.verify_and_trunc_password_length directly instead of through utils.check_password and utils.hash_password.","commit_id":"6556a90775979eb1020e153684173427c1a06816"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"d4a40efd7590c172c4376a50f8bb834a93740c84","unresolved":false,"context_lines":[{"line_number":76,"context_line":"        normal_password \u003d \u0027passw0rd\u0027"},{"line_number":77,"context_line":"        verified \u003d utils.verify_and_trunc_password_length(normal_password)"},{"line_number":78,"context_line":"        self.assertEqual(verified, normal_password)"},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"    def test_verify_long_password_strict(self):"},{"line_number":81,"context_line":"        self.config_fixture.config(strict_password_length\u003dFalse)"},{"line_number":82,"context_line":"        self.config_fixture.config(group\u003d\u0027identity\u0027, max_password_length\u003d5)"}],"source_content_type":"text/x-python","patch_set":15,"id":"7adec928_14aa6119","line":79,"updated":"2014-05-07 20:16:21.000000000","message":"http://paste.openstack.org/show/79472/ one more test case that expands on test_hash_long_password_strict by testing when strict_password_length \u003d True and max_password_length is also set.","commit_id":"90d711cfb2e87c6edcdc49fb58a8a50d63c201d1"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"26d71aecf3538bf8bb4ffdc300e3b61927eb0eb4","unresolved":false,"context_lines":[{"line_number":73,"context_line":""},{"line_number":74,"context_line":"    def test_verify_normal_password_strict(self):"},{"line_number":75,"context_line":"        self.config_fixture.config(strict_password_length\u003dFalse)"},{"line_number":76,"context_line":"        normal_password \u003d \u0027passw0rd\u0027"},{"line_number":77,"context_line":"        verified \u003d utils.verify_and_trunc_password_length(normal_password)"},{"line_number":78,"context_line":"        self.assertEqual(verified, normal_password)"},{"line_number":79,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"3ae8d1ca_9c76a5d7","line":76,"updated":"2014-05-27 00:02:22.000000000","message":"a random value should be used for the password -- uuid.uuid4().hex.","commit_id":"037af8305f7cc6412b95cae8835cde1a12997110"},{"author":{"_account_id":7805,"name":"Li Ma","email":"skywalker.nick@gmail.com","username":"Nick"},"change_message_id":"057075e73efefe47921767a56aa403ad85390578","unresolved":false,"context_lines":[{"line_number":73,"context_line":""},{"line_number":74,"context_line":"    def test_verify_normal_password_strict(self):"},{"line_number":75,"context_line":"        self.config_fixture.config(strict_password_length\u003dFalse)"},{"line_number":76,"context_line":"        normal_password \u003d \u0027passw0rd\u0027"},{"line_number":77,"context_line":"        verified \u003d utils.verify_and_trunc_password_length(normal_password)"},{"line_number":78,"context_line":"        self.assertEqual(verified, normal_password)"},{"line_number":79,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"3ae8d1ca_82171e51","line":76,"in_reply_to":"3ae8d1ca_9c76a5d7","updated":"2014-05-27 02:30:58.000000000","message":"Done","commit_id":"037af8305f7cc6412b95cae8835cde1a12997110"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"26d71aecf3538bf8bb4ffdc300e3b61927eb0eb4","unresolved":false,"context_lines":[{"line_number":82,"context_line":"        self.config_fixture.config(group\u003d\u0027identity\u0027, max_password_length\u003d5)"},{"line_number":83,"context_line":"        invalid_password \u003d \u0027passw0rd\u0027"},{"line_number":84,"context_line":"        truncated \u003d utils.verify_and_trunc_password_length(invalid_password)"},{"line_number":85,"context_line":"        self.assertEqual(truncated, \u0027passw\u0027)"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"    def test_verify_long_password_strict_raises_exception(self):"},{"line_number":88,"context_line":"        self.config_fixture.config(strict_password_length\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":16,"id":"3ae8d1ca_fca6c952","line":85,"updated":"2014-05-27 00:02:22.000000000","message":"suggest use invalid_password[:max_length] so that it\u0027s obvious that this is part of invalid_password and not some new value, and the length is the max_password_length.\n\nAlso (nitpicking), the order of arguments to assertEqual is expected, observed ( https://github.com/testing-cabal/testtools/blob/master/testtools/testcase.py#L330 ), so change the order of the arguments so we get a more comprehensible message if it fails.","commit_id":"037af8305f7cc6412b95cae8835cde1a12997110"},{"author":{"_account_id":7805,"name":"Li Ma","email":"skywalker.nick@gmail.com","username":"Nick"},"change_message_id":"057075e73efefe47921767a56aa403ad85390578","unresolved":false,"context_lines":[{"line_number":82,"context_line":"        self.config_fixture.config(group\u003d\u0027identity\u0027, max_password_length\u003d5)"},{"line_number":83,"context_line":"        invalid_password \u003d \u0027passw0rd\u0027"},{"line_number":84,"context_line":"        truncated \u003d utils.verify_and_trunc_password_length(invalid_password)"},{"line_number":85,"context_line":"        self.assertEqual(truncated, \u0027passw\u0027)"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"    def test_verify_long_password_strict_raises_exception(self):"},{"line_number":88,"context_line":"        self.config_fixture.config(strict_password_length\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":16,"id":"3ae8d1ca_a20b3a2a","line":85,"in_reply_to":"3ae8d1ca_fca6c952","updated":"2014-05-27 02:30:58.000000000","message":"Done","commit_id":"037af8305f7cc6412b95cae8835cde1a12997110"}]}
