)]}'
{"swift/common/middleware/keystoneauth.py":[{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"e0c7ee21a051950d4c6ee6b9656de70e9b135786","unresolved":false,"context_lines":[{"line_number":244,"context_line":"        identity \u003d {\u0027user\u0027: (environ.get(\u0027HTTP_X_USER_ID\u0027),"},{"line_number":245,"context_line":"                             environ.get(\u0027HTTP_X_USER_NAME\u0027)),"},{"line_number":246,"context_line":"                    \u0027tenant\u0027: (environ.get(\u0027HTTP_X_TENANT_ID\u0027) or"},{"line_number":247,"context_line":"                               environ.get(\u0027HTTP_X_PROJECT_ID\u0027),"},{"line_number":248,"context_line":"                               environ.get(\u0027HTTP_X_TENANT_NAME\u0027) or"},{"line_number":249,"context_line":"                               environ.get(\u0027HTTP_X_PROJECT_NAME\u0027)),"},{"line_number":250,"context_line":"                    \u0027roles\u0027: roles,"}],"source_content_type":"text/x-python","patch_set":4,"id":"1aa78d24_1258d3f9","line":247,"updated":"2016-07-11 04:09:59.000000000","message":"Which do we want?\n\n environ.get(\u0027HTTP_X_TENANT_ID\u0027) or environ.get(\u0027HTTP_X_PROJECT_ID\u0027)\n\nor\n\n environ.get(\u0027HTTP_X_TENANT_ID\u0027, environ.get(\u0027HTTP_X_PROJECT_ID\u0027))\n\n? Does it matter?","commit_id":"032f730fc97b8c869fdbc6dace8ae51004238d3a"},{"author":{"_account_id":12193,"name":"Hisashi Osanai","email":"osanai.hisashi@jp.fujitsu.com","username":"ho"},"change_message_id":"2760abec25689cdf63932b46e3cf8cb37a7b9357","unresolved":false,"context_lines":[{"line_number":244,"context_line":"        identity \u003d {\u0027user\u0027: (environ.get(\u0027HTTP_X_USER_ID\u0027),"},{"line_number":245,"context_line":"                             environ.get(\u0027HTTP_X_USER_NAME\u0027)),"},{"line_number":246,"context_line":"                    \u0027tenant\u0027: (environ.get(\u0027HTTP_X_TENANT_ID\u0027) or"},{"line_number":247,"context_line":"                               environ.get(\u0027HTTP_X_PROJECT_ID\u0027),"},{"line_number":248,"context_line":"                               environ.get(\u0027HTTP_X_TENANT_NAME\u0027) or"},{"line_number":249,"context_line":"                               environ.get(\u0027HTTP_X_PROJECT_NAME\u0027)),"},{"line_number":250,"context_line":"                    \u0027roles\u0027: roles,"}],"source_content_type":"text/x-python","patch_set":4,"id":"1aa78d24_5931cd0a","line":247,"in_reply_to":"1aa78d24_1258d3f9","updated":"2016-07-11 13:05:36.000000000","message":"It doesn\u0027t need to care about it (same behavior) but your idea can get more clear understanding so I will change the code with following.\nenviron.get(\u0027HTTP_X_PROJECT_ID\u0027, environ.get(\u0027HTTP_X_TENANT_ID\u0027)\n\nthe code means v3 is default. if there is no v3 info, the code tries to get v2 info.","commit_id":"032f730fc97b8c869fdbc6dace8ae51004238d3a"}],"test/unit/common/middleware/test_keystoneauth.py":[{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"88f492c53485d1b1397f165db50e62c41146af39","unresolved":false,"context_lines":[{"line_number":703,"context_line":"            acl \u003d \u0027%s:%s\u0027 % (tenant_name, user)"},{"line_number":704,"context_line":"            self._check_authenticate(identity\u003didentity, acl\u003dacl)"},{"line_number":705,"context_line":""},{"line_number":706,"context_line":"    def test_authorize_succeeds_for_project_name_user_in_roles(self):"},{"line_number":707,"context_line":"        identity \u003d self._get_identity()"},{"line_number":708,"context_line":"        user_name \u003d identity[\u0027HTTP_X_USER_NAME\u0027]"},{"line_number":709,"context_line":"        user_id \u003d identity[\u0027HTTP_X_USER_ID\u0027]"}],"source_content_type":"text/x-python","patch_set":3,"id":"7a5de9d1_1848f286","line":706,"updated":"2016-01-28 14:16:55.000000000","message":"None of these new tests fail if I revert your change to keystoneauth.py\n\nI think the problem is that you are selecting *PROJECT* keys from the input identity dict to populate the acls etc. These always have the same values as the *TENANT* keys, as defined in _get_identity(). But the identity dict is still passed to the authorize method unchanged via _check_authenticate, so it has both *PROJECT* and *TENANT* keys.\n\nWhat I think is needed is to *remove* the *TENANT* keys from the identity dict before passing to _check_authenticate() to simulate a future when authtoken does not include them, and to verify that keystoneauth works ok when it only has *PROJECT* keys.\n\n^^ this applies to all the modified tests I believe","commit_id":"0d36e27bcbc014b16606b4bfdb20d2824b98bcf3"},{"author":{"_account_id":12193,"name":"Hisashi Osanai","email":"osanai.hisashi@jp.fujitsu.com","username":"ho"},"change_message_id":"5ba148b76b8b41eea886c2cf241c89de54fc8485","unresolved":false,"context_lines":[{"line_number":703,"context_line":"            acl \u003d \u0027%s:%s\u0027 % (tenant_name, user)"},{"line_number":704,"context_line":"            self._check_authenticate(identity\u003didentity, acl\u003dacl)"},{"line_number":705,"context_line":""},{"line_number":706,"context_line":"    def test_authorize_succeeds_for_project_name_user_in_roles(self):"},{"line_number":707,"context_line":"        identity \u003d self._get_identity()"},{"line_number":708,"context_line":"        user_name \u003d identity[\u0027HTTP_X_USER_NAME\u0027]"},{"line_number":709,"context_line":"        user_id \u003d identity[\u0027HTTP_X_USER_ID\u0027]"}],"source_content_type":"text/x-python","patch_set":3,"id":"1aa78d24_779ae96f","line":706,"in_reply_to":"7a5de9d1_1848f286","updated":"2016-07-11 03:19:57.000000000","message":"Alistair, thanks for your review. you are right. I used two identities (v2/3) to fix it in next path set.","commit_id":"0d36e27bcbc014b16606b4bfdb20d2824b98bcf3"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"e0c7ee21a051950d4c6ee6b9656de70e9b135786","unresolved":false,"context_lines":[{"line_number":577,"context_line":"        for suffix in [\u0027ID\u0027, \u0027NAME\u0027]:"},{"line_number":578,"context_line":"            identity[\u0027HTTP_X_TENANT_{0}\u0027.format(suffix)] \u003d ("},{"line_number":579,"context_line":"                identity[\u0027HTTP_X_PROJECT_{0}\u0027.format(suffix)])"},{"line_number":580,"context_line":"            del identity[\u0027HTTP_X_PROJECT_{0}\u0027.format(suffix)]"},{"line_number":581,"context_line":"        return identity"},{"line_number":582,"context_line":""},{"line_number":583,"context_line":"    def _get_env_id(self, tenant_id\u003d\u0027tenant_id\u0027, tenant_name\u003d\u0027tenant_name\u0027,"}],"source_content_type":"text/x-python","patch_set":4,"id":"1aa78d24_d22beb31","line":580,"updated":"2016-07-11 04:09:59.000000000","message":"nit: could combine the get/del with a pop. I.e.\n\n identity[\u0027HTTP_X_TENANT_{0}\u0027.format(suffix)] \u003d identity.pop(\n     \u0027HTTP_X_PROJECT_{0}\u0027.format(suffix))","commit_id":"032f730fc97b8c869fdbc6dace8ae51004238d3a"},{"author":{"_account_id":12193,"name":"Hisashi Osanai","email":"osanai.hisashi@jp.fujitsu.com","username":"ho"},"change_message_id":"2760abec25689cdf63932b46e3cf8cb37a7b9357","unresolved":false,"context_lines":[{"line_number":577,"context_line":"        for suffix in [\u0027ID\u0027, \u0027NAME\u0027]:"},{"line_number":578,"context_line":"            identity[\u0027HTTP_X_TENANT_{0}\u0027.format(suffix)] \u003d ("},{"line_number":579,"context_line":"                identity[\u0027HTTP_X_PROJECT_{0}\u0027.format(suffix)])"},{"line_number":580,"context_line":"            del identity[\u0027HTTP_X_PROJECT_{0}\u0027.format(suffix)]"},{"line_number":581,"context_line":"        return identity"},{"line_number":582,"context_line":""},{"line_number":583,"context_line":"    def _get_env_id(self, tenant_id\u003d\u0027tenant_id\u0027, tenant_name\u003d\u0027tenant_name\u0027,"}],"source_content_type":"text/x-python","patch_set":4,"id":"1aa78d24_b907111c","line":580,"in_reply_to":"1aa78d24_d22beb31","updated":"2016-07-11 13:05:36.000000000","message":"Good idea. I will use this logic.","commit_id":"032f730fc97b8c869fdbc6dace8ae51004238d3a"}]}
