)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":10795,"name":"Rajesh Tailor","email":"tailor.rajesh88@gmail.com","username":"rajeshtailor"},"change_message_id":"e432e3818dacec06210b40df0a8ed1fe045a10a1","unresolved":false,"context_lines":[{"line_number":11,"context_line":"etc/keystone-paste.ini as one of the earliest middleware components in the"},{"line_number":12,"context_line":"keystone pipeline. This means that almost all other middleware components"},{"line_number":13,"context_line":"can depend on the auth context being available for use."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Change-Id: I1c08976cf4d175fa2cfe2e39fe55811f04f13243"},{"line_number":16,"context_line":"Closes-Bug: #1433211"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"ba3cc151_e76b42b8","line":14,"updated":"2015-07-10 11:40:56.000000000","message":"IMO ApiImpact tag is required here as you are raising Unauthorized error in keystone/contrib/oauth1/controllers.py module.","commit_id":"bfc4b728997cc0e083bc9ef824eb506da231126c"},{"author":{"_account_id":13478,"name":"Boris Bobrov","email":"b.bobrov@sap.com","username":"bbobrov"},"change_message_id":"d751da5e8b2b7d5ba89aa7dd35500ced7658cec1","unresolved":false,"context_lines":[{"line_number":11,"context_line":"etc/keystone-paste.ini as one of the earliest middleware components in the"},{"line_number":12,"context_line":"keystone pipeline. This means that almost all other middleware components"},{"line_number":13,"context_line":"can depend on the auth context being available for use."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Change-Id: I1c08976cf4d175fa2cfe2e39fe55811f04f13243"},{"line_number":16,"context_line":"Closes-Bug: #1433211"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"ba3cc151_bca54c48","line":14,"in_reply_to":"ba3cc151_e76b42b8","updated":"2015-07-10 12:42:17.000000000","message":"Unauthorized was raised before by the function, that is replaced now. I don\u0027t think ApiImpact is needed.","commit_id":"bfc4b728997cc0e083bc9ef824eb506da231126c"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"09127919ee1fe00878f2897aeb3f32967e274007","unresolved":false,"context_lines":[{"line_number":12,"context_line":"keystone pipeline. This means that almost all other middleware components"},{"line_number":13,"context_line":"can depend on the auth context being available for use."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Also added a test to check that a trust cannot be retrived in case of a"},{"line_number":16,"context_line":"missing auth context. Such a request should throw Forbidden exception."},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"Change-Id: I1c08976cf4d175fa2cfe2e39fe55811f04f13243"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"3a50d1a3_cebf8cce","line":15,"updated":"2015-07-29 02:22:18.000000000","message":"change \"retrived\" to \"retrieved\"","commit_id":"288a05a4de4b61d32816081f4c2a0f6e2f773cf2"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"09127919ee1fe00878f2897aeb3f32967e274007","unresolved":false,"context_lines":[{"line_number":13,"context_line":"can depend on the auth context being available for use."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Also added a test to check that a trust cannot be retrived in case of a"},{"line_number":16,"context_line":"missing auth context. Such a request should throw Forbidden exception."},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"Change-Id: I1c08976cf4d175fa2cfe2e39fe55811f04f13243"},{"line_number":19,"context_line":"Closes-Bug: #1433211"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"3a50d1a3_eec60867","line":16,"updated":"2015-07-29 02:22:18.000000000","message":"why should this raise Forbidden?","commit_id":"288a05a4de4b61d32816081f4c2a0f6e2f773cf2"}],"keystone/common/controller.py":[{"author":{"_account_id":5707,"name":"Henry Nash","email":"henryn@linux.vnet.ibm.com","username":"henry-nash"},"change_message_id":"fb9e27017beb17ac5528a8f90b9667d01b263a35","unresolved":false,"context_lines":[{"line_number":712,"context_line":"        # this version of normalize_domain will only be called inside"},{"line_number":713,"context_line":"        # a v3 protected call).  However, this optimization is probably not"},{"line_number":714,"context_line":"        # worth the duplication of state"},{"line_number":715,"context_line":"        token_ref \u003d utils.get_token_ref(context)"},{"line_number":716,"context_line":""},{"line_number":717,"context_line":"        if token_ref.domain_scoped:"},{"line_number":718,"context_line":"            return token_ref.domain_id"}],"source_content_type":"text/x-python","patch_set":7,"id":"3a50d1a3_ea1ee90a","line":715,"updated":"2015-07-23 07:33:20.000000000","message":"Now that we do this, we can remove my comment above, because this is now much more efficient.","commit_id":"b6adc9c353b33bed21bb7201ddabea3a42782b4c"},{"author":{"_account_id":15225,"name":"Deepti Ramakrishna","email":"deepti.ramakrishna@intel.com","username":"dramakri"},"change_message_id":"3762a617f0d0baa815da4bb688947c721c1b51f1","unresolved":false,"context_lines":[{"line_number":712,"context_line":"        # this version of normalize_domain will only be called inside"},{"line_number":713,"context_line":"        # a v3 protected call).  However, this optimization is probably not"},{"line_number":714,"context_line":"        # worth the duplication of state"},{"line_number":715,"context_line":"        token_ref \u003d utils.get_token_ref(context)"},{"line_number":716,"context_line":""},{"line_number":717,"context_line":"        if token_ref.domain_scoped:"},{"line_number":718,"context_line":"            return token_ref.domain_id"}],"source_content_type":"text/x-python","patch_set":7,"id":"3a50d1a3_57de7ddd","line":715,"in_reply_to":"3a50d1a3_ea1ee90a","updated":"2015-07-23 17:50:03.000000000","message":"Done","commit_id":"b6adc9c353b33bed21bb7201ddabea3a42782b4c"}],"keystone/common/utils.py":[{"author":{"_account_id":13478,"name":"Boris Bobrov","email":"b.bobrov@sap.com","username":"bbobrov"},"change_message_id":"069a24bbfa1b42acc3e1b52916c15971557ee68a","unresolved":false,"context_lines":[{"line_number":508,"context_line":""},{"line_number":509,"context_line":""},{"line_number":510,"context_line":"def get_token_ref(context):"},{"line_number":511,"context_line":"    \u0027\u0027\u0027Retrieves KeystoneToken object from the auth context and returns it."},{"line_number":512,"context_line":""},{"line_number":513,"context_line":"    :param dict context: The request context."},{"line_number":514,"context_line":"    :raises: exception.Unauthorized if auth context cannot be found."}],"source_content_type":"text/x-python","patch_set":5,"id":"3a50d1a3_fa4dd799","line":511,"updated":"2015-07-21 09:09:31.000000000","message":"please use \"\"\", not \u0027\u0027\u0027","commit_id":"65a9754de595f73e5713ea309e62f892e8998e8c"},{"author":{"_account_id":13063,"name":"WEI CHEN","email":"dave.jungler@gmail.com","username":"wei.d.chen"},"change_message_id":"22dcf167357bab21187613eadf840a2771965870","unresolved":false,"context_lines":[{"line_number":508,"context_line":""},{"line_number":509,"context_line":""},{"line_number":510,"context_line":"def get_token_ref(context):"},{"line_number":511,"context_line":"    \u0027\u0027\u0027Retrieves KeystoneToken object from the auth context and returns it."},{"line_number":512,"context_line":""},{"line_number":513,"context_line":"    :param dict context: The request context."},{"line_number":514,"context_line":"    :raises: exception.Unauthorized if auth context cannot be found."}],"source_content_type":"text/x-python","patch_set":5,"id":"3a50d1a3_7b78e92b","line":511,"in_reply_to":"3a50d1a3_2091d099","updated":"2015-07-21 09:38:29.000000000","message":"Found it, https://www.python.org/dev/peps/pep-0257/.\n\nFor consistency, always use \"\"\"triple double quotes\"\"\" around docstrings.","commit_id":"65a9754de595f73e5713ea309e62f892e8998e8c"},{"author":{"_account_id":15225,"name":"Deepti Ramakrishna","email":"deepti.ramakrishna@intel.com","username":"dramakri"},"change_message_id":"f7ca449670f04a1ee599364fa72afccae818de27","unresolved":false,"context_lines":[{"line_number":508,"context_line":""},{"line_number":509,"context_line":""},{"line_number":510,"context_line":"def get_token_ref(context):"},{"line_number":511,"context_line":"    \u0027\u0027\u0027Retrieves KeystoneToken object from the auth context and returns it."},{"line_number":512,"context_line":""},{"line_number":513,"context_line":"    :param dict context: The request context."},{"line_number":514,"context_line":"    :raises: exception.Unauthorized if auth context cannot be found."}],"source_content_type":"text/x-python","patch_set":5,"id":"3a50d1a3_e14c12ca","line":511,"in_reply_to":"3a50d1a3_7b78e92b","updated":"2015-07-22 07:13:18.000000000","message":"Done","commit_id":"65a9754de595f73e5713ea309e62f892e8998e8c"},{"author":{"_account_id":13063,"name":"WEI CHEN","email":"dave.jungler@gmail.com","username":"wei.d.chen"},"change_message_id":"17b8d553168a4be539b221b61040cd5b81201936","unresolved":false,"context_lines":[{"line_number":508,"context_line":""},{"line_number":509,"context_line":""},{"line_number":510,"context_line":"def get_token_ref(context):"},{"line_number":511,"context_line":"    \u0027\u0027\u0027Retrieves KeystoneToken object from the auth context and returns it."},{"line_number":512,"context_line":""},{"line_number":513,"context_line":"    :param dict context: The request context."},{"line_number":514,"context_line":"    :raises: exception.Unauthorized if auth context cannot be found."}],"source_content_type":"text/x-python","patch_set":5,"id":"3a50d1a3_2091d099","line":511,"in_reply_to":"3a50d1a3_fa4dd799","updated":"2015-07-21 09:24:56.000000000","message":"\u0027\u0027\u0027 is also used in other place in this file, see L424 and L361.\nThe doc generated from the source looks okay, but I am not sure if there is any recommendation in any of spec about it.","commit_id":"65a9754de595f73e5713ea309e62f892e8998e8c"},{"author":{"_account_id":13478,"name":"Boris Bobrov","email":"b.bobrov@sap.com","username":"bbobrov"},"change_message_id":"069a24bbfa1b42acc3e1b52916c15971557ee68a","unresolved":false,"context_lines":[{"line_number":510,"context_line":"def get_token_ref(context):"},{"line_number":511,"context_line":"    \u0027\u0027\u0027Retrieves KeystoneToken object from the auth context and returns it."},{"line_number":512,"context_line":""},{"line_number":513,"context_line":"    :param dict context: The request context."},{"line_number":514,"context_line":"    :raises: exception.Unauthorized if auth context cannot be found."},{"line_number":515,"context_line":"    :returns: The KeystoneToken object."},{"line_number":516,"context_line":"    \u0027\u0027\u0027"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a50d1a3_5597fc8f","line":513,"updated":"2015-07-21 09:09:31.000000000","message":"this is not correct syntax. Please use\n\n:param context: ..., :type param: dict\n\nas described on http://stackoverflow.com/questions/5334531/python-documentation-standard-for-docstring","commit_id":"65a9754de595f73e5713ea309e62f892e8998e8c"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"bfd22a4a584d370edf980491e0974da02a3a32fa","unresolved":false,"context_lines":[{"line_number":510,"context_line":"def get_token_ref(context):"},{"line_number":511,"context_line":"    \u0027\u0027\u0027Retrieves KeystoneToken object from the auth context and returns it."},{"line_number":512,"context_line":""},{"line_number":513,"context_line":"    :param dict context: The request context."},{"line_number":514,"context_line":"    :raises: exception.Unauthorized if auth context cannot be found."},{"line_number":515,"context_line":"    :returns: The KeystoneToken object."},{"line_number":516,"context_line":"    \u0027\u0027\u0027"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a50d1a3_92a02845","line":513,"in_reply_to":"3a50d1a3_5597fc8f","updated":"2015-07-21 13:41:36.000000000","message":":param dict context: looks fine to me. The docs we should be using for reference are http://sphinx-doc.org/domains.html#python-signatures , not stackoverflow.","commit_id":"65a9754de595f73e5713ea309e62f892e8998e8c"},{"author":{"_account_id":13478,"name":"Boris Bobrov","email":"b.bobrov@sap.com","username":"bbobrov"},"change_message_id":"f2c92ffb7c9a97aba2569ae25f26a43ce6f34fd1","unresolved":false,"context_lines":[{"line_number":510,"context_line":"def get_token_ref(context):"},{"line_number":511,"context_line":"    \u0027\u0027\u0027Retrieves KeystoneToken object from the auth context and returns it."},{"line_number":512,"context_line":""},{"line_number":513,"context_line":"    :param dict context: The request context."},{"line_number":514,"context_line":"    :raises: exception.Unauthorized if auth context cannot be found."},{"line_number":515,"context_line":"    :returns: The KeystoneToken object."},{"line_number":516,"context_line":"    \u0027\u0027\u0027"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a50d1a3_bf2f2cf5","line":513,"in_reply_to":"3a50d1a3_92a02845","updated":"2015-07-21 14:09:58.000000000","message":"ok, thank you","commit_id":"65a9754de595f73e5713ea309e62f892e8998e8c"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"09127919ee1fe00878f2897aeb3f32967e274007","unresolved":false,"context_lines":[{"line_number":511,"context_line":"    \"\"\"Retrieves KeystoneToken object from the auth context and returns it."},{"line_number":512,"context_line":""},{"line_number":513,"context_line":"    :param dict context: The request context."},{"line_number":514,"context_line":"    :raises: exception.Unauthorized if auth context cannot be found."},{"line_number":515,"context_line":"    :returns: The KeystoneToken object."},{"line_number":516,"context_line":"    \"\"\""},{"line_number":517,"context_line":"    try:"}],"source_content_type":"text/x-python","patch_set":8,"id":"3a50d1a3_8e83c402","line":514,"updated":"2015-07-29 02:22:18.000000000","message":"the : needs to be after the exception,\n\n :raises exception.Unauthorized: if auth context cannot be found.","commit_id":"288a05a4de4b61d32816081f4c2a0f6e2f773cf2"}],"keystone/contrib/oauth1/controllers.py":[{"author":{"_account_id":13063,"name":"WEI CHEN","email":"dave.jungler@gmail.com","username":"wei.d.chen"},"change_message_id":"8742c5cb31ce5aafc14754dedb38a8b45a30c78a","unresolved":false,"context_lines":[{"line_number":84,"context_line":""},{"line_number":85,"context_line":"    @controller.protected()"},{"line_number":86,"context_line":"    def delete_consumer(self, context, consumer_id):"},{"line_number":87,"context_line":"        auth_context \u003d context[\u0027environment\u0027][authorization.AUTH_CONTEXT_ENV]"},{"line_number":88,"context_line":"        user_token_ref \u003d auth_context[\u0027token\u0027]"},{"line_number":89,"context_line":"        payload \u003d {\u0027user_id\u0027: user_token_ref.user_id,"},{"line_number":90,"context_line":"                   \u0027consumer_id\u0027: consumer_id}"}],"source_content_type":"text/x-python","patch_set":2,"id":"1af86dd1_910cd743","line":87,"updated":"2015-06-12 08:22:12.000000000","message":"Is it possible to get some KeyError exception here?","commit_id":"2d9f9036e6362635e01a7a028add6c58d28c3167"},{"author":{"_account_id":15225,"name":"Deepti Ramakrishna","email":"deepti.ramakrishna@intel.com","username":"dramakri"},"change_message_id":"8d943996dd4ff7f2bd41b96c672f549b70ec97b6","unresolved":false,"context_lines":[{"line_number":84,"context_line":""},{"line_number":85,"context_line":"    @controller.protected()"},{"line_number":86,"context_line":"    def delete_consumer(self, context, consumer_id):"},{"line_number":87,"context_line":"        auth_context \u003d context[\u0027environment\u0027][authorization.AUTH_CONTEXT_ENV]"},{"line_number":88,"context_line":"        user_token_ref \u003d auth_context[\u0027token\u0027]"},{"line_number":89,"context_line":"        payload \u003d {\u0027user_id\u0027: user_token_ref.user_id,"},{"line_number":90,"context_line":"                   \u0027consumer_id\u0027: consumer_id}"}],"source_content_type":"text/x-python","patch_set":2,"id":"1af86dd1_09aae4d4","line":87,"in_reply_to":"1af86dd1_910cd743","updated":"2015-06-12 19:40:50.000000000","message":"Dave, since the original code didn\u0027t do any exception handling, I hadn\u0027t put it before. But now, I have added it.","commit_id":"2d9f9036e6362635e01a7a028add6c58d28c3167"},{"author":{"_account_id":13063,"name":"WEI CHEN","email":"dave.jungler@gmail.com","username":"wei.d.chen"},"change_message_id":"8742c5cb31ce5aafc14754dedb38a8b45a30c78a","unresolved":false,"context_lines":[{"line_number":380,"context_line":"            authed_roles.add(role[\u0027id\u0027])"},{"line_number":381,"context_line":""},{"line_number":382,"context_line":"        # verify the authorizing user has the roles"},{"line_number":383,"context_line":"        auth_context \u003d context[\u0027environment\u0027][authorization.AUTH_CONTEXT_ENV]"},{"line_number":384,"context_line":"        user_token \u003d auth_context[\u0027token\u0027]"},{"line_number":385,"context_line":"        user_id \u003d user_token.user_id"},{"line_number":386,"context_line":"        project_id \u003d req_token[\u0027requested_project_id\u0027]"}],"source_content_type":"text/x-python","patch_set":2,"id":"1af86dd1_f51f7659","line":383,"updated":"2015-06-12 08:22:12.000000000","message":"Same here, we\u0027d better to throw KeyError here for consistency.","commit_id":"2d9f9036e6362635e01a7a028add6c58d28c3167"},{"author":{"_account_id":15225,"name":"Deepti Ramakrishna","email":"deepti.ramakrishna@intel.com","username":"dramakri"},"change_message_id":"8d943996dd4ff7f2bd41b96c672f549b70ec97b6","unresolved":false,"context_lines":[{"line_number":380,"context_line":"            authed_roles.add(role[\u0027id\u0027])"},{"line_number":381,"context_line":""},{"line_number":382,"context_line":"        # verify the authorizing user has the roles"},{"line_number":383,"context_line":"        auth_context \u003d context[\u0027environment\u0027][authorization.AUTH_CONTEXT_ENV]"},{"line_number":384,"context_line":"        user_token \u003d auth_context[\u0027token\u0027]"},{"line_number":385,"context_line":"        user_id \u003d user_token.user_id"},{"line_number":386,"context_line":"        project_id \u003d req_token[\u0027requested_project_id\u0027]"}],"source_content_type":"text/x-python","patch_set":2,"id":"1af86dd1_a9b99030","line":383,"in_reply_to":"1af86dd1_f51f7659","updated":"2015-06-12 19:40:50.000000000","message":"Dave, since the original code didn\u0027t do any exception handling, I hadn\u0027t put it before. But now, I have added it.","commit_id":"2d9f9036e6362635e01a7a028add6c58d28c3167"}],"keystone/tests/unit/test_auth.py":[{"author":{"_account_id":13063,"name":"WEI CHEN","email":"dave.jungler@gmail.com","username":"wei.d.chen"},"change_message_id":"8742c5cb31ce5aafc14754dedb38a8b45a30c78a","unresolved":false,"context_lines":[{"line_number":122,"context_line":"        auth_context \u003d authorization.token_to_auth_context(token_ref)"},{"line_number":123,"context_line":"        return {\u0027environment\u0027: {authorization.AUTH_CONTEXT_ENV: auth_context},"},{"line_number":124,"context_line":"                \u0027token_id\u0027: token_id,"},{"line_number":125,"context_line":"                \u0027host_url\u0027: HOST_URL}"},{"line_number":126,"context_line":""},{"line_number":127,"context_line":""},{"line_number":128,"context_line":"class AuthBadRequests(AuthTest):"}],"source_content_type":"text/x-python","patch_set":2,"id":"1af86dd1_352cee49","line":125,"updated":"2015-06-12 08:22:12.000000000","message":"revert it back, no changes here","commit_id":"2d9f9036e6362635e01a7a028add6c58d28c3167"},{"author":{"_account_id":15225,"name":"Deepti Ramakrishna","email":"deepti.ramakrishna@intel.com","username":"dramakri"},"change_message_id":"8d943996dd4ff7f2bd41b96c672f549b70ec97b6","unresolved":false,"context_lines":[{"line_number":122,"context_line":"        auth_context \u003d authorization.token_to_auth_context(token_ref)"},{"line_number":123,"context_line":"        return {\u0027environment\u0027: {authorization.AUTH_CONTEXT_ENV: auth_context},"},{"line_number":124,"context_line":"                \u0027token_id\u0027: token_id,"},{"line_number":125,"context_line":"                \u0027host_url\u0027: HOST_URL}"},{"line_number":126,"context_line":""},{"line_number":127,"context_line":""},{"line_number":128,"context_line":"class AuthBadRequests(AuthTest):"}],"source_content_type":"text/x-python","patch_set":2,"id":"1af86dd1_c9da8c78","line":125,"in_reply_to":"1af86dd1_352cee49","updated":"2015-06-12 19:40:50.000000000","message":"Although there is no change in the code, I wanted the method to be in base class and hence moved it here.","commit_id":"2d9f9036e6362635e01a7a028add6c58d28c3167"},{"author":{"_account_id":13063,"name":"WEI CHEN","email":"dave.jungler@gmail.com","username":"wei.d.chen"},"change_message_id":"119d50e2a2344731b41ae2fa3a536cdbac7d304b","unresolved":false,"context_lines":[{"line_number":122,"context_line":"        auth_context \u003d authorization.token_to_auth_context(token_ref)"},{"line_number":123,"context_line":"        return {\u0027environment\u0027: {authorization.AUTH_CONTEXT_ENV: auth_context},"},{"line_number":124,"context_line":"                \u0027token_id\u0027: token_id,"},{"line_number":125,"context_line":"                \u0027host_url\u0027: HOST_URL}"},{"line_number":126,"context_line":""},{"line_number":127,"context_line":""},{"line_number":128,"context_line":"class AuthBadRequests(AuthTest):"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa32b979_6cc1642e","line":125,"in_reply_to":"1af86dd1_c9da8c78","updated":"2015-06-13 06:58:15.000000000","message":"emm, seems like there will be other unittest referenced with this function in the future.","commit_id":"2d9f9036e6362635e01a7a028add6c58d28c3167"},{"author":{"_account_id":13063,"name":"WEI CHEN","email":"dave.jungler@gmail.com","username":"wei.d.chen"},"change_message_id":"8742c5cb31ce5aafc14754dedb38a8b45a30c78a","unresolved":false,"context_lines":[{"line_number":914,"context_line":"    def test_get_trust(self):"},{"line_number":915,"context_line":"        unscoped_token \u003d self.get_unscoped_token(self.trustor[\u0027name\u0027])"},{"line_number":916,"context_line":"        context \u003d self._create_auth_context("},{"line_number":917,"context_line":"            unscoped_token[\u0027access\u0027][\u0027token\u0027][\u0027id\u0027])"},{"line_number":918,"context_line":"        new_trust \u003d self.trust_controller.create_trust("},{"line_number":919,"context_line":"            context, trust\u003dself.sample_data)[\u0027trust\u0027]"},{"line_number":920,"context_line":"        trust \u003d self.trust_controller.get_trust(context,"}],"source_content_type":"text/x-python","patch_set":2,"id":"1af86dd1_358f4e25","line":917,"updated":"2015-06-12 08:22:12.000000000","message":"Didn\u0027t see any benifit from this refactoring, but it\u0027s a little heavy via calling \u0027_create_auth_context\u0027 instead.","commit_id":"2d9f9036e6362635e01a7a028add6c58d28c3167"},{"author":{"_account_id":13063,"name":"WEI CHEN","email":"dave.jungler@gmail.com","username":"wei.d.chen"},"change_message_id":"119d50e2a2344731b41ae2fa3a536cdbac7d304b","unresolved":false,"context_lines":[{"line_number":914,"context_line":"    def test_get_trust(self):"},{"line_number":915,"context_line":"        unscoped_token \u003d self.get_unscoped_token(self.trustor[\u0027name\u0027])"},{"line_number":916,"context_line":"        context \u003d self._create_auth_context("},{"line_number":917,"context_line":"            unscoped_token[\u0027access\u0027][\u0027token\u0027][\u0027id\u0027])"},{"line_number":918,"context_line":"        new_trust \u003d self.trust_controller.create_trust("},{"line_number":919,"context_line":"            context, trust\u003dself.sample_data)[\u0027trust\u0027]"},{"line_number":920,"context_line":"        trust \u003d self.trust_controller.get_trust(context,"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa32b979_aca0cc91","line":917,"in_reply_to":"1af86dd1_290fe0e2","updated":"2015-06-13 06:58:15.000000000","message":"I am fine with it, but I think the unittest here not intends to test how context is built up but something relevant with trust.\n\nIf we want to test the around auth_context, we may create a new testcase?","commit_id":"2d9f9036e6362635e01a7a028add6c58d28c3167"},{"author":{"_account_id":15225,"name":"Deepti Ramakrishna","email":"deepti.ramakrishna@intel.com","username":"dramakri"},"change_message_id":"8d943996dd4ff7f2bd41b96c672f549b70ec97b6","unresolved":false,"context_lines":[{"line_number":914,"context_line":"    def test_get_trust(self):"},{"line_number":915,"context_line":"        unscoped_token \u003d self.get_unscoped_token(self.trustor[\u0027name\u0027])"},{"line_number":916,"context_line":"        context \u003d self._create_auth_context("},{"line_number":917,"context_line":"            unscoped_token[\u0027access\u0027][\u0027token\u0027][\u0027id\u0027])"},{"line_number":918,"context_line":"        new_trust \u003d self.trust_controller.create_trust("},{"line_number":919,"context_line":"            context, trust\u003dself.sample_data)[\u0027trust\u0027]"},{"line_number":920,"context_line":"        trust \u003d self.trust_controller.get_trust(context,"}],"source_content_type":"text/x-python","patch_set":2,"id":"1af86dd1_290fe0e2","line":917,"in_reply_to":"1af86dd1_358f4e25","updated":"2015-06-12 19:40:50.000000000","message":"The unit test had to be modified to include auth_context in the context object that we pass to the code-under-test to match the changes made therein.","commit_id":"2d9f9036e6362635e01a7a028add6c58d28c3167"},{"author":{"_account_id":13478,"name":"Boris Bobrov","email":"b.bobrov@sap.com","username":"bbobrov"},"change_message_id":"d751da5e8b2b7d5ba89aa7dd35500ced7658cec1","unresolved":false,"context_lines":[{"line_number":913,"context_line":""},{"line_number":914,"context_line":"    def test_get_trust(self):"},{"line_number":915,"context_line":"        unscoped_token \u003d self.get_unscoped_token(self.trustor[\u0027name\u0027])"},{"line_number":916,"context_line":"        context \u003d {\u0027token_id\u0027: unscoped_token[\u0027access\u0027][\u0027token\u0027][\u0027id\u0027],"},{"line_number":917,"context_line":"                   \u0027host_url\u0027: HOST_URL}"},{"line_number":918,"context_line":"        new_trust \u003d self.trust_controller.create_trust("},{"line_number":919,"context_line":"            context, trust\u003dself.sample_data)[\u0027trust\u0027]"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba3cc151_bc1b0cca","side":"PARENT","line":916,"updated":"2015-07-10 12:42:17.000000000","message":"if these lines don\u0027t break the tests, they should be fixed in a separate commit","commit_id":"4730d829c0877936d3e668daf357b20e7b608547"},{"author":{"_account_id":15225,"name":"Deepti Ramakrishna","email":"deepti.ramakrishna@intel.com","username":"dramakri"},"change_message_id":"12d7dc3294647af0edbf7ec6fa95188f05c755b4","unresolved":false,"context_lines":[{"line_number":913,"context_line":""},{"line_number":914,"context_line":"    def test_get_trust(self):"},{"line_number":915,"context_line":"        unscoped_token \u003d self.get_unscoped_token(self.trustor[\u0027name\u0027])"},{"line_number":916,"context_line":"        context \u003d {\u0027token_id\u0027: unscoped_token[\u0027access\u0027][\u0027token\u0027][\u0027id\u0027],"},{"line_number":917,"context_line":"                   \u0027host_url\u0027: HOST_URL}"},{"line_number":918,"context_line":"        new_trust \u003d self.trust_controller.create_trust("},{"line_number":919,"context_line":"            context, trust\u003dself.sample_data)[\u0027trust\u0027]"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a41bdd9_69885023","side":"PARENT","line":916,"in_reply_to":"ba3cc151_bc1b0cca","updated":"2015-07-13 07:04:11.000000000","message":"Without this change, the test would fail. The new code-under-test no longer searches for \u0027token_id\u0027; it now looks for the auth_context itself.","commit_id":"4730d829c0877936d3e668daf357b20e7b608547"},{"author":{"_account_id":13478,"name":"Boris Bobrov","email":"b.bobrov@sap.com","username":"bbobrov"},"change_message_id":"d751da5e8b2b7d5ba89aa7dd35500ced7658cec1","unresolved":false,"context_lines":[{"line_number":115,"context_line":""},{"line_number":116,"context_line":"        return self.assertDictEqual(normalize(a), normalize(b))"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"    def _create_auth_context(self, token_id):"},{"line_number":119,"context_line":"        token_ref \u003d token_model.KeystoneToken("},{"line_number":120,"context_line":"            token_id\u003dtoken_id,"},{"line_number":121,"context_line":"            token_data\u003dself.token_provider_api.validate_token(token_id))"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba3cc151_7ce024cd","line":118,"updated":"2015-07-10 12:42:17.000000000","message":"since the patch is in merge conflict...\nis there any reason to move the function here? If no, it should be put back where it was.","commit_id":"bfc4b728997cc0e083bc9ef824eb506da231126c"},{"author":{"_account_id":15225,"name":"Deepti Ramakrishna","email":"deepti.ramakrishna@intel.com","username":"dramakri"},"change_message_id":"12d7dc3294647af0edbf7ec6fa95188f05c755b4","unresolved":false,"context_lines":[{"line_number":115,"context_line":""},{"line_number":116,"context_line":"        return self.assertDictEqual(normalize(a), normalize(b))"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"    def _create_auth_context(self, token_id):"},{"line_number":119,"context_line":"        token_ref \u003d token_model.KeystoneToken("},{"line_number":120,"context_line":"            token_id\u003dtoken_id,"},{"line_number":121,"context_line":"            token_data\u003dself.token_provider_api.validate_token(token_id))"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a41bdd9_09f744d4","line":118,"in_reply_to":"9a41bdd9_d31054ab","updated":"2015-07-13 07:04:11.000000000","message":"Done. For some reason, I thought that the test I modified (test_get_trust()) and this method were in peer-subclasses. But looks like they are not. So, moved this method back to its original location.","commit_id":"bfc4b728997cc0e083bc9ef824eb506da231126c"},{"author":{"_account_id":7725,"name":"David Stanek","email":"dstanek@dstanek.com","username":"dstanek"},"change_message_id":"c78b5330a4f1d91e077eaf2a49b4fda9a5445798","unresolved":false,"context_lines":[{"line_number":115,"context_line":""},{"line_number":116,"context_line":"        return self.assertDictEqual(normalize(a), normalize(b))"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"    def _create_auth_context(self, token_id):"},{"line_number":119,"context_line":"        token_ref \u003d token_model.KeystoneToken("},{"line_number":120,"context_line":"            token_id\u003dtoken_id,"},{"line_number":121,"context_line":"            token_data\u003dself.token_provider_api.validate_token(token_id))"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a41bdd9_d31054ab","line":118,"in_reply_to":"ba3cc151_0d9d240a","updated":"2015-07-11 02:52:31.000000000","message":"I don\u0027t think it should be done at all. It is the exact opposite of my philosophy of moving things closer to where they are used.","commit_id":"bfc4b728997cc0e083bc9ef824eb506da231126c"},{"author":{"_account_id":13063,"name":"WEI CHEN","email":"dave.jungler@gmail.com","username":"wei.d.chen"},"change_message_id":"16581d6dac321f2fd880e28f75ccfcae62759c39","unresolved":false,"context_lines":[{"line_number":115,"context_line":""},{"line_number":116,"context_line":"        return self.assertDictEqual(normalize(a), normalize(b))"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"    def _create_auth_context(self, token_id):"},{"line_number":119,"context_line":"        token_ref \u003d token_model.KeystoneToken("},{"line_number":120,"context_line":"            token_id\u003dtoken_id,"},{"line_number":121,"context_line":"            token_data\u003dself.token_provider_api.validate_token(token_id))"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba3cc151_cd93bc5b","line":118,"in_reply_to":"ba3cc151_7ce024cd","updated":"2015-07-10 13:30:36.000000000","message":"I asked the same question, pls see her reply in PS2, the method here is somehow better than original place although it\u0027s not referenced in other place.","commit_id":"bfc4b728997cc0e083bc9ef824eb506da231126c"},{"author":{"_account_id":13478,"name":"Boris Bobrov","email":"b.bobrov@sap.com","username":"bbobrov"},"change_message_id":"399a968a267ddbc55434985af667553d76e9c935","unresolved":false,"context_lines":[{"line_number":115,"context_line":""},{"line_number":116,"context_line":"        return self.assertDictEqual(normalize(a), normalize(b))"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"    def _create_auth_context(self, token_id):"},{"line_number":119,"context_line":"        token_ref \u003d token_model.KeystoneToken("},{"line_number":120,"context_line":"            token_id\u003dtoken_id,"},{"line_number":121,"context_line":"            token_data\u003dself.token_provider_api.validate_token(token_id))"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba3cc151_0d9d240a","line":118,"in_reply_to":"ba3cc151_cd93bc5b","updated":"2015-07-10 13:33:23.000000000","message":"then it should be done in a separate patch","commit_id":"bfc4b728997cc0e083bc9ef824eb506da231126c"}],"keystone/trust/controllers.py":[{"author":{"_account_id":13478,"name":"Boris Bobrov","email":"b.bobrov@sap.com","username":"bbobrov"},"change_message_id":"069a24bbfa1b42acc3e1b52916c15971557ee68a","unresolved":false,"context_lines":[{"line_number":65,"context_line":"    def _get_user_id(self, context):"},{"line_number":66,"context_line":"        try:"},{"line_number":67,"context_line":"            token_ref \u003d utils.get_token_ref(context)"},{"line_number":68,"context_line":"        except exception.Unauthorized():"},{"line_number":69,"context_line":"            return None"},{"line_number":70,"context_line":"        return token_ref.user_id"},{"line_number":71,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"3a50d1a3_b5b9a07b","line":68,"updated":"2015-07-21 09:09:31.000000000","message":"() are not necessary after Unauthorized. http://paste.openstack.org/show/394927/.\n\nIt means that with your patchset exception raised by get_token_ref is not being caught (or is not raised at all), however the tests still pass. Could you please check, that this works as expected and write a test for it?","commit_id":"65a9754de595f73e5713ea309e62f892e8998e8c"},{"author":{"_account_id":15225,"name":"Deepti Ramakrishna","email":"deepti.ramakrishna@intel.com","username":"dramakri"},"change_message_id":"f7ca449670f04a1ee599364fa72afccae818de27","unresolved":false,"context_lines":[{"line_number":65,"context_line":"    def _get_user_id(self, context):"},{"line_number":66,"context_line":"        try:"},{"line_number":67,"context_line":"            token_ref \u003d utils.get_token_ref(context)"},{"line_number":68,"context_line":"        except exception.Unauthorized():"},{"line_number":69,"context_line":"            return None"},{"line_number":70,"context_line":"        return token_ref.user_id"},{"line_number":71,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"3a50d1a3_619d6209","line":68,"in_reply_to":"3a50d1a3_b5b9a07b","updated":"2015-07-22 07:13:18.000000000","message":"I created a test for this in a separate patch. (Please see - https://review.openstack.org/#/c/204461/). I verified that the new test fails with Unauthorized() but pass with Unauthorized.","commit_id":"65a9754de595f73e5713ea309e62f892e8998e8c"},{"author":{"_account_id":13063,"name":"WEI CHEN","email":"dave.jungler@gmail.com","username":"wei.d.chen"},"change_message_id":"57cfa3008f5ddca2227407fd97c3fd9d05ac8a3c","unresolved":false,"context_lines":[{"line_number":66,"context_line":"        try:"},{"line_number":67,"context_line":"            token_ref \u003d utils.get_token_ref(context)"},{"line_number":68,"context_line":"        except exception.Unauthorized():"},{"line_number":69,"context_line":"            return None"},{"line_number":70,"context_line":"        return token_ref.user_id"},{"line_number":71,"context_line":""},{"line_number":72,"context_line":"    def get_trust(self, context, trust_id):"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a50d1a3_7a36a7e8","line":69,"updated":"2015-07-21 08:36:49.000000000","message":"maybe we need fallback to build the KeystoneToken if we cannot get the token_ref from AuthContextMiddleware?\n\nSince AuthContextMiddleware in the pipeline is before service, this may not necessary.","commit_id":"65a9754de595f73e5713ea309e62f892e8998e8c"},{"author":{"_account_id":15225,"name":"Deepti Ramakrishna","email":"deepti.ramakrishna@intel.com","username":"dramakri"},"change_message_id":"f7ca449670f04a1ee599364fa72afccae818de27","unresolved":false,"context_lines":[{"line_number":66,"context_line":"        try:"},{"line_number":67,"context_line":"            token_ref \u003d utils.get_token_ref(context)"},{"line_number":68,"context_line":"        except exception.Unauthorized():"},{"line_number":69,"context_line":"            return None"},{"line_number":70,"context_line":"        return token_ref.user_id"},{"line_number":71,"context_line":""},{"line_number":72,"context_line":"    def get_trust(self, context, trust_id):"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a50d1a3_e17f32a9","line":69,"in_reply_to":"3a50d1a3_7a36a7e8","updated":"2015-07-22 07:13:18.000000000","message":"As the patch description says, AuthContextMiddleware is one of the earliest middlewares in the pipeline, and so we can assume that the auth context has been built by the time control reaches this code.","commit_id":"65a9754de595f73e5713ea309e62f892e8998e8c"}]}
