)]}'
{"keystone/token/providers/common.py":[{"author":{"_account_id":5707,"name":"Henry Nash","email":"henryn@linux.vnet.ibm.com","username":"henry-nash"},"change_message_id":"9d21f2ab725f49fbf6f8780286065e0e4345eccb","unresolved":false,"context_lines":[{"line_number":495,"context_line":"        return token_ref"},{"line_number":496,"context_line":""},{"line_number":497,"context_line":"    def _assert_non_federation_token(self, token_ref):"},{"line_number":498,"context_line":"        \"\"\"Make sure we aren\u0027t operating on a federated token.\"\"\""},{"line_number":499,"context_line":"        if (token_ref.get(\u0027token_data\u0027) and"},{"line_number":500,"context_line":"                self.get_token_version(token_ref.get(\u0027token_data\u0027)) \u003d\u003d"},{"line_number":501,"context_line":"                token.provider.V3):"}],"source_content_type":"text/x-python","patch_set":1,"id":"da86d52c_81540e55","line":498,"updated":"2015-02-10 09:46:09.000000000","message":"so it\u0027s not obvious from the check below as to why this determins it is a federated token....looks like we are just checking for v3....","commit_id":"2d9dda474b1a914421a0d60e63cfb5a85057b3d3"},{"author":{"_account_id":6482,"name":"Steve Martinelli","email":"s.martinelli@gmail.com","username":"stevemar"},"change_message_id":"ab1d4f8a8d6e83a11d0baa195eb5c173a3767358","unresolved":false,"context_lines":[{"line_number":495,"context_line":"        return token_ref"},{"line_number":496,"context_line":""},{"line_number":497,"context_line":"    def _assert_non_federation_token(self, token_ref):"},{"line_number":498,"context_line":"        \"\"\"Make sure we aren\u0027t operating on a federated token.\"\"\""},{"line_number":499,"context_line":"        if (token_ref.get(\u0027token_data\u0027) and"},{"line_number":500,"context_line":"                self.get_token_version(token_ref.get(\u0027token_data\u0027)) \u003d\u003d"},{"line_number":501,"context_line":"                token.provider.V3):"}],"source_content_type":"text/x-python","patch_set":1,"id":"da86d52c_6f5533c5","line":498,"in_reply_to":"da86d52c_81540e55","updated":"2015-02-10 15:52:27.000000000","message":"the real check is a few lines lower (line 506), this part is just making sure it it\u0027s a v3 token.","commit_id":"2d9dda474b1a914421a0d60e63cfb5a85057b3d3"},{"author":{"_account_id":5707,"name":"Henry Nash","email":"henryn@linux.vnet.ibm.com","username":"henry-nash"},"change_message_id":"8a50db65f16da6cadba7da52c51e85f6f1d4e2bc","unresolved":false,"context_lines":[{"line_number":500,"context_line":"                self.get_token_version(token_ref.get(\u0027token_data\u0027)) \u003d\u003d"},{"line_number":501,"context_line":"                token.provider.V3):"},{"line_number":502,"context_line":"            # this is a V3 token"},{"line_number":503,"context_line":"            msg \u003d _(\u0027Attempting to use OS-FEDERATION token with V2 Identity \u0027"},{"line_number":504,"context_line":"                    \u0027Service, use V3 Authentication\u0027)"},{"line_number":505,"context_line":"            # user in a non-default is prohibited"},{"line_number":506,"context_line":"            if (\u0027OS-FEDERATION\u0027 in token_ref[\u0027token_data\u0027][\u0027token\u0027][\u0027user\u0027]):"}],"source_content_type":"text/x-python","patch_set":1,"id":"da86d52c_fd12b807","line":503,"updated":"2015-02-10 18:35:36.000000000","message":"I think maybe the confusion is that this line is only used within the following if clause......maybe move it there to make this more obvious....","commit_id":"2d9dda474b1a914421a0d60e63cfb5a85057b3d3"},{"author":{"_account_id":6482,"name":"Steve Martinelli","email":"s.martinelli@gmail.com","username":"stevemar"},"change_message_id":"e66970bb89582f48aa467e3ee6368581c1085bfc","unresolved":false,"context_lines":[{"line_number":500,"context_line":"                self.get_token_version(token_ref.get(\u0027token_data\u0027)) \u003d\u003d"},{"line_number":501,"context_line":"                token.provider.V3):"},{"line_number":502,"context_line":"            # this is a V3 token"},{"line_number":503,"context_line":"            msg \u003d _(\u0027Attempting to use OS-FEDERATION token with V2 Identity \u0027"},{"line_number":504,"context_line":"                    \u0027Service, use V3 Authentication\u0027)"},{"line_number":505,"context_line":"            # user in a non-default is prohibited"},{"line_number":506,"context_line":"            if (\u0027OS-FEDERATION\u0027 in token_ref[\u0027token_data\u0027][\u0027token\u0027][\u0027user\u0027]):"}],"source_content_type":"text/x-python","patch_set":1,"id":"da86d52c_d7859acf","line":503,"in_reply_to":"da86d52c_303f0089","updated":"2015-02-11 20:31:39.000000000","message":"i don\u0027t think we have an ID yet, so we can\u0027t use the model approach, i refactored the code to make it a bit cleaner","commit_id":"2d9dda474b1a914421a0d60e63cfb5a85057b3d3"},{"author":{"_account_id":9101,"name":"wanghong","email":"reviewwanghong@126.com","username":"wanghong"},"change_message_id":"6abc5f9e323a60101cf53cc3a738eda06d113b9f","unresolved":false,"context_lines":[{"line_number":500,"context_line":"                self.get_token_version(token_ref.get(\u0027token_data\u0027)) \u003d\u003d"},{"line_number":501,"context_line":"                token.provider.V3):"},{"line_number":502,"context_line":"            # this is a V3 token"},{"line_number":503,"context_line":"            msg \u003d _(\u0027Attempting to use OS-FEDERATION token with V2 Identity \u0027"},{"line_number":504,"context_line":"                    \u0027Service, use V3 Authentication\u0027)"},{"line_number":505,"context_line":"            # user in a non-default is prohibited"},{"line_number":506,"context_line":"            if (\u0027OS-FEDERATION\u0027 in token_ref[\u0027token_data\u0027][\u0027token\u0027][\u0027user\u0027]):"}],"source_content_type":"text/x-python","patch_set":1,"id":"da86d52c_303f0089","line":503,"in_reply_to":"da86d52c_4da21b4c","updated":"2015-02-11 08:29:15.000000000","message":"I think we should use keystone.models.token_model.KeystoneToken? It has is_federated_user property already.","commit_id":"2d9dda474b1a914421a0d60e63cfb5a85057b3d3"},{"author":{"_account_id":8978,"name":"Marek Denis","email":"marek.denis+openstack@gmail.com","username":"marek-denis"},"change_message_id":"9160b86c212ba25315c6b92aae2c827103ce83f6","unresolved":false,"context_lines":[{"line_number":500,"context_line":"                self.get_token_version(token_ref.get(\u0027token_data\u0027)) \u003d\u003d"},{"line_number":501,"context_line":"                token.provider.V3):"},{"line_number":502,"context_line":"            # this is a V3 token"},{"line_number":503,"context_line":"            msg \u003d _(\u0027Attempting to use OS-FEDERATION token with V2 Identity \u0027"},{"line_number":504,"context_line":"                    \u0027Service, use V3 Authentication\u0027)"},{"line_number":505,"context_line":"            # user in a non-default is prohibited"},{"line_number":506,"context_line":"            if (\u0027OS-FEDERATION\u0027 in token_ref[\u0027token_data\u0027][\u0027token\u0027][\u0027user\u0027]):"}],"source_content_type":"text/x-python","patch_set":1,"id":"da86d52c_4da21b4c","line":503,"in_reply_to":"da86d52c_fd12b807","updated":"2015-02-11 08:01:38.000000000","message":"probably some refactorization could be helpful:\n\nhow about:\n\n[...]\ntoken_data \u003d token_ref.get(\u0027token_data\u0027)\n\n\nif not token_data:\n    raise exception.Unauthorized(\"Malformed token(?)\")\n\ntoken_v3 \u003d self.get_token_version(token_data) \u003d\u003d     token.provider.V3\nif token_v3:\n    federated_token \u003d \u0027OS-FEDERATION\u0027 in token_data[\u0027token\u0027][\u0027user\u0027]\n    if federated_token:\n        msg \u003d _(\"bla bla\")\n        raise exception.Unauthorized(msg)","commit_id":"2d9dda474b1a914421a0d60e63cfb5a85057b3d3"},{"author":{"_account_id":8978,"name":"Marek Denis","email":"marek.denis+openstack@gmail.com","username":"marek-denis"},"change_message_id":"e1632977914bec20b4b31e22d25f11a80e147d46","unresolved":false,"context_lines":[{"line_number":505,"context_line":"            # user in a non-default is prohibited"},{"line_number":506,"context_line":"            if (\u0027OS-FEDERATION\u0027 in token_ref[\u0027token_data\u0027][\u0027token\u0027][\u0027user\u0027]):"},{"line_number":507,"context_line":"                raise exception.Unauthorized(msg)"},{"line_number":508,"context_line":""},{"line_number":509,"context_line":"    def _assert_default_domain(self, token_ref):"},{"line_number":510,"context_line":"        \"\"\"Make sure we are operating on default domain only.\"\"\""},{"line_number":511,"context_line":"        if (token_ref.get(\u0027token_data\u0027) and"}],"source_content_type":"text/x-python","patch_set":1,"id":"da86d52c_0f483786","line":508,"updated":"2015-02-10 16:07:58.000000000","message":"looks like you want to raise exception.Unauthorized() if it is the federated v3 token ?\n\nWasn\u0027t the goal to check v3 tokens?","commit_id":"2d9dda474b1a914421a0d60e63cfb5a85057b3d3"},{"author":{"_account_id":8978,"name":"Marek Denis","email":"marek.denis+openstack@gmail.com","username":"marek-denis"},"change_message_id":"c88fe45045beee2227003f179ab90ee5a6e354f2","unresolved":false,"context_lines":[{"line_number":505,"context_line":"            # user in a non-default is prohibited"},{"line_number":506,"context_line":"            if (\u0027OS-FEDERATION\u0027 in token_ref[\u0027token_data\u0027][\u0027token\u0027][\u0027user\u0027]):"},{"line_number":507,"context_line":"                raise exception.Unauthorized(msg)"},{"line_number":508,"context_line":""},{"line_number":509,"context_line":"    def _assert_default_domain(self, token_ref):"},{"line_number":510,"context_line":"        \"\"\"Make sure we are operating on default domain only.\"\"\""},{"line_number":511,"context_line":"        if (token_ref.get(\u0027token_data\u0027) and"}],"source_content_type":"text/x-python","patch_set":1,"id":"da86d52c_4a913d99","line":508,"in_reply_to":"da86d52c_0f483786","updated":"2015-02-10 16:15:03.000000000","message":"ok, federated tokens will always be v3, so the code is ok.","commit_id":"2d9dda474b1a914421a0d60e63cfb5a85057b3d3"}]}
