)]}'
{"keystonemiddleware/auth_token/_cache.py":[{"author":{"_account_id":7725,"name":"David Stanek","email":"dstanek@dstanek.com","username":"dstanek"},"change_message_id":"82d67c3506e7f3edcc3e5484434f3c8733cbb74e","unresolved":false,"context_lines":[{"line_number":23,"context_line":"from keystonemiddleware.openstack.common import memorycache"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"def _hash_key(self, *args):"},{"line_number":27,"context_line":"    \"\"\"Turn a set of arguments into a SHA256 hash."},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"    Using a known-length cache key is important to ensure that memcache"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a016987_61e8b8b3","line":26,"updated":"2015-05-30 12:20:52.000000000","message":"self? I would just have this take a key:str and return the hashed value of it. It seems like you are planning for this to do more elaborate key construction in the future","commit_id":"6d2755a39376aa6e9099f847f1791f58f6b70831"},{"author":{"_account_id":13478,"name":"Boris Bobrov","email":"b.bobrov@sap.com","username":"bbobrov"},"change_message_id":"3ecc03e6fc46722fd8e6af381c528990b96e6bdd","unresolved":false,"context_lines":[{"line_number":23,"context_line":"from keystonemiddleware.openstack.common import memorycache"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"def _hash_key(self, *args):"},{"line_number":27,"context_line":"    \"\"\"Turn a set of arguments into a SHA256 hash."},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"    Using a known-length cache key is important to ensure that memcache"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a016987_03a8ef8a","line":26,"updated":"2015-05-30 00:57:43.000000000","message":"why do you use *args here? A single argument is passed below.","commit_id":"6d2755a39376aa6e9099f847f1791f58f6b70831"},{"author":{"_account_id":2903,"name":"Morgan Fainberg","email":"morgan.fainberg@gmail.com","username":"mdrnstm"},"change_message_id":"c5a41ba527a353d38b6b12f760f92e230f784cff","unresolved":false,"context_lines":[{"line_number":23,"context_line":"from keystonemiddleware.openstack.common import memorycache"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"def _hash_key(self, *args):"},{"line_number":27,"context_line":"    \"\"\"Turn a set of arguments into a SHA256 hash."},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"    Using a known-length cache key is important to ensure that memcache"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a016987_fe89de6f","line":26,"in_reply_to":"7a016987_61e8b8b3","updated":"2015-05-31 20:57:57.000000000","message":"this was a quick pass that I needed to save state. Pushing to gerrit was the quick and dirty way to save the state. I forgot to WIP it.\n\nthis is fixed/should be addressed in patchset 2.","commit_id":"6d2755a39376aa6e9099f847f1791f58f6b70831"},{"author":{"_account_id":7725,"name":"David Stanek","email":"dstanek@dstanek.com","username":"dstanek"},"change_message_id":"82d67c3506e7f3edcc3e5484434f3c8733cbb74e","unresolved":false,"context_lines":[{"line_number":36,"context_line":"                v \u003d v.encode(\u0027utf-8\u0027)"},{"line_number":37,"context_line":"            hasher.update(v)"},{"line_number":38,"context_line":"        return hasher.hexdigest()"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"class _CachePool(list):"},{"line_number":41,"context_line":"    \"\"\"A lazy pool of cache references.\"\"\""},{"line_number":42,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"7a016987_810a9477","line":39,"updated":"2015-05-30 12:20:52.000000000","message":"Maybe an explicit \u0027return None\u0027 so it\u0027s obvious that you meant to do that","commit_id":"6d2755a39376aa6e9099f847f1791f58f6b70831"},{"author":{"_account_id":2903,"name":"Morgan Fainberg","email":"morgan.fainberg@gmail.com","username":"mdrnstm"},"change_message_id":"c5a41ba527a353d38b6b12f760f92e230f784cff","unresolved":false,"context_lines":[{"line_number":36,"context_line":"                v \u003d v.encode(\u0027utf-8\u0027)"},{"line_number":37,"context_line":"            hasher.update(v)"},{"line_number":38,"context_line":"        return hasher.hexdigest()"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"class _CachePool(list):"},{"line_number":41,"context_line":"    \"\"\"A lazy pool of cache references.\"\"\""},{"line_number":42,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"7a016987_deebc211","line":39,"in_reply_to":"7a016987_810a9477","updated":"2015-05-31 20:57:57.000000000","message":"Done","commit_id":"6d2755a39376aa6e9099f847f1791f58f6b70831"},{"author":{"_account_id":13478,"name":"Boris Bobrov","email":"b.bobrov@sap.com","username":"bbobrov"},"change_message_id":"3ecc03e6fc46722fd8e6af381c528990b96e6bdd","unresolved":false,"context_lines":[{"line_number":131,"context_line":"        self._cache_pool \u003d None"},{"line_number":132,"context_line":"        self._initialized \u003d False"},{"line_number":133,"context_line":""},{"line_number":134,"context_line":""},{"line_number":135,"context_line":"    def _get_cache_pool(self, cache, memcache_servers, use_advanced_pool\u003dFalse,"},{"line_number":136,"context_line":"                        memcache_dead_retry\u003dNone, memcache_pool_maxsize\u003dNone,"},{"line_number":137,"context_line":"                        memcache_pool_unused_timeout\u003dNone,"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a016987_03234f59","line":134,"updated":"2015-05-30 00:57:43.000000000","message":"unrelated?","commit_id":"6d2755a39376aa6e9099f847f1791f58f6b70831"},{"author":{"_account_id":7725,"name":"David Stanek","email":"dstanek@dstanek.com","username":"dstanek"},"change_message_id":"82d67c3506e7f3edcc3e5484434f3c8733cbb74e","unresolved":false,"context_lines":[{"line_number":131,"context_line":"        self._cache_pool \u003d None"},{"line_number":132,"context_line":"        self._initialized \u003d False"},{"line_number":133,"context_line":""},{"line_number":134,"context_line":""},{"line_number":135,"context_line":"    def _get_cache_pool(self, cache, memcache_servers, use_advanced_pool\u003dFalse,"},{"line_number":136,"context_line":"                        memcache_dead_retry\u003dNone, memcache_pool_maxsize\u003dNone,"},{"line_number":137,"context_line":"                        memcache_pool_unused_timeout\u003dNone,"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a016987_41d49cea","line":134,"in_reply_to":"7a016987_03234f59","updated":"2015-05-30 12:20:52.000000000","message":"++","commit_id":"6d2755a39376aa6e9099f847f1791f58f6b70831"},{"author":{"_account_id":2903,"name":"Morgan Fainberg","email":"morgan.fainberg@gmail.com","username":"mdrnstm"},"change_message_id":"c5a41ba527a353d38b6b12f760f92e230f784cff","unresolved":false,"context_lines":[{"line_number":131,"context_line":"        self._cache_pool \u003d None"},{"line_number":132,"context_line":"        self._initialized \u003d False"},{"line_number":133,"context_line":""},{"line_number":134,"context_line":""},{"line_number":135,"context_line":"    def _get_cache_pool(self, cache, memcache_servers, use_advanced_pool\u003dFalse,"},{"line_number":136,"context_line":"                        memcache_dead_retry\u003dNone, memcache_pool_maxsize\u003dNone,"},{"line_number":137,"context_line":"                        memcache_pool_unused_timeout\u003dNone,"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a016987_beeec61f","line":134,"in_reply_to":"7a016987_41d49cea","updated":"2015-05-31 20:57:57.000000000","message":"Done","commit_id":"6d2755a39376aa6e9099f847f1791f58f6b70831"},{"author":{"_account_id":7725,"name":"David Stanek","email":"dstanek@dstanek.com","username":"dstanek"},"change_message_id":"82d67c3506e7f3edcc3e5484434f3c8733cbb74e","unresolved":false,"context_lines":[{"line_number":199,"context_line":"        # NOTE(jamielennox): in the basic implementation there is no need for"},{"line_number":200,"context_line":"        # a context so just pass None as it will only get passed back later."},{"line_number":201,"context_line":"        unused_context \u003d None"},{"line_number":202,"context_line":"        hashed_token \u003d _hash_key(token_id)"},{"line_number":203,"context_line":"        return self._CACHE_KEY_TEMPLATE % hashed_token, unused_context"},{"line_number":204,"context_line":""},{"line_number":205,"context_line":"    def _deserialize(self, data, context):"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a016987_41425caf","line":202,"updated":"2015-05-30 12:20:52.000000000","message":"Since you already have a nice, tidy place to create the key you might as well do the hashing inline here.","commit_id":"6d2755a39376aa6e9099f847f1791f58f6b70831"},{"author":{"_account_id":2903,"name":"Morgan Fainberg","email":"morgan.fainberg@gmail.com","username":"mdrnstm"},"change_message_id":"c5a41ba527a353d38b6b12f760f92e230f784cff","unresolved":false,"context_lines":[{"line_number":199,"context_line":"        # NOTE(jamielennox): in the basic implementation there is no need for"},{"line_number":200,"context_line":"        # a context so just pass None as it will only get passed back later."},{"line_number":201,"context_line":"        unused_context \u003d None"},{"line_number":202,"context_line":"        hashed_token \u003d _hash_key(token_id)"},{"line_number":203,"context_line":"        return self._CACHE_KEY_TEMPLATE % hashed_token, unused_context"},{"line_number":204,"context_line":""},{"line_number":205,"context_line":"    def _deserialize(self, data, context):"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a016987_9ef1ca03","line":202,"in_reply_to":"7a016987_41425caf","updated":"2015-05-31 20:57:57.000000000","message":"Done","commit_id":"6d2755a39376aa6e9099f847f1791f58f6b70831"},{"author":{"_account_id":9142,"name":"Samuel de Medeiros Queiroz","email":"samueldmq@lsd.ufcg.edu.br","username":"samuel-z","inactive":true},"change_message_id":"d75fb7732c57d50a001d0166c4c92a3266bc3474","unresolved":false,"context_lines":[{"line_number":23,"context_line":"from keystonemiddleware.openstack.common import memorycache"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"def _hash_key(key):"},{"line_number":27,"context_line":"    \"\"\"Turn a set of arguments into a SHA256 hash."},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"    Using a known-length cache key is important to ensure that memcache"}],"source_content_type":"text/x-python","patch_set":2,"id":"7a016987_94ff6965","line":26,"updated":"2015-06-01 03:37:32.000000000","message":"As this method is only being used by _get_cache_key at TokenCache, why not define it inside that class\u0027 scope ?","commit_id":"f6e308b5078cab52bc1ab452b214e06b5fd9582c"},{"author":{"_account_id":13055,"name":"Alexander Makarov","email":"ajiekcahdp.makapob@gmail.com","username":"amakarov"},"change_message_id":"5fbd3c867f66186283ff3c3a05874ff3cd18d11d","unresolved":false,"context_lines":[{"line_number":23,"context_line":"from keystonemiddleware.openstack.common import memorycache"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"def _hash_key(key):"},{"line_number":27,"context_line":"    \"\"\"Turn a set of arguments into a SHA256 hash."},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"    Using a known-length cache key is important to ensure that memcache"}],"source_content_type":"text/x-python","patch_set":2,"id":"5afe65bd_ce8cf737","line":26,"in_reply_to":"7a016987_695648cf","updated":"2015-06-01 16:51:32.000000000","message":"I agree about personal preference: I don\u0027t like it :) It isn\u0027t worth -1 though.","commit_id":"f6e308b5078cab52bc1ab452b214e06b5fd9582c"},{"author":{"_account_id":9142,"name":"Samuel de Medeiros Queiroz","email":"samueldmq@lsd.ufcg.edu.br","username":"samuel-z","inactive":true},"change_message_id":"df4022d124ec98df8cc0011696c5f7a8807ffedd","unresolved":false,"context_lines":[{"line_number":23,"context_line":"from keystonemiddleware.openstack.common import memorycache"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"def _hash_key(key):"},{"line_number":27,"context_line":"    \"\"\"Turn a set of arguments into a SHA256 hash."},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"    Using a known-length cache key is important to ensure that memcache"}],"source_content_type":"text/x-python","patch_set":2,"id":"7a016987_6c81b6c2","line":26,"in_reply_to":"7a016987_695648cf","updated":"2015-06-01 13:36:44.000000000","message":"This makes sense, thanks for clarifying.","commit_id":"f6e308b5078cab52bc1ab452b214e06b5fd9582c"},{"author":{"_account_id":2903,"name":"Morgan Fainberg","email":"morgan.fainberg@gmail.com","username":"mdrnstm"},"change_message_id":"4d1f9151b682dae119f77d3f3d03faa037eb3d5e","unresolved":false,"context_lines":[{"line_number":23,"context_line":"from keystonemiddleware.openstack.common import memorycache"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"def _hash_key(key):"},{"line_number":27,"context_line":"    \"\"\"Turn a set of arguments into a SHA256 hash."},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"    Using a known-length cache key is important to ensure that memcache"}],"source_content_type":"text/x-python","patch_set":2,"id":"7a016987_695648cf","line":26,"in_reply_to":"7a016987_94ff6965","updated":"2015-06-01 13:04:00.000000000","message":"Because it\u0027s static. It doesn\u0027t need to be carried on the class itself (or used outside of the class). Mostly this is a personal preference, no technical reason.","commit_id":"f6e308b5078cab52bc1ab452b214e06b5fd9582c"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"7ed93f40f0b57c623bdb7a965f1d317b7a101998","unresolved":false,"context_lines":[{"line_number":29,"context_line":"    Using a known-length cache key is important to ensure that memcache"},{"line_number":30,"context_line":"    maximum key length is not exceeded causing failures to validate."},{"line_number":31,"context_line":"    \"\"\""},{"line_number":32,"context_line":"    if key:"},{"line_number":33,"context_line":"        hasher \u003d hashlib.sha256()"},{"line_number":34,"context_line":"        if isinstance(key, six.text_type):"},{"line_number":35,"context_line":"            key \u003d key.encode(\u0027utf-8\u0027)"}],"source_content_type":"text/x-python","patch_set":2,"id":"5afe65bd_e530f609","line":32,"updated":"2015-06-01 15:52:37.000000000","message":"If `key` is required in the method signature, will we ever have a case where we won\u0027t hit this if statement?","commit_id":"f6e308b5078cab52bc1ab452b214e06b5fd9582c"},{"author":{"_account_id":13055,"name":"Alexander Makarov","email":"ajiekcahdp.makapob@gmail.com","username":"amakarov"},"change_message_id":"5fbd3c867f66186283ff3c3a05874ff3cd18d11d","unresolved":false,"context_lines":[{"line_number":30,"context_line":"    maximum key length is not exceeded causing failures to validate."},{"line_number":31,"context_line":"    \"\"\""},{"line_number":32,"context_line":"    if key:"},{"line_number":33,"context_line":"        hasher \u003d hashlib.sha256()"},{"line_number":34,"context_line":"        if isinstance(key, six.text_type):"},{"line_number":35,"context_line":"            key \u003d key.encode(\u0027utf-8\u0027)"},{"line_number":36,"context_line":"        hasher.update(key)"}],"source_content_type":"text/x-python","patch_set":2,"id":"5afe65bd_2ef26b9b","line":33,"updated":"2015-06-01 16:51:32.000000000","message":"Can we avoid hashing keys shorter than 33? It looks useless to me...","commit_id":"f6e308b5078cab52bc1ab452b214e06b5fd9582c"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"1273a63be26183dd587f6effeedb65d880744abe","unresolved":false,"context_lines":[{"line_number":30,"context_line":"    maximum key length is not exceeded causing failures to validate."},{"line_number":31,"context_line":"    \"\"\""},{"line_number":32,"context_line":"    if key:"},{"line_number":33,"context_line":"        hasher \u003d hashlib.sha256()"},{"line_number":34,"context_line":"        if isinstance(key, six.text_type):"},{"line_number":35,"context_line":"            key \u003d key.encode(\u0027utf-8\u0027)"},{"line_number":36,"context_line":"        hasher.update(key)"}],"source_content_type":"text/x-python","patch_set":2,"id":"5afe65bd_5dad5687","line":33,"updated":"2015-06-01 21:41:20.000000000","message":"suggestion for a follow-on patch - it would be great if the hash was configurable in case some standard decides they don\u0027t like sha256 anymore.","commit_id":"f6e308b5078cab52bc1ab452b214e06b5fd9582c"},{"author":{"_account_id":2903,"name":"Morgan Fainberg","email":"morgan.fainberg@gmail.com","username":"mdrnstm"},"change_message_id":"b7825b945fb7866b6295539ec312a3a113c52b7b","unresolved":false,"context_lines":[{"line_number":30,"context_line":"    maximum key length is not exceeded causing failures to validate."},{"line_number":31,"context_line":"    \"\"\""},{"line_number":32,"context_line":"    if key:"},{"line_number":33,"context_line":"        hasher \u003d hashlib.sha256()"},{"line_number":34,"context_line":"        if isinstance(key, six.text_type):"},{"line_number":35,"context_line":"            key \u003d key.encode(\u0027utf-8\u0027)"},{"line_number":36,"context_line":"        hasher.update(key)"}],"source_content_type":"text/x-python","patch_set":2,"id":"5afe65bd_d90963df","line":33,"in_reply_to":"5afe65bd_2ef26b9b","updated":"2015-06-01 17:11:27.000000000","message":"I\u0027d prefer to treat all the keys the same, it simplifies maintenance and understanding of the code. It also allows for a clear view on the backend if you need to look into the memcache store outside of keystone. needing to know that certain length keys are handled in a totally different way makes things much more complex.","commit_id":"f6e308b5078cab52bc1ab452b214e06b5fd9582c"},{"author":{"_account_id":9142,"name":"Samuel de Medeiros Queiroz","email":"samueldmq@lsd.ufcg.edu.br","username":"samuel-z","inactive":true},"change_message_id":"7e8ad03b9bd48787ac1d3ce2a047ed1313a4517b","unresolved":false,"context_lines":[{"line_number":30,"context_line":"    maximum key length is not exceeded causing failures to validate."},{"line_number":31,"context_line":"    \"\"\""},{"line_number":32,"context_line":"    if key:"},{"line_number":33,"context_line":"        hasher \u003d hashlib.sha256()"},{"line_number":34,"context_line":"        if isinstance(key, six.text_type):"},{"line_number":35,"context_line":"            key \u003d key.encode(\u0027utf-8\u0027)"},{"line_number":36,"context_line":"        hasher.update(key)"}],"source_content_type":"text/x-python","patch_set":2,"id":"5afe65bd_591d730e","line":33,"in_reply_to":"5afe65bd_2ef26b9b","updated":"2015-06-01 17:12:24.000000000","message":"Why 33 ? Memcached current limit of a key is 250 characters. [1]\n\nWhy is it useless ? Because we didn\u0027t necessarily need to hash them ? Maybe keeping consistency is a benefit ?\n\n[1] https://github.com/memcached/memcached/blob/master/doc/protocol.txt#L41-L49","commit_id":"f6e308b5078cab52bc1ab452b214e06b5fd9582c"},{"author":{"_account_id":9142,"name":"Samuel de Medeiros Queiroz","email":"samueldmq@lsd.ufcg.edu.br","username":"samuel-z","inactive":true},"change_message_id":"01fd71b82b1db5cf26e79f1bfe43caea8a7bcdcb","unresolved":false,"context_lines":[{"line_number":30,"context_line":"    maximum key length is not exceeded causing failures to validate."},{"line_number":31,"context_line":"    \"\"\""},{"line_number":32,"context_line":"    if key:"},{"line_number":33,"context_line":"        hasher \u003d hashlib.sha256()"},{"line_number":34,"context_line":"        if isinstance(key, six.text_type):"},{"line_number":35,"context_line":"            key \u003d key.encode(\u0027utf-8\u0027)"},{"line_number":36,"context_line":"        hasher.update(key)"}],"source_content_type":"text/x-python","patch_set":2,"id":"5afe65bd_228f1725","line":33,"in_reply_to":"5afe65bd_3a5505c6","updated":"2015-06-01 20:56:12.000000000","message":"I was just saying that, if we went to that logic, we could only hash if they\u0027re \u003e 250,  which is the limit. (See my comment on the added test).\n\nSo even if it\u0027s not uuid but is \u003c 250, we could keep then as they are. But I agree all should be hashed, for consistency.","commit_id":"f6e308b5078cab52bc1ab452b214e06b5fd9582c"},{"author":{"_account_id":2903,"name":"Morgan Fainberg","email":"morgan.fainberg@gmail.com","username":"mdrnstm"},"change_message_id":"f5e6a5e3bf26e0355adce0a09a1db2950b603cbd","unresolved":false,"context_lines":[{"line_number":30,"context_line":"    maximum key length is not exceeded causing failures to validate."},{"line_number":31,"context_line":"    \"\"\""},{"line_number":32,"context_line":"    if key:"},{"line_number":33,"context_line":"        hasher \u003d hashlib.sha256()"},{"line_number":34,"context_line":"        if isinstance(key, six.text_type):"},{"line_number":35,"context_line":"            key \u003d key.encode(\u0027utf-8\u0027)"},{"line_number":36,"context_line":"        hasher.update(key)"}],"source_content_type":"text/x-python","patch_set":2,"id":"5afe65bd_3a5505c6","line":33,"in_reply_to":"5afe65bd_591d730e","updated":"2015-06-01 18:22:37.000000000","message":"32 characters is a uuid.uuid4().hex, so \u003e 33.","commit_id":"f6e308b5078cab52bc1ab452b214e06b5fd9582c"},{"author":{"_account_id":7191,"name":"Jamie Lennox","email":"jamielennox@gmail.com","username":"jamielennox"},"change_message_id":"31566472e9976935d598596a396d3191f9326c19","unresolved":false,"context_lines":[{"line_number":30,"context_line":"    maximum key length is not exceeded causing failures to validate."},{"line_number":31,"context_line":"    \"\"\""},{"line_number":32,"context_line":"    if key:"},{"line_number":33,"context_line":"        hasher \u003d hashlib.sha256()"},{"line_number":34,"context_line":"        if isinstance(key, six.text_type):"},{"line_number":35,"context_line":"            key \u003d key.encode(\u0027utf-8\u0027)"},{"line_number":36,"context_line":"        hasher.update(key)"}],"source_content_type":"text/x-python","patch_set":2,"id":"5afe65bd_ef884dc7","line":33,"in_reply_to":"5afe65bd_5dad5687","updated":"2015-06-04 10:24:12.000000000","message":"can we assume that\u0027s a long way off and worry about it then? i don\u0027t see this being a problem for a while and i don\u0027t want to add more options to play with.","commit_id":"f6e308b5078cab52bc1ab452b214e06b5fd9582c"},{"author":{"_account_id":4,"name":"Dolph Mathews","email":"dolph.mathews@gmail.com","username":"dolph"},"change_message_id":"0b178da7949b4284310222ca87328d723bcb42e1","unresolved":false,"context_lines":[{"line_number":30,"context_line":"    maximum key length is not exceeded causing failures to validate."},{"line_number":31,"context_line":"    \"\"\""},{"line_number":32,"context_line":"    if key:"},{"line_number":33,"context_line":"        hasher \u003d hashlib.sha256()"},{"line_number":34,"context_line":"        if isinstance(key, six.text_type):"},{"line_number":35,"context_line":"            key \u003d key.encode(\u0027utf-8\u0027)"},{"line_number":36,"context_line":"        hasher.update(key)"}],"source_content_type":"text/x-python","patch_set":2,"id":"5afe65bd_bf25675d","line":33,"in_reply_to":"5afe65bd_d90963df","updated":"2015-06-01 18:05:25.000000000","message":"+1 for consistency","commit_id":"f6e308b5078cab52bc1ab452b214e06b5fd9582c"},{"author":{"_account_id":13055,"name":"Alexander Makarov","email":"ajiekcahdp.makapob@gmail.com","username":"amakarov"},"change_message_id":"da8d72b2a1e2ecc07d60d21ba76e32470f037316","unresolved":false,"context_lines":[{"line_number":30,"context_line":"    maximum key length is not exceeded causing failures to validate."},{"line_number":31,"context_line":"    \"\"\""},{"line_number":32,"context_line":"    if key:"},{"line_number":33,"context_line":"        hasher \u003d hashlib.sha256()"},{"line_number":34,"context_line":"        if isinstance(key, six.text_type):"},{"line_number":35,"context_line":"            key \u003d key.encode(\u0027utf-8\u0027)"},{"line_number":36,"context_line":"        hasher.update(key)"}],"source_content_type":"text/x-python","patch_set":2,"id":"5afe65bd_f43666b3","line":33,"in_reply_to":"5afe65bd_d90963df","updated":"2015-06-01 17:27:04.000000000","message":"Ok, we trade consistency for performance - got it.","commit_id":"f6e308b5078cab52bc1ab452b214e06b5fd9582c"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"1273a63be26183dd587f6effeedb65d880744abe","unresolved":false,"context_lines":[{"line_number":32,"context_line":"    if key:"},{"line_number":33,"context_line":"        hasher \u003d hashlib.sha256()"},{"line_number":34,"context_line":"        if isinstance(key, six.text_type):"},{"line_number":35,"context_line":"            key \u003d key.encode(\u0027utf-8\u0027)"},{"line_number":36,"context_line":"        hasher.update(key)"},{"line_number":37,"context_line":"        return hasher.hexdigest()"},{"line_number":38,"context_line":"    # If there is no token_id, an explicit None should be expected"}],"source_content_type":"text/x-python","patch_set":2,"id":"5afe65bd_7dc7f245","line":35,"updated":"2015-06-01 21:41:20.000000000","message":"add a comment since this is confusing.","commit_id":"f6e308b5078cab52bc1ab452b214e06b5fd9582c"},{"author":{"_account_id":13478,"name":"Boris Bobrov","email":"b.bobrov@sap.com","username":"bbobrov"},"change_message_id":"2441b88d66400dba89ce31763a93cbdf108d8aac","unresolved":false,"context_lines":[{"line_number":32,"context_line":"    if key:"},{"line_number":33,"context_line":"        hasher \u003d hashlib.sha256()"},{"line_number":34,"context_line":"        if isinstance(key, six.text_type):"},{"line_number":35,"context_line":"            key \u003d key.encode(\u0027utf-8\u0027)"},{"line_number":36,"context_line":"        hasher.update(key)"},{"line_number":37,"context_line":"        return hasher.hexdigest()"},{"line_number":38,"context_line":"    # If there is no token_id, an explicit None should be expected"}],"source_content_type":"text/x-python","patch_set":2,"id":"7a016987_3ee53608","line":35,"updated":"2015-05-31 21:34:57.000000000","message":"what\u0027s this for?","commit_id":"f6e308b5078cab52bc1ab452b214e06b5fd9582c"},{"author":{"_account_id":2903,"name":"Morgan Fainberg","email":"morgan.fainberg@gmail.com","username":"mdrnstm"},"change_message_id":"d1e74026be846173c60f8e5978c5101237ec8438","unresolved":false,"context_lines":[{"line_number":32,"context_line":"    if key:"},{"line_number":33,"context_line":"        hasher \u003d hashlib.sha256()"},{"line_number":34,"context_line":"        if isinstance(key, six.text_type):"},{"line_number":35,"context_line":"            key \u003d key.encode(\u0027utf-8\u0027)"},{"line_number":36,"context_line":"        hasher.update(key)"},{"line_number":37,"context_line":"        return hasher.hexdigest()"},{"line_number":38,"context_line":"    # If there is no token_id, an explicit None should be expected"}],"source_content_type":"text/x-python","patch_set":2,"id":"7a016987_f97698a2","line":35,"in_reply_to":"7a016987_3ee53608","updated":"2015-05-31 23:46:02.000000000","message":"If the token ends up being unicode / non byte_str, you *must* convert to a bytes or hasher will die when you .update()\n\nthis is unicode is a Pain in python thing","commit_id":"f6e308b5078cab52bc1ab452b214e06b5fd9582c"},{"author":{"_account_id":4,"name":"Dolph Mathews","email":"dolph.mathews@gmail.com","username":"dolph"},"change_message_id":"0b178da7949b4284310222ca87328d723bcb42e1","unresolved":false,"context_lines":[{"line_number":34,"context_line":"        if isinstance(key, six.text_type):"},{"line_number":35,"context_line":"            key \u003d key.encode(\u0027utf-8\u0027)"},{"line_number":36,"context_line":"        hasher.update(key)"},{"line_number":37,"context_line":"        return hasher.hexdigest()"},{"line_number":38,"context_line":"    # If there is no token_id, an explicit None should be expected"},{"line_number":39,"context_line":"    return None"},{"line_number":40,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"5afe65bd_dfbee3d3","line":37,"updated":"2015-06-01 18:05:25.000000000","message":"you could do all of this in one line, since there\u0027s no reason to do multiple update() calls\n\n  return hashlib.sha256(key).hexdigest()","commit_id":"f6e308b5078cab52bc1ab452b214e06b5fd9582c"},{"author":{"_account_id":9142,"name":"Samuel de Medeiros Queiroz","email":"samueldmq@lsd.ufcg.edu.br","username":"samuel-z","inactive":true},"change_message_id":"d75fb7732c57d50a001d0166c4c92a3266bc3474","unresolved":false,"context_lines":[{"line_number":35,"context_line":"            key \u003d key.encode(\u0027utf-8\u0027)"},{"line_number":36,"context_line":"        hasher.update(key)"},{"line_number":37,"context_line":"        return hasher.hexdigest()"},{"line_number":38,"context_line":"    # If there is no token_id, an explicit None should be expected"},{"line_number":39,"context_line":"    return None"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"7a016987_74d4edea","line":38,"updated":"2015-06-01 03:37:32.000000000","message":"(nit) s/token_id/key\n\nWe konw about \u0027key\u0027 in this method\u0027s scope, instead of \u0027token_id\u0027.","commit_id":"f6e308b5078cab52bc1ab452b214e06b5fd9582c"},{"author":{"_account_id":4,"name":"Dolph Mathews","email":"dolph.mathews@gmail.com","username":"dolph"},"change_message_id":"0b178da7949b4284310222ca87328d723bcb42e1","unresolved":false,"context_lines":[{"line_number":35,"context_line":"            key \u003d key.encode(\u0027utf-8\u0027)"},{"line_number":36,"context_line":"        hasher.update(key)"},{"line_number":37,"context_line":"        return hasher.hexdigest()"},{"line_number":38,"context_line":"    # If there is no token_id, an explicit None should be expected"},{"line_number":39,"context_line":"    return None"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"5afe65bd_ffd2bf33","line":38,"in_reply_to":"7a016987_74d4edea","updated":"2015-06-01 18:05:25.000000000","message":"+1","commit_id":"f6e308b5078cab52bc1ab452b214e06b5fd9582c"},{"author":{"_account_id":4,"name":"Dolph Mathews","email":"dolph.mathews@gmail.com","username":"dolph"},"change_message_id":"0b178da7949b4284310222ca87328d723bcb42e1","unresolved":false,"context_lines":[{"line_number":36,"context_line":"        hasher.update(key)"},{"line_number":37,"context_line":"        return hasher.hexdigest()"},{"line_number":38,"context_line":"    # If there is no token_id, an explicit None should be expected"},{"line_number":39,"context_line":"    return None"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"class _CachePool(list):"}],"source_content_type":"text/x-python","patch_set":2,"id":"5afe65bd_9faf4b94","line":39,"updated":"2015-06-01 18:05:25.000000000","message":"i\u0027d refactor this so None is an early abort, rather than `if key`","commit_id":"f6e308b5078cab52bc1ab452b214e06b5fd9582c"},{"author":{"_account_id":13478,"name":"Boris Bobrov","email":"b.bobrov@sap.com","username":"bbobrov"},"change_message_id":"2441b88d66400dba89ce31763a93cbdf108d8aac","unresolved":false,"context_lines":[{"line_number":194,"context_line":""},{"line_number":195,"context_line":"        :param str token_id: The unique token id."},{"line_number":196,"context_line":""},{"line_number":197,"context_line":"        :returns: A tuple of a string key and an implementation specific"},{"line_number":198,"context_line":"                  context object"},{"line_number":199,"context_line":"        \"\"\""},{"line_number":200,"context_line":"        # NOTE(jamielennox): in the basic implementation there is no need for"}],"source_content_type":"text/x-python","patch_set":2,"id":"7a016987_9ea9ca92","line":197,"updated":"2015-05-31 21:34:57.000000000","message":"oh well.","commit_id":"f6e308b5078cab52bc1ab452b214e06b5fd9582c"},{"author":{"_account_id":2903,"name":"Morgan Fainberg","email":"morgan.fainberg@gmail.com","username":"mdrnstm"},"change_message_id":"d1e74026be846173c60f8e5978c5101237ec8438","unresolved":false,"context_lines":[{"line_number":194,"context_line":""},{"line_number":195,"context_line":"        :param str token_id: The unique token id."},{"line_number":196,"context_line":""},{"line_number":197,"context_line":"        :returns: A tuple of a string key and an implementation specific"},{"line_number":198,"context_line":"                  context object"},{"line_number":199,"context_line":"        \"\"\""},{"line_number":200,"context_line":"        # NOTE(jamielennox): in the basic implementation there is no need for"}],"source_content_type":"text/x-python","patch_set":2,"id":"7a016987_796bc8b7","line":197,"in_reply_to":"7a016987_9ea9ca92","updated":"2015-05-31 23:46:02.000000000","message":"Yeah.. gotta live with that for now.","commit_id":"f6e308b5078cab52bc1ab452b214e06b5fd9582c"},{"author":{"_account_id":9142,"name":"Samuel de Medeiros Queiroz","email":"samueldmq@lsd.ufcg.edu.br","username":"samuel-z","inactive":true},"change_message_id":"604bc9b259594a8e5579958ce7ba56a1db0656c7","unresolved":false,"context_lines":[{"line_number":33,"context_line":"        return None"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"    if isinstance(key, six.text_type):"},{"line_number":36,"context_line":"        # NOTE(morganfainber): Ensure we are always working with a bytes"},{"line_number":37,"context_line":"        # type required for the hasher. In python 2.7 it is possible to"},{"line_number":38,"context_line":"        # get a text_type (unicode). In python 3.4 all strings are"},{"line_number":39,"context_line":"        # text_type and not bytes by default. This encode coerces the"}],"source_content_type":"text/x-python","patch_set":3,"id":"3afb71cf_52e3ba05","line":36,"updated":"2015-06-08 10:54:13.000000000","message":"(nit) who is morganfainber ?  :)","commit_id":"4a3d08f6bd7104107829ab2b509b448cdc61242c"},{"author":{"_account_id":2903,"name":"Morgan Fainberg","email":"morgan.fainberg@gmail.com","username":"mdrnstm"},"change_message_id":"8306bd3a0a3b6942615b9bb8231f433fdc62b987","unresolved":false,"context_lines":[{"line_number":28,"context_line":"    Using a known-length cache key is important to ensure that memcache"},{"line_number":29,"context_line":"    maximum key length is not exceeded causing failures to validate."},{"line_number":30,"context_line":"    \"\"\""},{"line_number":31,"context_line":"    if not key:"},{"line_number":32,"context_line":"        # If there is no token_id, an explicit None should be expected"},{"line_number":33,"context_line":"        return None"},{"line_number":34,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"3afb71cf_c58fcaca","line":31,"updated":"2015-06-08 21:22:51.000000000","message":"Alternatively we could raise out.","commit_id":"b465e62d64122149970431a43a2e2d3512100fef"},{"author":{"_account_id":7725,"name":"David Stanek","email":"dstanek@dstanek.com","username":"dstanek"},"change_message_id":"d3fe089984f853060d5134173669308514cf7b80","unresolved":false,"context_lines":[{"line_number":28,"context_line":"    Using a known-length cache key is important to ensure that memcache"},{"line_number":29,"context_line":"    maximum key length is not exceeded causing failures to validate."},{"line_number":30,"context_line":"    \"\"\""},{"line_number":31,"context_line":"    if not key:"},{"line_number":32,"context_line":"        # If there is no token_id, an explicit None should be expected"},{"line_number":33,"context_line":"        return None"},{"line_number":34,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"3afb71cf_0d23d206","line":31,"updated":"2015-06-08 18:33:36.000000000","message":"Is this actually needed? There is no test case for it.","commit_id":"b465e62d64122149970431a43a2e2d3512100fef"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"d9800c8a12f3f29f3d7a075a56cb39cc5451353e","unresolved":false,"context_lines":[{"line_number":28,"context_line":"    Using a known-length cache key is important to ensure that memcache"},{"line_number":29,"context_line":"    maximum key length is not exceeded causing failures to validate."},{"line_number":30,"context_line":"    \"\"\""},{"line_number":31,"context_line":"    if not key:"},{"line_number":32,"context_line":"        # If there is no token_id, an explicit None should be expected"},{"line_number":33,"context_line":"        return None"},{"line_number":34,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"3afb71cf_5d8a1865","line":31,"in_reply_to":"3afb71cf_247c23b4","updated":"2015-06-11 02:10:49.000000000","message":"I agree. Don\u0027t call this with no token_id. The caller can probably check this much earlier.","commit_id":"b465e62d64122149970431a43a2e2d3512100fef"},{"author":{"_account_id":7191,"name":"Jamie Lennox","email":"jamielennox@gmail.com","username":"jamielennox"},"change_message_id":"bcea558393a9e35c77d39b77df8cc221ad8e0b86","unresolved":false,"context_lines":[{"line_number":28,"context_line":"    Using a known-length cache key is important to ensure that memcache"},{"line_number":29,"context_line":"    maximum key length is not exceeded causing failures to validate."},{"line_number":30,"context_line":"    \"\"\""},{"line_number":31,"context_line":"    if not key:"},{"line_number":32,"context_line":"        # If there is no token_id, an explicit None should be expected"},{"line_number":33,"context_line":"        return None"},{"line_number":34,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"3afb71cf_247c23b4","line":31,"in_reply_to":"3afb71cf_c58fcaca","updated":"2015-06-10 00:18:21.000000000","message":"i think this should have been checked before getting here so can ignore the check","commit_id":"b465e62d64122149970431a43a2e2d3512100fef"},{"author":{"_account_id":7191,"name":"Jamie Lennox","email":"jamielennox@gmail.com","username":"jamielennox"},"change_message_id":"bcea558393a9e35c77d39b77df8cc221ad8e0b86","unresolved":false,"context_lines":[{"line_number":322,"context_line":"    def _get_cache_key(self, token_id):"},{"line_number":323,"context_line":"        context \u003d memcache_crypt.derive_keys(token_id,"},{"line_number":324,"context_line":"                                             self._secret_key,"},{"line_number":325,"context_line":"                                             self._security_strategy)"},{"line_number":326,"context_line":"        key \u003d self._CACHE_KEY_TEMPLATE % memcache_crypt.get_cache_key(context)"},{"line_number":327,"context_line":"        return key, context"},{"line_number":328,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"3afb71cf_e4c28be8","line":325,"updated":"2015-06-10 00:18:21.000000000","message":"what happens with the secure cache? can we just remove it if we\u0027re going to hash everything?","commit_id":"b465e62d64122149970431a43a2e2d3512100fef"},{"author":{"_account_id":2903,"name":"Morgan Fainberg","email":"morgan.fainberg@gmail.com","username":"mdrnstm"},"change_message_id":"484534d8afbda43a32dae2eec8397e035e4950e6","unresolved":false,"context_lines":[{"line_number":322,"context_line":"    def _get_cache_key(self, token_id):"},{"line_number":323,"context_line":"        context \u003d memcache_crypt.derive_keys(token_id,"},{"line_number":324,"context_line":"                                             self._secret_key,"},{"line_number":325,"context_line":"                                             self._security_strategy)"},{"line_number":326,"context_line":"        key \u003d self._CACHE_KEY_TEMPLATE % memcache_crypt.get_cache_key(context)"},{"line_number":327,"context_line":"        return key, context"},{"line_number":328,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"3afb71cf_71ec11f3","line":325,"in_reply_to":"3afb71cf_e4c28be8","updated":"2015-06-10 05:55:57.000000000","message":"We should evaluate that, but I think this is out of scope for this fix. Lets keep the fix surgical vs changing the other behaviors.","commit_id":"b465e62d64122149970431a43a2e2d3512100fef"}],"keystonemiddleware/tests/unit/auth_token/test_auth_token_middleware.py":[{"author":{"_account_id":13478,"name":"Boris Bobrov","email":"b.bobrov@sap.com","username":"bbobrov"},"change_message_id":"3ecc03e6fc46722fd8e6af381c528990b96e6bdd","unresolved":false,"context_lines":[{"line_number":510,"context_line":"        hashed_short_string_key \u003d token_cache._get_cache_key(short_string)"},{"line_number":511,"context_line":"        hashed_long_string_key \u003d token_cache._get_cache_key(long_string)"},{"line_number":512,"context_line":""},{"line_number":513,"context_line":"        # The hash keys should always match in length. "},{"line_number":514,"context_line":"        self.assertThat(hashed_short_string_key,"},{"line_number":515,"context_line":"                        matchers.HasLength(len(hashed_long_string_key)))"},{"line_number":516,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"7a016987_631443e8","line":513,"updated":"2015-05-30 00:57:43.000000000","message":"space in the end of line","commit_id":"6d2755a39376aa6e9099f847f1791f58f6b70831"},{"author":{"_account_id":2903,"name":"Morgan Fainberg","email":"morgan.fainberg@gmail.com","username":"mdrnstm"},"change_message_id":"c5a41ba527a353d38b6b12f760f92e230f784cff","unresolved":false,"context_lines":[{"line_number":510,"context_line":"        hashed_short_string_key \u003d token_cache._get_cache_key(short_string)"},{"line_number":511,"context_line":"        hashed_long_string_key \u003d token_cache._get_cache_key(long_string)"},{"line_number":512,"context_line":""},{"line_number":513,"context_line":"        # The hash keys should always match in length. "},{"line_number":514,"context_line":"        self.assertThat(hashed_short_string_key,"},{"line_number":515,"context_line":"                        matchers.HasLength(len(hashed_long_string_key)))"},{"line_number":516,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"7a016987_7ef4ceef","line":513,"in_reply_to":"7a016987_631443e8","updated":"2015-05-31 20:57:57.000000000","message":"Done","commit_id":"6d2755a39376aa6e9099f847f1791f58f6b70831"},{"author":{"_account_id":9142,"name":"Samuel de Medeiros Queiroz","email":"samueldmq@lsd.ufcg.edu.br","username":"samuel-z","inactive":true},"change_message_id":"d75fb7732c57d50a001d0166c4c92a3266bc3474","unresolved":false,"context_lines":[{"line_number":505,"context_line":"    def test_fixed_cache_key_length(self):"},{"line_number":506,"context_line":"        self.set_middleware()"},{"line_number":507,"context_line":"        short_string \u003d uuid.uuid4().hex"},{"line_number":508,"context_line":"        long_string \u003d uuid.uuid4().hex + uuid.uuid4().hex"},{"line_number":509,"context_line":""},{"line_number":510,"context_line":"        token_cache \u003d self.middleware._token_cache"},{"line_number":511,"context_line":"        hashed_short_string_key \u003d token_cache._get_cache_key(short_string)"}],"source_content_type":"text/x-python","patch_set":2,"id":"7a016987_b40a6577","line":508,"updated":"2015-06-01 03:37:32.000000000","message":"The current limit of a key is 250 characters. UUID contains 32.\n\nIf we defined:\n\n    long_string \u003d 8 * uuid.uuid4().hex\n\nthen this long string would contain 256 characters, which exceeds the limit of 250; and we would a still better test.\n\nIf you go for this, please add a comment as well, saying the reason of using 8.\n\n[1] https://github.com/memcached/memcached/blob/master/doc/protocol.txt#L41-L49","commit_id":"f6e308b5078cab52bc1ab452b214e06b5fd9582c"},{"author":{"_account_id":4,"name":"Dolph Mathews","email":"dolph.mathews@gmail.com","username":"dolph"},"change_message_id":"0b178da7949b4284310222ca87328d723bcb42e1","unresolved":false,"context_lines":[{"line_number":505,"context_line":"    def test_fixed_cache_key_length(self):"},{"line_number":506,"context_line":"        self.set_middleware()"},{"line_number":507,"context_line":"        short_string \u003d uuid.uuid4().hex"},{"line_number":508,"context_line":"        long_string \u003d uuid.uuid4().hex + uuid.uuid4().hex"},{"line_number":509,"context_line":""},{"line_number":510,"context_line":"        token_cache \u003d self.middleware._token_cache"},{"line_number":511,"context_line":"        hashed_short_string_key \u003d token_cache._get_cache_key(short_string)"}],"source_content_type":"text/x-python","patch_set":2,"id":"5afe65bd_5f231306","line":508,"in_reply_to":"7a016987_b40a6577","updated":"2015-06-01 18:05:25.000000000","message":"+1","commit_id":"f6e308b5078cab52bc1ab452b214e06b5fd9582c"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"1273a63be26183dd587f6effeedb65d880744abe","unresolved":false,"context_lines":[{"line_number":505,"context_line":"    def test_fixed_cache_key_length(self):"},{"line_number":506,"context_line":"        self.set_middleware()"},{"line_number":507,"context_line":"        short_string \u003d uuid.uuid4().hex"},{"line_number":508,"context_line":"        long_string \u003d uuid.uuid4().hex + uuid.uuid4().hex"},{"line_number":509,"context_line":""},{"line_number":510,"context_line":"        token_cache \u003d self.middleware._token_cache"},{"line_number":511,"context_line":"        hashed_short_string_key \u003d token_cache._get_cache_key(short_string)"}],"source_content_type":"text/x-python","patch_set":2,"id":"5afe65bd_584b245a","line":508,"in_reply_to":"7a016987_b40a6577","updated":"2015-06-01 21:41:20.000000000","message":"This is interesting because it notes that there\u0027s all sorts of limits on the key that we\u0027re not enforcing properly.","commit_id":"f6e308b5078cab52bc1ab452b214e06b5fd9582c"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"1273a63be26183dd587f6effeedb65d880744abe","unresolved":false,"context_lines":[{"line_number":508,"context_line":"        long_string \u003d uuid.uuid4().hex + uuid.uuid4().hex"},{"line_number":509,"context_line":""},{"line_number":510,"context_line":"        token_cache \u003d self.middleware._token_cache"},{"line_number":511,"context_line":"        hashed_short_string_key \u003d token_cache._get_cache_key(short_string)"},{"line_number":512,"context_line":"        hashed_long_string_key \u003d token_cache._get_cache_key(long_string)"},{"line_number":513,"context_line":""},{"line_number":514,"context_line":"        # The hash keys should always match in length"}],"source_content_type":"text/x-python","patch_set":2,"id":"5afe65bd_3d55fa1c","line":511,"updated":"2015-06-01 21:41:20.000000000","message":"token_cache._get_cache_key returns a tuple, not the key. This should be\n\n hashed_short_string_key, context_ \u003d token_cache._get_cache_key(short_string)","commit_id":"f6e308b5078cab52bc1ab452b214e06b5fd9582c"},{"author":{"_account_id":9142,"name":"Samuel de Medeiros Queiroz","email":"samueldmq@lsd.ufcg.edu.br","username":"samuel-z","inactive":true},"change_message_id":"d75fb7732c57d50a001d0166c4c92a3266bc3474","unresolved":false,"context_lines":[{"line_number":513,"context_line":""},{"line_number":514,"context_line":"        # The hash keys should always match in length"},{"line_number":515,"context_line":"        self.assertThat(hashed_short_string_key,"},{"line_number":516,"context_line":"                        matchers.HasLength(len(hashed_long_string_key)))"},{"line_number":517,"context_line":""},{"line_number":518,"context_line":"    @testtools.skipUnless(memcached_available(), \u0027memcached not available\u0027)"},{"line_number":519,"context_line":"    def test_encrypt_cache_data(self):"}],"source_content_type":"text/x-python","patch_set":2,"id":"7a016987_d47e01e3","line":516,"updated":"2015-06-01 03:37:32.000000000","message":"And both have 64 characters :)","commit_id":"f6e308b5078cab52bc1ab452b214e06b5fd9582c"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"1273a63be26183dd587f6effeedb65d880744abe","unresolved":false,"context_lines":[{"line_number":513,"context_line":""},{"line_number":514,"context_line":"        # The hash keys should always match in length"},{"line_number":515,"context_line":"        self.assertThat(hashed_short_string_key,"},{"line_number":516,"context_line":"                        matchers.HasLength(len(hashed_long_string_key)))"},{"line_number":517,"context_line":""},{"line_number":518,"context_line":"    @testtools.skipUnless(memcached_available(), \u0027memcached not available\u0027)"},{"line_number":519,"context_line":"    def test_encrypt_cache_data(self):"}],"source_content_type":"text/x-python","patch_set":2,"id":"5afe65bd_5de556a6","line":516,"updated":"2015-06-01 21:41:20.000000000","message":"We know exactly what the result from token_cache._get_cache_key is going to be, sha256(short_string), so I think we should be checking that instead. e.g.,\n\n self.assertEqual(hashed_short_string_key, sha256(short_string))\n self.assertEqual(hashed_long_string_key, sha256(long_string))\n\nYou can check the length is the same if you want, but I think it\u0027s obvious since they\u0027re both sha256 hashes.","commit_id":"f6e308b5078cab52bc1ab452b214e06b5fd9582c"},{"author":{"_account_id":11022,"name":"Rodrigo Duarte Sousa","email":"rodrigodsousa@gmail.com","username":"rodrigods"},"change_message_id":"cf3480a490ea7e3f151d98517c020a8c5062b128","unresolved":false,"context_lines":[{"line_number":513,"context_line":""},{"line_number":514,"context_line":"        # The hash keys should always match in length"},{"line_number":515,"context_line":"        self.assertThat(hashed_short_string_key,"},{"line_number":516,"context_line":"                        matchers.HasLength(len(hashed_long_string_key)))"},{"line_number":517,"context_line":""},{"line_number":518,"context_line":"    @testtools.skipUnless(memcached_available(), \u0027memcached not available\u0027)"},{"line_number":519,"context_line":"    def test_encrypt_cache_data(self):"}],"source_content_type":"text/x-python","patch_set":2,"id":"7a016987_9e3f8a86","line":516,"updated":"2015-05-31 21:10:05.000000000","message":"interesting way of comparing the lengths, if I were implementing this I\u0027d use assertEqua(), like:\n\n  self.assertEqual(len(hashed_short_string_key),\n                   len(hashed_long_string_key))\n\nThe \"base\" for me would be the shorter string key","commit_id":"f6e308b5078cab52bc1ab452b214e06b5fd9582c"},{"author":{"_account_id":2903,"name":"Morgan Fainberg","email":"morgan.fainberg@gmail.com","username":"mdrnstm"},"change_message_id":"46a97cbbfc6ebfa9584f87a66948582bfd46181d","unresolved":false,"context_lines":[{"line_number":513,"context_line":""},{"line_number":514,"context_line":"        # The hash keys should always match in length"},{"line_number":515,"context_line":"        self.assertThat(hashed_short_string_key,"},{"line_number":516,"context_line":"                        matchers.HasLength(len(hashed_long_string_key)))"},{"line_number":517,"context_line":""},{"line_number":518,"context_line":"    @testtools.skipUnless(memcached_available(), \u0027memcached not available\u0027)"},{"line_number":519,"context_line":"    def test_encrypt_cache_data(self):"}],"source_content_type":"text/x-python","patch_set":2,"id":"3afb71cf_7d4a10ae","line":516,"in_reply_to":"5afe65bd_5de556a6","updated":"2015-06-08 08:20:49.000000000","message":"The Length is the correct thing to be checking. The sha will be different in both cases, but the length should be identical. That is what this whole patch is aiming to solve.","commit_id":"f6e308b5078cab52bc1ab452b214e06b5fd9582c"},{"author":{"_account_id":2903,"name":"Morgan Fainberg","email":"morgan.fainberg@gmail.com","username":"mdrnstm"},"change_message_id":"e2e81791d6d54ce9ab048a4a09ea764d9dcb3f5e","unresolved":false,"context_lines":[{"line_number":513,"context_line":""},{"line_number":514,"context_line":"        # The hash keys should always match in length"},{"line_number":515,"context_line":"        self.assertThat(hashed_short_string_key,"},{"line_number":516,"context_line":"                        matchers.HasLength(len(hashed_long_string_key)))"},{"line_number":517,"context_line":""},{"line_number":518,"context_line":"    @testtools.skipUnless(memcached_available(), \u0027memcached not available\u0027)"},{"line_number":519,"context_line":"    def test_encrypt_cache_data(self):"}],"source_content_type":"text/x-python","patch_set":2,"id":"7a016987_1ef03ac8","line":516,"in_reply_to":"7a016987_9e3f8a86","updated":"2015-05-31 21:25:25.000000000","message":"I personally like how matchers.hasLength reads better. But this is strictly personal preference.","commit_id":"f6e308b5078cab52bc1ab452b214e06b5fd9582c"},{"author":{"_account_id":4,"name":"Dolph Mathews","email":"dolph.mathews@gmail.com","username":"dolph"},"change_message_id":"0b178da7949b4284310222ca87328d723bcb42e1","unresolved":false,"context_lines":[{"line_number":513,"context_line":""},{"line_number":514,"context_line":"        # The hash keys should always match in length"},{"line_number":515,"context_line":"        self.assertThat(hashed_short_string_key,"},{"line_number":516,"context_line":"                        matchers.HasLength(len(hashed_long_string_key)))"},{"line_number":517,"context_line":""},{"line_number":518,"context_line":"    @testtools.skipUnless(memcached_available(), \u0027memcached not available\u0027)"},{"line_number":519,"context_line":"    def test_encrypt_cache_data(self):"}],"source_content_type":"text/x-python","patch_set":2,"id":"5afe65bd_bfe7a7ab","line":516,"in_reply_to":"7a016987_d47e01e3","updated":"2015-06-01 18:05:25.000000000","message":"lol","commit_id":"f6e308b5078cab52bc1ab452b214e06b5fd9582c"},{"author":{"_account_id":9142,"name":"Samuel de Medeiros Queiroz","email":"samueldmq@lsd.ufcg.edu.br","username":"samuel-z","inactive":true},"change_message_id":"604bc9b259594a8e5579958ce7ba56a1db0656c7","unresolved":false,"context_lines":[{"line_number":504,"context_line":"    def test_fixed_cache_key_length(self):"},{"line_number":505,"context_line":"        self.set_middleware()"},{"line_number":506,"context_line":"        short_string \u003d uuid.uuid4().hex"},{"line_number":507,"context_line":"        long_string \u003d long_string \u003d 8 * uuid.uuid4().hex"},{"line_number":508,"context_line":""},{"line_number":509,"context_line":"        token_cache \u003d self.middleware._token_cache"},{"line_number":510,"context_line":"        hashed_short_string_key, context_ \u003d token_cache._get_cache_key("}],"source_content_type":"text/x-python","patch_set":3,"id":"3afb71cf_7296b64d","line":507,"updated":"2015-06-08 10:54:13.000000000","message":"Should not be repeating ``long_string \u003d long_string \u003d ...``\n\nI think it is worth to fix since it is very weird as it is :)","commit_id":"4a3d08f6bd7104107829ab2b509b448cdc61242c"}]}
