)]}'
{"keystone/common/utils.py":[{"author":{"_account_id":7073,"name":"mouad benchchaoui","email":"m.benchchaoui@x-ion.de","username":"mouad"},"change_message_id":"506d69ea2be257dacc3f7a4e89b50612170271fd","unresolved":false,"context_lines":[{"line_number":270,"context_line":"            raise exception.RequestTooLarge()"},{"line_number":271,"context_line":"        return result"},{"line_number":272,"context_line":""},{"line_number":273,"context_line":""},{"line_number":274,"context_line":"def mask_password(message, is_unicode\u003dFalse):"},{"line_number":275,"context_line":"    \"\"\"Replace password to \u0027***\u0027 in message"},{"line_number":276,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAOn%2F%2F7Ok%3D","line":273,"updated":"2013-04-11 10:00:30.000000000","message":"_RE_PASS_1 \u003d re.compile(r\"(\u0027*password\u0027\\s*:\\s*)u?\u0027.+?\u0027\", re.DOTALL)\n\n_RE_PASS_2 \u003d re.compile(r\u0027(\"*password\"\\s*:\\s*)u?\".+?\"\u0027, re.DOTALL)\n\n\ndef mask_password(message, is_unicode\u003dFalse, secret\u003d\"***\"):\n     \"\"\"Replace password with ‘‘secret‘‘ in message.\n\n     :param message: The string which include security information.\n     :param is_unicode: Is unicode string ?\n     :param secret: substitution string default to \"***\".\n     :returns: The string\n\n     For example:\n\n        \u003e\u003e\u003e mask_password(\u0027\"password\" : \"aaaaa\"\u0027)\n        \u0027\"password\" : ***\u0027\n        \u003e\u003e\u003e mask_password(\"\u0027original_password\u0027 : \u0027aaaaa\u0027\")\n        \"\u0027original_password\u0027 : ***\"\n        \u003e\u003e\u003e mask_password(\"\u0027original_password\u0027 :   u\u0027aaaaa\u0027\")\n        \"\u0027original_password\u0027 :   ***\"\n\n     \"\"\"\n     secret \u003d r\"\\1\" + secret\n     if is_unicode:\n         message \u003d unicode(message)\n     result \u003d _RE_PASS_1.sub(secret, message)\n     # In order to reduce the complex of regular expression substitution\n     # try to scan the password property with double quotes again.\n     if result \u003d\u003d message:\n         result \u003d _RE_PASS_2.sub(secret, message)\n     return result","commit_id":"24359c8483d5608ccc3cbd6d90d4d2502174e832"},{"author":{"_account_id":7073,"name":"mouad benchchaoui","email":"m.benchchaoui@x-ion.de","username":"mouad"},"change_message_id":"506d69ea2be257dacc3f7a4e89b50612170271fd","unresolved":false,"context_lines":[{"line_number":271,"context_line":"        return result"},{"line_number":272,"context_line":""},{"line_number":273,"context_line":""},{"line_number":274,"context_line":"def mask_password(message, is_unicode\u003dFalse):"},{"line_number":275,"context_line":"    \"\"\"Replace password to \u0027***\u0027 in message"},{"line_number":276,"context_line":""},{"line_number":277,"context_line":"    :param message: The string which include security information"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAOn%2F%2F7OU%3D","line":274,"updated":"2013-04-11 10:00:30.000000000","message":"More customizing can be done by adding a default variable secret as shown above","commit_id":"24359c8483d5608ccc3cbd6d90d4d2502174e832"},{"author":{"_account_id":7073,"name":"mouad benchchaoui","email":"m.benchchaoui@x-ion.de","username":"mouad"},"change_message_id":"506d69ea2be257dacc3f7a4e89b50612170271fd","unresolved":false,"context_lines":[{"line_number":278,"context_line":"    :param is_unicode: Is unicode string?"},{"line_number":279,"context_line":"    :returns: The string"},{"line_number":280,"context_line":""},{"line_number":281,"context_line":"    For example:"},{"line_number":282,"context_line":"    \u0027\"password\" : \"aaaaa\" \u003d\u003e \"password\" : \"***\"\u0027"},{"line_number":283,"context_line":"    \"\u0027original_password\u0027 : \u0027aaaaa\" \u003d\u003e \u0027original_password\u0027 : \u0027***\u0027\""},{"line_number":284,"context_line":"    \"\"\""}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAOn%2F%2F7OY%3D","line":281,"updated":"2013-04-11 10:00:30.000000000","message":"IMHO better to use doctest to give example in the docstring.","commit_id":"24359c8483d5608ccc3cbd6d90d4d2502174e832"},{"author":{"_account_id":7073,"name":"mouad benchchaoui","email":"m.benchchaoui@x-ion.de","username":"mouad"},"change_message_id":"506d69ea2be257dacc3f7a4e89b50612170271fd","unresolved":false,"context_lines":[{"line_number":281,"context_line":"    For example:"},{"line_number":282,"context_line":"    \u0027\"password\" : \"aaaaa\" \u003d\u003e \"password\" : \"***\"\u0027"},{"line_number":283,"context_line":"    \"\u0027original_password\u0027 : \u0027aaaaa\" \u003d\u003e \u0027original_password\u0027 : \u0027***\u0027\""},{"line_number":284,"context_line":"    \"\"\""},{"line_number":285,"context_line":"    if is_unicode:"},{"line_number":286,"context_line":"        text \u003d unicode(message)"},{"line_number":287,"context_line":"    else:"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAOn%2F%2F7Og%3D","line":284,"updated":"2013-04-11 10:00:30.000000000","message":"No need to create a new local variable.","commit_id":"24359c8483d5608ccc3cbd6d90d4d2502174e832"},{"author":{"_account_id":7073,"name":"mouad benchchaoui","email":"m.benchchaoui@x-ion.de","username":"mouad"},"change_message_id":"506d69ea2be257dacc3f7a4e89b50612170271fd","unresolved":false,"context_lines":[{"line_number":285,"context_line":"    if is_unicode:"},{"line_number":286,"context_line":"        text \u003d unicode(message)"},{"line_number":287,"context_line":"    else:"},{"line_number":288,"context_line":"        text \u003d message"},{"line_number":289,"context_line":"    result \u003d re.sub(r\"(\u0027*password\u0027\\s*:\\s*u?\u0027).+?\u0027\","},{"line_number":290,"context_line":"                    lambda m: m.group(1) + \"***\u0027\","},{"line_number":291,"context_line":"                    text)"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAOn%2F%2F7OQ%3D","line":288,"updated":"2013-04-11 10:00:30.000000000","message":"Use \\1 in the substitution string is better than a lambda IMHO check example above","commit_id":"24359c8483d5608ccc3cbd6d90d4d2502174e832"},{"author":{"_account_id":6526,"name":"David Geng","email":"gengjh@cn.ibm.com","username":"genggjh"},"change_message_id":"767f100d96041b6568f3ad0be5f9a9621add73a1","unresolved":false,"context_lines":[{"line_number":285,"context_line":"    if is_unicode:"},{"line_number":286,"context_line":"        text \u003d unicode(message)"},{"line_number":287,"context_line":"    else:"},{"line_number":288,"context_line":"        text \u003d message"},{"line_number":289,"context_line":"    result \u003d re.sub(r\"(\u0027*password\u0027\\s*:\\s*u?\u0027).+?\u0027\","},{"line_number":290,"context_line":"                    lambda m: m.group(1) + \"***\u0027\","},{"line_number":291,"context_line":"                    text)"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAOn%2F%2F67Q%3D","line":288,"in_reply_to":"AAAAOn%2F%2F7Bg%3D","updated":"2013-04-11 15:28:47.000000000","message":"Good question, i think to keep it more sample we needn\u0027t the  \u0027 or \" since it mean nothing to us.","commit_id":"24359c8483d5608ccc3cbd6d90d4d2502174e832"},{"author":{"_account_id":7073,"name":"mouad benchchaoui","email":"m.benchchaoui@x-ion.de","username":"mouad"},"change_message_id":"a53b73fa27b0bfa5a27993906f7c547d3ec38ac3","unresolved":false,"context_lines":[{"line_number":285,"context_line":"    if is_unicode:"},{"line_number":286,"context_line":"        text \u003d unicode(message)"},{"line_number":287,"context_line":"    else:"},{"line_number":288,"context_line":"        text \u003d message"},{"line_number":289,"context_line":"    result \u003d re.sub(r\"(\u0027*password\u0027\\s*:\\s*u?\u0027).+?\u0027\","},{"line_number":290,"context_line":"                    lambda m: m.group(1) + \"***\u0027\","},{"line_number":291,"context_line":"                    text)"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAOn%2F%2F7Bg%3D","line":288,"in_reply_to":"AAAAOn%2F%2F7DA%3D","updated":"2013-04-11 14:41:01.000000000","message":"Actually i did it in purpose because the idea is just to hide the password, so why do we need to show the \" or \u0027 or even u\u0027, u\" (for unicode), by the way if you\u0027re going with a solution similar to the above i forgot to include a comment near the {{ secret \u003d r\"\\1\" + secret }} to explain what this line is for so please add it.","commit_id":"24359c8483d5608ccc3cbd6d90d4d2502174e832"},{"author":{"_account_id":6526,"name":"David Geng","email":"gengjh@cn.ibm.com","username":"genggjh"},"change_message_id":"7cf62bb6e8ee8799e918b89533bc4f8f86cea733","unresolved":false,"context_lines":[{"line_number":285,"context_line":"    if is_unicode:"},{"line_number":286,"context_line":"        text \u003d unicode(message)"},{"line_number":287,"context_line":"    else:"},{"line_number":288,"context_line":"        text \u003d message"},{"line_number":289,"context_line":"    result \u003d re.sub(r\"(\u0027*password\u0027\\s*:\\s*u?\u0027).+?\u0027\","},{"line_number":290,"context_line":"                    lambda m: m.group(1) + \"***\u0027\","},{"line_number":291,"context_line":"                    text)"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAOn%2F%2F7DA%3D","line":288,"in_reply_to":"AAAAOn%2F%2F7OQ%3D","updated":"2013-04-11 14:22:50.000000000","message":"If do it like your example, the quote will be replaced, like this:\n\u0027\"password\" : \"aaaaa\" \u003d\u003e \"password\" : ***\u0027\n\nmouad, do you have any solution for this?","commit_id":"24359c8483d5608ccc3cbd6d90d4d2502174e832"},{"author":{"_account_id":7073,"name":"mouad benchchaoui","email":"m.benchchaoui@x-ion.de","username":"mouad"},"change_message_id":"506d69ea2be257dacc3f7a4e89b50612170271fd","unresolved":false,"context_lines":[{"line_number":289,"context_line":"    result \u003d re.sub(r\"(\u0027*password\u0027\\s*:\\s*u?\u0027).+?\u0027\","},{"line_number":290,"context_line":"                    lambda m: m.group(1) + \"***\u0027\","},{"line_number":291,"context_line":"                    text)"},{"line_number":292,"context_line":"    # In order to reduce the complex of regular expression substitution"},{"line_number":293,"context_line":"    # try to scan the the password property with double quotes again"},{"line_number":294,"context_line":"    if result \u003d\u003d text:"},{"line_number":295,"context_line":"        result \u003d re.sub(r\u0027(\"*password\"\\s*:\\s*u?\").+?\"\u0027,"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAOn%2F%2F7OM%3D","line":292,"updated":"2013-04-11 10:00:30.000000000","message":"Typo: Two \"the\".","commit_id":"24359c8483d5608ccc3cbd6d90d4d2502174e832"},{"author":{"_account_id":7073,"name":"mouad benchchaoui","email":"m.benchchaoui@x-ion.de","username":"mouad"},"change_message_id":"506d69ea2be257dacc3f7a4e89b50612170271fd","unresolved":false,"context_lines":[{"line_number":291,"context_line":"                    text)"},{"line_number":292,"context_line":"    # In order to reduce the complex of regular expression substitution"},{"line_number":293,"context_line":"    # try to scan the the password property with double quotes again"},{"line_number":294,"context_line":"    if result \u003d\u003d text:"},{"line_number":295,"context_line":"        result \u003d re.sub(r\u0027(\"*password\"\\s*:\\s*u?\").+?\"\u0027,"},{"line_number":296,"context_line":"                        lambda m: m.group(1) + \u0027***\"\u0027,"},{"line_number":297,"context_line":"                        text)"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAOn%2F%2F7OI%3D","line":294,"updated":"2013-04-11 10:00:30.000000000","message":"A compiled Regex is better performance wise.","commit_id":"24359c8483d5608ccc3cbd6d90d4d2502174e832"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"fd269d1b908c13baa9996a6e5fe4c655d675c14d","unresolved":false,"context_lines":[{"line_number":271,"context_line":"        return result"},{"line_number":272,"context_line":""},{"line_number":273,"context_line":""},{"line_number":274,"context_line":"_RE_PASS_1 \u003d re.compile(r\"(\u0027*password\u0027\\s*:\\s*)u?\u0027.+?\u0027\", re.DOTALL)"},{"line_number":275,"context_line":"_RE_PASS_2 \u003d re.compile(r\u0027(\"*password\"\\s*:\\s*)u?\".+?\"\u0027, re.DOTALL)"},{"line_number":276,"context_line":""},{"line_number":277,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAOn%2F%2F5Ik%3D","line":274,"updated":"2013-04-12 17:57:10.000000000","message":"why \u0027* in the regex? this means there can be 0 or more \u0027, so could have \u0027\u0027\u0027password. was this supposed to be \u0027.*??","commit_id":"079d37182d89d67a5af1bf6e9971add526337f73"},{"author":{"_account_id":6526,"name":"David Geng","email":"gengjh@cn.ibm.com","username":"genggjh"},"change_message_id":"6d67fd17ef5fc9127c7fa513f4d3371580420ec3","unresolved":false,"context_lines":[{"line_number":271,"context_line":"        return result"},{"line_number":272,"context_line":""},{"line_number":273,"context_line":""},{"line_number":274,"context_line":"_RE_PASS_1 \u003d re.compile(r\"(\u0027*password\u0027\\s*:\\s*)u?\u0027.+?\u0027\", re.DOTALL)"},{"line_number":275,"context_line":"_RE_PASS_2 \u003d re.compile(r\u0027(\"*password\"\\s*:\\s*)u?\".+?\"\u0027, re.DOTALL)"},{"line_number":276,"context_line":""},{"line_number":277,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAOn%2F%2F4q8%3D","line":274,"in_reply_to":"AAAAOn%2F%2F5Ik%3D","updated":"2013-04-13 08:28:38.000000000","message":"Done","commit_id":"079d37182d89d67a5af1bf6e9971add526337f73"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"fd269d1b908c13baa9996a6e5fe4c655d675c14d","unresolved":false,"context_lines":[{"line_number":275,"context_line":"_RE_PASS_2 \u003d re.compile(r\u0027(\"*password\"\\s*:\\s*)u?\".+?\"\u0027, re.DOTALL)"},{"line_number":276,"context_line":""},{"line_number":277,"context_line":""},{"line_number":278,"context_line":"def mask_password(message, is_unicode\u003dFalse, secret\u003d\"***\"):"},{"line_number":279,"context_line":"    \"\"\"Replace password with \u0027secret\u0027 in message."},{"line_number":280,"context_line":""},{"line_number":281,"context_line":"    :param message: The string which include security information."}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAOn%2F%2F5H8%3D","line":278,"updated":"2013-04-12 17:57:10.000000000","message":"(nit) since this function is only called from wsgi.py, suggest move it to wsgi.py.","commit_id":"079d37182d89d67a5af1bf6e9971add526337f73"},{"author":{"_account_id":6526,"name":"David Geng","email":"gengjh@cn.ibm.com","username":"genggjh"},"change_message_id":"6d67fd17ef5fc9127c7fa513f4d3371580420ec3","unresolved":false,"context_lines":[{"line_number":275,"context_line":"_RE_PASS_2 \u003d re.compile(r\u0027(\"*password\"\\s*:\\s*)u?\".+?\"\u0027, re.DOTALL)"},{"line_number":276,"context_line":""},{"line_number":277,"context_line":""},{"line_number":278,"context_line":"def mask_password(message, is_unicode\u003dFalse, secret\u003d\"***\"):"},{"line_number":279,"context_line":"    \"\"\"Replace password with \u0027secret\u0027 in message."},{"line_number":280,"context_line":""},{"line_number":281,"context_line":"    :param message: The string which include security information."}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAOn%2F%2F4q4%3D","line":278,"in_reply_to":"AAAAOn%2F%2F5H8%3D","updated":"2013-04-13 08:28:38.000000000","message":"Done","commit_id":"079d37182d89d67a5af1bf6e9971add526337f73"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"fd269d1b908c13baa9996a6e5fe4c655d675c14d","unresolved":false,"context_lines":[{"line_number":297,"context_line":"    secret \u003d r\"\\g\u003c1\u003e\" + secret"},{"line_number":298,"context_line":"    result \u003d _RE_PASS_1.sub(secret, message)"},{"line_number":299,"context_line":"    # In order to reduce the complex of regular expression substitution"},{"line_number":300,"context_line":"    # try to scan the password property with double quotes again."},{"line_number":301,"context_line":"    if result \u003d\u003d message:"},{"line_number":302,"context_line":"        result \u003d _RE_PASS_2.sub(secret, message)"},{"line_number":303,"context_line":"    return result"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAOn%2F%2F5IQ%3D","line":300,"updated":"2013-04-12 17:57:10.000000000","message":"change \"scan the password property with double quotes again.\"\nto \"scan for the password property again with double quotes.\"","commit_id":"079d37182d89d67a5af1bf6e9971add526337f73"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"fd269d1b908c13baa9996a6e5fe4c655d675c14d","unresolved":false,"context_lines":[{"line_number":298,"context_line":"    result \u003d _RE_PASS_1.sub(secret, message)"},{"line_number":299,"context_line":"    # In order to reduce the complex of regular expression substitution"},{"line_number":300,"context_line":"    # try to scan the password property with double quotes again."},{"line_number":301,"context_line":"    if result \u003d\u003d message:"},{"line_number":302,"context_line":"        result \u003d _RE_PASS_2.sub(secret, message)"},{"line_number":303,"context_line":"    return result"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAOn%2F%2F5IU%3D","line":301,"updated":"2013-04-12 17:57:10.000000000","message":"suggest don\u0027t do this compare. I don\u0027t think it\u0027s going to improve performance, since comparing the strings is going to have to walk through every character, so suggest skip the check and just do the regex sub all the time.","commit_id":"079d37182d89d67a5af1bf6e9971add526337f73"},{"author":{"_account_id":6526,"name":"David Geng","email":"gengjh@cn.ibm.com","username":"genggjh"},"change_message_id":"6d67fd17ef5fc9127c7fa513f4d3371580420ec3","unresolved":false,"context_lines":[{"line_number":298,"context_line":"    result \u003d _RE_PASS_1.sub(secret, message)"},{"line_number":299,"context_line":"    # In order to reduce the complex of regular expression substitution"},{"line_number":300,"context_line":"    # try to scan the password property with double quotes again."},{"line_number":301,"context_line":"    if result \u003d\u003d message:"},{"line_number":302,"context_line":"        result \u003d _RE_PASS_2.sub(secret, message)"},{"line_number":303,"context_line":"    return result"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAOn%2F%2F4q0%3D","line":301,"in_reply_to":"AAAAOn%2F%2F5IU%3D","updated":"2013-04-13 08:28:38.000000000","message":"Will merge the regex into one","commit_id":"079d37182d89d67a5af1bf6e9971add526337f73"}],"keystone/common/wsgi.py":[{"author":{"_account_id":4,"name":"Dolph Mathews","email":"dolph.mathews@gmail.com","username":"dolph"},"change_message_id":"1dabd969f266da4ac60406c3000b5eaa9856aaf4","unresolved":false,"context_lines":[{"line_number":382,"context_line":"    def __call__(self, req):"},{"line_number":383,"context_line":"        LOG.debug(\u0027%s %s %s\u0027, (\u0027*\u0027 * 20), \u0027REQUEST ENVIRON\u0027, (\u0027*\u0027 * 20))"},{"line_number":384,"context_line":"        for key, value in req.environ.items():"},{"line_number":385,"context_line":"            text \u003d re.sub(r\"\u0027password\u0027: u?\u0027.+?\u0027\", \"\u0027password\u0027: \u0027***\u0027\","},{"line_number":386,"context_line":"                          str(value))"},{"line_number":387,"context_line":"            LOG.debug(\u0027%s \u003d %s\u0027, key, text)"},{"line_number":388,"context_line":"        LOG.debug(\u0027\u0027)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAOn%2F%2F%2BOc%3D","line":385,"updated":"2013-04-09 16:25:38.000000000","message":"the keystone.contrib.user_crud module specifies as password as \u0027original_password\u0027 -- maybe just remove the initial single quote so it will match both?","commit_id":"3c30e65f9479c358bdf534ef473d11e469865396"},{"author":{"_account_id":6526,"name":"David Geng","email":"gengjh@cn.ibm.com","username":"genggjh"},"change_message_id":"76493a2bdbb5e8715da26d998a9ca32b9a796612","unresolved":false,"context_lines":[{"line_number":382,"context_line":"    def __call__(self, req):"},{"line_number":383,"context_line":"        LOG.debug(\u0027%s %s %s\u0027, (\u0027*\u0027 * 20), \u0027REQUEST ENVIRON\u0027, (\u0027*\u0027 * 20))"},{"line_number":384,"context_line":"        for key, value in req.environ.items():"},{"line_number":385,"context_line":"            text \u003d re.sub(r\"\u0027password\u0027: u?\u0027.+?\u0027\", \"\u0027password\u0027: \u0027***\u0027\","},{"line_number":386,"context_line":"                          str(value))"},{"line_number":387,"context_line":"            LOG.debug(\u0027%s \u003d %s\u0027, key, text)"},{"line_number":388,"context_line":"        LOG.debug(\u0027\u0027)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAOn%2F%2F9O4%3D","line":385,"in_reply_to":"AAAAOn%2F%2F%2BOc%3D","updated":"2013-04-10 09:26:04.000000000","message":"Done","commit_id":"3c30e65f9479c358bdf534ef473d11e469865396"},{"author":{"_account_id":4,"name":"Dolph Mathews","email":"dolph.mathews@gmail.com","username":"dolph"},"change_message_id":"1dabd969f266da4ac60406c3000b5eaa9856aaf4","unresolved":false,"context_lines":[{"line_number":383,"context_line":"        LOG.debug(\u0027%s %s %s\u0027, (\u0027*\u0027 * 20), \u0027REQUEST ENVIRON\u0027, (\u0027*\u0027 * 20))"},{"line_number":384,"context_line":"        for key, value in req.environ.items():"},{"line_number":385,"context_line":"            text \u003d re.sub(r\"\u0027password\u0027: u?\u0027.+?\u0027\", \"\u0027password\u0027: \u0027***\u0027\","},{"line_number":386,"context_line":"                          str(value))"},{"line_number":387,"context_line":"            LOG.debug(\u0027%s \u003d %s\u0027, key, text)"},{"line_number":388,"context_line":"        LOG.debug(\u0027\u0027)"},{"line_number":389,"context_line":"        LOG.debug(\u0027%s %s %s\u0027, (\u0027*\u0027 * 20), \u0027REQUEST BODY\u0027, (\u0027*\u0027 * 20))"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAOn%2F%2F%2BOU%3D","line":386,"updated":"2013-04-09 16:25:38.000000000","message":"coercing unicode to a string here is just broken","commit_id":"3c30e65f9479c358bdf534ef473d11e469865396"},{"author":{"_account_id":6526,"name":"David Geng","email":"gengjh@cn.ibm.com","username":"genggjh"},"change_message_id":"76493a2bdbb5e8715da26d998a9ca32b9a796612","unresolved":false,"context_lines":[{"line_number":383,"context_line":"        LOG.debug(\u0027%s %s %s\u0027, (\u0027*\u0027 * 20), \u0027REQUEST ENVIRON\u0027, (\u0027*\u0027 * 20))"},{"line_number":384,"context_line":"        for key, value in req.environ.items():"},{"line_number":385,"context_line":"            text \u003d re.sub(r\"\u0027password\u0027: u?\u0027.+?\u0027\", \"\u0027password\u0027: \u0027***\u0027\","},{"line_number":386,"context_line":"                          str(value))"},{"line_number":387,"context_line":"            LOG.debug(\u0027%s \u003d %s\u0027, key, text)"},{"line_number":388,"context_line":"        LOG.debug(\u0027\u0027)"},{"line_number":389,"context_line":"        LOG.debug(\u0027%s %s %s\u0027, (\u0027*\u0027 * 20), \u0027REQUEST BODY\u0027, (\u0027*\u0027 * 20))"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAOn%2F%2F9O0%3D","line":386,"in_reply_to":"AAAAOn%2F%2F%2BOU%3D","updated":"2013-04-10 09:26:04.000000000","message":"Done","commit_id":"3c30e65f9479c358bdf534ef473d11e469865396"},{"author":{"_account_id":4992,"name":"malini-k-bhandaru","email":"malini.k.bhandaru@intel.com","username":"malini-k-bhandaru"},"change_message_id":"a726ed9627e018657f0e02b9187dc406790701e8","unresolved":false,"context_lines":[{"line_number":383,"context_line":"        LOG.debug(\u0027%s %s %s\u0027, (\u0027*\u0027 * 20), \u0027REQUEST ENVIRON\u0027, (\u0027*\u0027 * 20))"},{"line_number":384,"context_line":"        for key, value in req.environ.items():"},{"line_number":385,"context_line":"            text \u003d re.sub(r\"\u0027password\u0027: u?\u0027.+?\u0027\", \"\u0027password\u0027: \u0027***\u0027\","},{"line_number":386,"context_line":"                          str(value))"},{"line_number":387,"context_line":"            LOG.debug(\u0027%s \u003d %s\u0027, key, text)"},{"line_number":388,"context_line":"        LOG.debug(\u0027\u0027)"},{"line_number":389,"context_line":"        LOG.debug(\u0027%s %s %s\u0027, (\u0027*\u0027 * 20), \u0027REQUEST BODY\u0027, (\u0027*\u0027 * 20))"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAOn%2F%2F%2BMQ%3D","line":386,"in_reply_to":"AAAAOn%2F%2F%2BOU%3D","updated":"2013-04-09 16:48:55.000000000","message":"Good catch Dolph! This prompts an upstream question .. why are we ever constructing a request body with password in plain text? Routinely substituing password with some fixed length character string is more secure, not just for the log files.","commit_id":"3c30e65f9479c358bdf534ef473d11e469865396"},{"author":{"_account_id":6526,"name":"David Geng","email":"gengjh@cn.ibm.com","username":"genggjh"},"change_message_id":"3754678355d53264ff0d154b09aa568718c5e3bc","unresolved":false,"context_lines":[{"line_number":384,"context_line":"        for key, value in req.environ.items():"},{"line_number":385,"context_line":"            text \u003d re.sub(r\"(\u0027*password\u0027: u?\u0027)(.+?)\u0027\","},{"line_number":386,"context_line":"                          lambda m:m.group(1) + \u0027*\u0027 * len(m.group(2)) + \"\u0027\","},{"line_number":387,"context_line":"                          unicode(value))"},{"line_number":388,"context_line":"            LOG.debug(\u0027%s \u003d %s\u0027, key, text)"},{"line_number":389,"context_line":"        LOG.debug(\u0027\u0027)"},{"line_number":390,"context_line":"        LOG.debug(\u0027%s %s %s\u0027, (\u0027*\u0027 * 20), \u0027REQUEST BODY\u0027, (\u0027*\u0027 * 20))"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAOn%2F%2F9Ks%3D","line":387,"updated":"2013-04-10 09:30:10.000000000","message":"I need use this \u0027unicode(value)\u0027 otherwise I will encounter the following error when run test case:\n  File \"/Users/gengjh/MyWorks/OpenStack/keystone/.tox/py27/lib/python2.7/site-packages/keystone/common/wsgi.py\", line 387, in __call__\n    value)\n  File \"/Users/gengjh/MyWorks/OpenStack/keystone/.tox/py27/lib/python2.7/re.py\", line 151, in sub\n    return _compile(pattern, flags).sub(repl, string, count)\nTypeError: expected string or buffer","commit_id":"4ca82e1c2b7bcf9bc3fc95fde17973f852a3fdc7"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"182e8a2820aa8a1c53145f203d85f9c789980a75","unresolved":false,"context_lines":[{"line_number":382,"context_line":"    def __call__(self, req):"},{"line_number":383,"context_line":"        LOG.debug(\u0027%s %s %s\u0027, (\u0027*\u0027 * 20), \u0027REQUEST ENVIRON\u0027, (\u0027*\u0027 * 20))"},{"line_number":384,"context_line":"        for key, value in req.environ.items():"},{"line_number":385,"context_line":"            text \u003d re.sub(r\"(\u0027*password\u0027: u?\u0027).+?\u0027\","},{"line_number":386,"context_line":"                          lambda m: m.group(1) + \"***\u0027\","},{"line_number":387,"context_line":"                          unicode(value))"},{"line_number":388,"context_line":"            LOG.debug(\u0027%s \u003d %s\u0027, key, text)"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAOn%2F%2F8Bk%3D","line":385,"updated":"2013-04-10 20:51:31.000000000","message":"why \u0027*?","commit_id":"670e3df32d7c82cd2d3998f7c1d994637b234cbb"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"182e8a2820aa8a1c53145f203d85f9c789980a75","unresolved":false,"context_lines":[{"line_number":389,"context_line":"        LOG.debug(\u0027\u0027)"},{"line_number":390,"context_line":"        LOG.debug(\u0027%s %s %s\u0027, (\u0027*\u0027 * 20), \u0027REQUEST BODY\u0027, (\u0027*\u0027 * 20))"},{"line_number":391,"context_line":"        for line in req.body_file:"},{"line_number":392,"context_line":"            text \u003d re.sub(r\u0027(\"*password\": \").+?\"\u0027,"},{"line_number":393,"context_line":"                          lambda m: m.group(1) + \u0027***\"\u0027,"},{"line_number":394,"context_line":"                          line)"},{"line_number":395,"context_line":"            LOG.debug(text)"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAOn%2F%2F8BI%3D","line":392,"updated":"2013-04-10 20:51:31.000000000","message":"why \"*?\n\nalso, this doesn\u0027t handle all possible valid JSON inputs, since you can have whitespace after the key and before the :. Note that the value could be on a separate line, too.\n\nfor performance, would be better to only do this if debug logging was enabled.","commit_id":"670e3df32d7c82cd2d3998f7c1d994637b234cbb"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"fd269d1b908c13baa9996a6e5fe4c655d675c14d","unresolved":false,"context_lines":[{"line_number":25,"context_line":""},{"line_number":26,"context_line":"import eventlet.wsgi"},{"line_number":27,"context_line":"import routes.middleware"},{"line_number":28,"context_line":"import re"},{"line_number":29,"context_line":"import ssl"},{"line_number":30,"context_line":"import webob.dec"},{"line_number":31,"context_line":"import webob.exc"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAOn%2F%2F5Hk%3D","line":28,"updated":"2013-04-12 17:57:10.000000000","message":"move this up with the rest of the standard library imports, to line 22. see https://github.com/openstack/keystone/blame/master/HACKING.rst#L69","commit_id":"079d37182d89d67a5af1bf6e9971add526337f73"},{"author":{"_account_id":6526,"name":"David Geng","email":"gengjh@cn.ibm.com","username":"genggjh"},"change_message_id":"6d67fd17ef5fc9127c7fa513f4d3371580420ec3","unresolved":false,"context_lines":[{"line_number":25,"context_line":""},{"line_number":26,"context_line":"import eventlet.wsgi"},{"line_number":27,"context_line":"import routes.middleware"},{"line_number":28,"context_line":"import re"},{"line_number":29,"context_line":"import ssl"},{"line_number":30,"context_line":"import webob.dec"},{"line_number":31,"context_line":"import webob.exc"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAOn%2F%2F4rA%3D","line":28,"in_reply_to":"AAAAOn%2F%2F5Hk%3D","updated":"2013-04-13 08:28:38.000000000","message":"Done","commit_id":"079d37182d89d67a5af1bf6e9971add526337f73"},{"author":{"_account_id":7291,"name":"Malcolm Anderson","email":"dufm1958@gmail.com"},"change_message_id":"262247bcd25d425bb260f0c707e82636d5a44fc3","unresolved":false,"context_lines":[{"line_number":400,"context_line":"            for line in req.body_file:"},{"line_number":401,"context_line":"                LOG.debug(mask_password(line))"},{"line_number":402,"context_line":"            LOG.debug(\u0027\u0027)"},{"line_number":403,"context_line":""},{"line_number":404,"context_line":"            LOG.debug(\u0027%s %s %s\u0027, (\u0027*\u0027 * 20), \u0027RESPONSE HEADERS\u0027, (\u0027*\u0027 * 20))"},{"line_number":405,"context_line":"            for (key, value) in resp.headers.iteritems():"},{"line_number":406,"context_line":"                LOG.debug(\u0027%s \u003d %s\u0027, key, value)"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAOn%2F%2F3sI%3D","line":403,"updated":"2013-04-16 06:20:51.000000000","message":"This would be skipped if resp \u003d req.get_response(self.application) throws exception.","commit_id":"feaa258e3bf292769adab76d805aa373040f56ec"},{"author":{"_account_id":6526,"name":"David Geng","email":"gengjh@cn.ibm.com","username":"genggjh"},"change_message_id":"a2e6d5df13ff322435692a2042a36f4731930bb4","unresolved":false,"context_lines":[{"line_number":400,"context_line":"            for line in req.body_file:"},{"line_number":401,"context_line":"                LOG.debug(mask_password(line))"},{"line_number":402,"context_line":"            LOG.debug(\u0027\u0027)"},{"line_number":403,"context_line":""},{"line_number":404,"context_line":"            LOG.debug(\u0027%s %s %s\u0027, (\u0027*\u0027 * 20), \u0027RESPONSE HEADERS\u0027, (\u0027*\u0027 * 20))"},{"line_number":405,"context_line":"            for (key, value) in resp.headers.iteritems():"},{"line_number":406,"context_line":"                LOG.debug(\u0027%s \u003d %s\u0027, key, value)"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAOn%2F%2F3jY%3D","line":403,"in_reply_to":"AAAAOn%2F%2F3kg%3D","updated":"2013-04-16 12:58:41.000000000","message":"Done","commit_id":"feaa258e3bf292769adab76d805aa373040f56ec"},{"author":{"_account_id":7291,"name":"Malcolm Anderson","email":"dufm1958@gmail.com"},"change_message_id":"b5c0219ed4236f52758edbbeca6232afa5f5d81e","unresolved":false,"context_lines":[{"line_number":400,"context_line":"            for line in req.body_file:"},{"line_number":401,"context_line":"                LOG.debug(mask_password(line))"},{"line_number":402,"context_line":"            LOG.debug(\u0027\u0027)"},{"line_number":403,"context_line":""},{"line_number":404,"context_line":"            LOG.debug(\u0027%s %s %s\u0027, (\u0027*\u0027 * 20), \u0027RESPONSE HEADERS\u0027, (\u0027*\u0027 * 20))"},{"line_number":405,"context_line":"            for (key, value) in resp.headers.iteritems():"},{"line_number":406,"context_line":"                LOG.debug(\u0027%s \u003d %s\u0027, key, value)"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAOn%2F%2F3kg%3D","line":403,"in_reply_to":"AAAAOn%2F%2F3rg%3D","updated":"2013-04-16 11:50:41.000000000","message":"LOG.debug(\u0027%s %s %s\u0027, (\u0027*\u0027 * 20), \u0027REQUEST ENVIRON\u0027, (\u0027*\u0027 * 20))\t\t\n\t393\t        for key, value in req.environ.items():\t\t\n\t394\t            LOG.debug(\u0027%s \u003d %s\u0027, key, value)\t\t\n\t395\t        LOG.debug(\u0027\u0027)\t\t\n\t396\t        LOG.debug(\u0027%s %s %s\u0027, (\u0027*\u0027 * 20), \u0027REQUEST BODY\u0027, (\u0027*\u0027 * 20))\t\t\n\t397\t        for line in req.body_file:\t\t\n\t398\t            LOG.debug(line)\t\t\n\t399\t        LOG.debug(\u0027\u0027)\n\nThis was in front of req.get_response(self.application). Even if exceptions are somehow thrown from inside req.get_response(self.application), the debug log will gets printed.\n\nBTW, you also changed the order of log entries. Whatever printed in req.get_response(self.application) will now goes before.","commit_id":"feaa258e3bf292769adab76d805aa373040f56ec"},{"author":{"_account_id":6526,"name":"David Geng","email":"gengjh@cn.ibm.com","username":"genggjh"},"change_message_id":"2951b83df303f3c19a2fb69ae5452e60de3e507c","unresolved":false,"context_lines":[{"line_number":400,"context_line":"            for line in req.body_file:"},{"line_number":401,"context_line":"                LOG.debug(mask_password(line))"},{"line_number":402,"context_line":"            LOG.debug(\u0027\u0027)"},{"line_number":403,"context_line":""},{"line_number":404,"context_line":"            LOG.debug(\u0027%s %s %s\u0027, (\u0027*\u0027 * 20), \u0027RESPONSE HEADERS\u0027, (\u0027*\u0027 * 20))"},{"line_number":405,"context_line":"            for (key, value) in resp.headers.iteritems():"},{"line_number":406,"context_line":"                LOG.debug(\u0027%s \u003d %s\u0027, key, value)"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAOn%2F%2F3rg%3D","line":403,"in_reply_to":"AAAAOn%2F%2F3sI%3D","updated":"2013-04-16 07:37:38.000000000","message":"What kinds of exception will be thrown? I can not say there was any error handler here before my changes.","commit_id":"feaa258e3bf292769adab76d805aa373040f56ec"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"188a0f54db5e12b41960e3d0025865c4c4b6f41b","unresolved":false,"context_lines":[{"line_number":393,"context_line":"        if LOG.isEnabledFor(logging.DEBUG):"},{"line_number":394,"context_line":"            LOG.debug(\u0027%s %s %s\u0027, (\u0027*\u0027 * 20), \u0027REQUEST ENVIRON\u0027, (\u0027*\u0027 * 20))"},{"line_number":395,"context_line":"            for key, value in req.environ.items():"},{"line_number":396,"context_line":"                LOG.debug(\u0027%s \u003d %s\u0027, key, mask_password(value, True))"},{"line_number":397,"context_line":"            LOG.debug(\u0027\u0027)"},{"line_number":398,"context_line":"            LOG.debug(\u0027%s %s %s\u0027, (\u0027*\u0027 * 20), \u0027REQUEST BODY\u0027, (\u0027*\u0027 * 20))"},{"line_number":399,"context_line":"            for line in req.body_file:"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAOn%2F%2F3jA%3D","line":396,"updated":"2013-04-16 13:05:51.000000000","message":"(nit) use named parameter for named argument, so change \"True\" to \"is_unicode\u003dTrue\".","commit_id":"c9aec264836afa6f77eb4b1976f31dc4cef34b2c"},{"author":{"_account_id":6526,"name":"David Geng","email":"gengjh@cn.ibm.com","username":"genggjh"},"change_message_id":"de3ab89c73fab41db37636cbaf64301a2ff938e6","unresolved":false,"context_lines":[{"line_number":393,"context_line":"        if LOG.isEnabledFor(logging.DEBUG):"},{"line_number":394,"context_line":"            LOG.debug(\u0027%s %s %s\u0027, (\u0027*\u0027 * 20), \u0027REQUEST ENVIRON\u0027, (\u0027*\u0027 * 20))"},{"line_number":395,"context_line":"            for key, value in req.environ.items():"},{"line_number":396,"context_line":"                LOG.debug(\u0027%s \u003d %s\u0027, key, mask_password(value, True))"},{"line_number":397,"context_line":"            LOG.debug(\u0027\u0027)"},{"line_number":398,"context_line":"            LOG.debug(\u0027%s %s %s\u0027, (\u0027*\u0027 * 20), \u0027REQUEST BODY\u0027, (\u0027*\u0027 * 20))"},{"line_number":399,"context_line":"            for line in req.body_file:"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAOn%2F%2F3h8%3D","line":396,"in_reply_to":"AAAAOn%2F%2F3jA%3D","updated":"2013-04-16 13:18:55.000000000","message":"Done","commit_id":"c9aec264836afa6f77eb4b1976f31dc4cef34b2c"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"188a0f54db5e12b41960e3d0025865c4c4b6f41b","unresolved":false,"context_lines":[{"line_number":401,"context_line":"            LOG.debug(\u0027\u0027)"},{"line_number":402,"context_line":""},{"line_number":403,"context_line":"        resp \u003d req.get_response(self.application)"},{"line_number":404,"context_line":"        if LOG.isEnabledFor(logging.DEBUG):"},{"line_number":405,"context_line":"            LOG.debug(\u0027%s %s %s\u0027, (\u0027*\u0027 * 20), \u0027RESPONSE HEADERS\u0027, (\u0027*\u0027 * 20))"},{"line_number":406,"context_line":"            for (key, value) in resp.headers.iteritems():"},{"line_number":407,"context_line":"                LOG.debug(\u0027%s \u003d %s\u0027, key, value)"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAOn%2F%2F3i8%3D","line":404,"updated":"2013-04-16 13:05:51.000000000","message":"suggest combining the 2 LOG.isEnabledFor(logging.DEBUG) sections, so move the code from 394-401 in here.","commit_id":"c9aec264836afa6f77eb4b1976f31dc4cef34b2c"},{"author":{"_account_id":6526,"name":"David Geng","email":"gengjh@cn.ibm.com","username":"genggjh"},"change_message_id":"de3ab89c73fab41db37636cbaf64301a2ff938e6","unresolved":false,"context_lines":[{"line_number":401,"context_line":"            LOG.debug(\u0027\u0027)"},{"line_number":402,"context_line":""},{"line_number":403,"context_line":"        resp \u003d req.get_response(self.application)"},{"line_number":404,"context_line":"        if LOG.isEnabledFor(logging.DEBUG):"},{"line_number":405,"context_line":"            LOG.debug(\u0027%s %s %s\u0027, (\u0027*\u0027 * 20), \u0027RESPONSE HEADERS\u0027, (\u0027*\u0027 * 20))"},{"line_number":406,"context_line":"            for (key, value) in resp.headers.iteritems():"},{"line_number":407,"context_line":"                LOG.debug(\u0027%s \u003d %s\u0027, key, value)"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAOn%2F%2F3iA%3D","line":404,"in_reply_to":"AAAAOn%2F%2F3i8%3D","updated":"2013-04-16 13:18:55.000000000","message":"Please say the comments from Malcolm in my patch 9. Your comments conflict with Malcolm\u0027s","commit_id":"c9aec264836afa6f77eb4b1976f31dc4cef34b2c"},{"author":{"_account_id":494,"name":"termie","email":"termie@openstack.org","username":"termie"},"change_message_id":"740f5aaff6ac4265ed7066f3860704a725b1bd97","unresolved":false,"context_lines":[{"line_number":589,"context_line":"                      re.DOTALL)"},{"line_number":590,"context_line":""},{"line_number":591,"context_line":""},{"line_number":592,"context_line":"def mask_password(message, is_unicode\u003dFalse, secret\u003d\"***\"):"},{"line_number":593,"context_line":"    \"\"\"Replace password with \u0027secret\u0027 in message."},{"line_number":594,"context_line":""},{"line_number":595,"context_line":"    :param message: The string which include security information."}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAOn%2F%2FwWo%3D","line":592,"updated":"2013-04-24 18:14:01.000000000","message":"please move this function up in the file above the class definitions, same with _RE_PASS above","commit_id":"0dc1ad1e9c47aa7b04b944e88b071ea1a646ae91"}]}
