)]}'
{"mistralclient/api/v2/client.py":[{"author":{"_account_id":9029,"name":"Moshe Elisha","email":"moshe.elisha@nokia.com","username":"MosheElisha"},"change_message_id":"11cb8ec26fc041a951052803ceac558b183d78bb","unresolved":false,"context_lines":[{"line_number":86,"context_line":"                project_id \u003d project_name"},{"line_number":87,"context_line":"            else:"},{"line_number":88,"context_line":"                raise RuntimeError("},{"line_number":89,"context_line":"                    \u0027Invalid authentication type: %s\u0027 % auth_type"},{"line_number":90,"context_line":"                )"},{"line_number":91,"context_line":""},{"line_number":92,"context_line":"        if not mistral_url:"}],"source_content_type":"text/x-python","patch_set":7,"id":"1aa78d24_c66c1a9f","line":89,"updated":"2016-07-03 08:20:37.000000000","message":"Soft: Maybe also add the possible values (auth_types.ALL)?","commit_id":"3dc8acc94b8506a02482cf95e2a70f774e6605fc"},{"author":{"_account_id":8731,"name":"Renat Akhmerov","email":"renat.akhmerov@gmail.com","username":"rakhmerov"},"change_message_id":"0bd4f15aebf8e7e70120eef23b81579d16f1456c","unresolved":false,"context_lines":[{"line_number":86,"context_line":"                project_id \u003d project_name"},{"line_number":87,"context_line":"            else:"},{"line_number":88,"context_line":"                raise RuntimeError("},{"line_number":89,"context_line":"                    \u0027Invalid authentication type: %s\u0027 % auth_type"},{"line_number":90,"context_line":"                )"},{"line_number":91,"context_line":""},{"line_number":92,"context_line":"        if not mistral_url:"}],"source_content_type":"text/x-python","patch_set":7,"id":"1aa78d24_9a209a4b","line":89,"in_reply_to":"1aa78d24_c66c1a9f","updated":"2016-07-04 04:24:39.000000000","message":"Yes, good point.","commit_id":"3dc8acc94b8506a02482cf95e2a70f774e6605fc"}],"mistralclient/auth/keycloak.py":[{"author":{"_account_id":9029,"name":"Moshe Elisha","email":"moshe.elisha@nokia.com","username":"MosheElisha"},"change_message_id":"11cb8ec26fc041a951052803ceac558b183d78bb","unresolved":false,"context_lines":[{"line_number":112,"context_line":"    )"},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"    if resp.status_code not in range(200, 299):"},{"line_number":115,"context_line":"        raise Exception(\"Failed to get access token:\\n %s\" % resp.content)"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"    LOG.debug("},{"line_number":118,"context_line":"        \"HTTP response from OIDC provider: %s\" % pprint.pformat(resp.json())"}],"source_content_type":"text/x-python","patch_set":7,"id":"1aa78d24_a6690e8e","line":115,"updated":"2016-07-03 08:20:37.000000000","message":"Please add more info about response. For example, resp.status_code\nThere is also Response.raise_for_status() but I am not sure it includes the resp body which I think important","commit_id":"3dc8acc94b8506a02482cf95e2a70f774e6605fc"},{"author":{"_account_id":8731,"name":"Renat Akhmerov","email":"renat.akhmerov@gmail.com","username":"rakhmerov"},"change_message_id":"0bd4f15aebf8e7e70120eef23b81579d16f1456c","unresolved":false,"context_lines":[{"line_number":112,"context_line":"    )"},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"    if resp.status_code not in range(200, 299):"},{"line_number":115,"context_line":"        raise Exception(\"Failed to get access token:\\n %s\" % resp.content)"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"    LOG.debug("},{"line_number":118,"context_line":"        \"HTTP response from OIDC provider: %s\" % pprint.pformat(resp.json())"}],"source_content_type":"text/x-python","patch_set":7,"id":"1aa78d24_ba00f6ab","line":115,"in_reply_to":"1aa78d24_a6690e8e","updated":"2016-07-04 04:24:39.000000000","message":"Yes, agree.","commit_id":"3dc8acc94b8506a02482cf95e2a70f774e6605fc"},{"author":{"_account_id":21970,"name":"Andras Kovi","email":"akovi@nokia.com","username":"andras.kovi"},"change_message_id":"f6f0df6c9b9f629ba39c952cb4b4040ea077e720","unresolved":false,"context_lines":[{"line_number":117,"context_line":"        raise Exception(\"Failed to get access token:\\n %s\" % str(e))"},{"line_number":118,"context_line":""},{"line_number":119,"context_line":"    LOG.debug("},{"line_number":120,"context_line":"        \"HTTP response from OIDC provider: %s\" % pprint.pformat(resp.json())"},{"line_number":121,"context_line":"    )"},{"line_number":122,"context_line":""},{"line_number":123,"context_line":"    return resp.json()[\u0027access_token\u0027]"}],"source_content_type":"text/x-python","patch_set":8,"id":"1aa78d24_32e26ad6","line":120,"updated":"2016-07-04 07:46:09.000000000","message":"THANK YOU! It\u0027s so annoying that service clients do not pp the responses.","commit_id":"f7c04df5ec07426a97ff8a0fa72b718ef8e84cbd"},{"author":{"_account_id":8731,"name":"Renat Akhmerov","email":"renat.akhmerov@gmail.com","username":"rakhmerov"},"change_message_id":"8027686e53e01f8bad0650e358b92826c0f8b64e","unresolved":false,"context_lines":[{"line_number":117,"context_line":"        raise Exception(\"Failed to get access token:\\n %s\" % str(e))"},{"line_number":118,"context_line":""},{"line_number":119,"context_line":"    LOG.debug("},{"line_number":120,"context_line":"        \"HTTP response from OIDC provider: %s\" % pprint.pformat(resp.json())"},{"line_number":121,"context_line":"    )"},{"line_number":122,"context_line":""},{"line_number":123,"context_line":"    return resp.json()[\u0027access_token\u0027]"}],"source_content_type":"text/x-python","patch_set":8,"id":"1aa78d24_3879a994","line":120,"in_reply_to":"1aa78d24_32e26ad6","updated":"2016-07-04 08:20:17.000000000","message":"No problem :)","commit_id":"f7c04df5ec07426a97ff8a0fa72b718ef8e84cbd"},{"author":{"_account_id":16358,"name":"Tomer Shtilman","email":"tomer.shtilman@nokia.com","username":"tshtilma"},"change_message_id":"e6e3734ad6c7232767ccb7614ba827f9f124c770","unresolved":false,"context_lines":[{"line_number":128,"context_line":"if __name__ \u003d\u003d \u0027__main__\u0027:"},{"line_number":129,"context_line":"    print(\"Using username/password to get access token from KeyCloak...\")"},{"line_number":130,"context_line":""},{"line_number":131,"context_line":"    a_token \u003d authenticate("},{"line_number":132,"context_line":"        \"https://my.keycloak:8443/auth\","},{"line_number":133,"context_line":"        client_id\u003d\"mistral_client\","},{"line_number":134,"context_line":"        client_secret\u003d\"4a080907-921b-409a-b793-c431609c3a47\","}],"source_content_type":"text/x-python","patch_set":8,"id":"1aa78d24_b09c976a","line":131,"updated":"2016-07-04 06:38:26.000000000","message":"does this main method should stay here?","commit_id":"f7c04df5ec07426a97ff8a0fa72b718ef8e84cbd"},{"author":{"_account_id":21970,"name":"Andras Kovi","email":"akovi@nokia.com","username":"andras.kovi"},"change_message_id":"f6f0df6c9b9f629ba39c952cb4b4040ea077e720","unresolved":false,"context_lines":[{"line_number":128,"context_line":"if __name__ \u003d\u003d \u0027__main__\u0027:"},{"line_number":129,"context_line":"    print(\"Using username/password to get access token from KeyCloak...\")"},{"line_number":130,"context_line":""},{"line_number":131,"context_line":"    a_token \u003d authenticate("},{"line_number":132,"context_line":"        \"https://my.keycloak:8443/auth\","},{"line_number":133,"context_line":"        client_id\u003d\"mistral_client\","},{"line_number":134,"context_line":"        client_secret\u003d\"4a080907-921b-409a-b793-c431609c3a47\","}],"source_content_type":"text/x-python","patch_set":8,"id":"1aa78d24_32654a45","line":131,"in_reply_to":"1aa78d24_2becbac6","updated":"2016-07-04 07:46:09.000000000","message":"I think the problem with this approach is that the this code is never run. Who knows if it works or if it\u0027s in sync with reality. Though, I see this is an easy way to give a tiny tutorial.","commit_id":"f7c04df5ec07426a97ff8a0fa72b718ef8e84cbd"},{"author":{"_account_id":8731,"name":"Renat Akhmerov","email":"renat.akhmerov@gmail.com","username":"rakhmerov"},"change_message_id":"9dc89af5efd8950083c1ed8fe561315abed44ea8","unresolved":false,"context_lines":[{"line_number":128,"context_line":"if __name__ \u003d\u003d \u0027__main__\u0027:"},{"line_number":129,"context_line":"    print(\"Using username/password to get access token from KeyCloak...\")"},{"line_number":130,"context_line":""},{"line_number":131,"context_line":"    a_token \u003d authenticate("},{"line_number":132,"context_line":"        \"https://my.keycloak:8443/auth\","},{"line_number":133,"context_line":"        client_id\u003d\"mistral_client\","},{"line_number":134,"context_line":"        client_secret\u003d\"4a080907-921b-409a-b793-c431609c3a47\","}],"source_content_type":"text/x-python","patch_set":8,"id":"1aa78d24_2becbac6","line":131,"in_reply_to":"1aa78d24_b09c976a","updated":"2016-07-04 06:45:08.000000000","message":"Yeah, people often do this to show a usage example. No harm from having it.","commit_id":"f7c04df5ec07426a97ff8a0fa72b718ef8e84cbd"}],"mistralclient/auth/keystone.py":[{"author":{"_account_id":21970,"name":"Andras Kovi","email":"akovi@nokia.com","username":"andras.kovi"},"change_message_id":"f6f0df6c9b9f629ba39c952cb4b4040ea077e720","unresolved":false,"context_lines":[{"line_number":13,"context_line":"#    limitations under the License."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"def authenticate(mistral_url\u003dNone, username\u003dNone,"},{"line_number":17,"context_line":"                 api_key\u003dNone, project_name\u003dNone, auth_url\u003dNone,"},{"line_number":18,"context_line":"                 project_id\u003dNone, endpoint_type\u003d\u0027publicURL\u0027,"},{"line_number":19,"context_line":"                 service_type\u003d\u0027workflowv2\u0027, auth_token\u003dNone, user_id\u003dNone,"}],"source_content_type":"text/x-python","patch_set":8,"id":"1aa78d24_b23e5ab6","line":16,"range":{"start_line":16,"start_character":0,"end_line":16,"end_character":48},"updated":"2016-07-04 07:46:09.000000000","message":"this seems to be a general keystone client authentication code that calculates the public/some endpoint of a service. Isn\u0027t there some oslo.* library with the same functionality? This should be something that is required for all clients.","commit_id":"f7c04df5ec07426a97ff8a0fa72b718ef8e84cbd"},{"author":{"_account_id":8731,"name":"Renat Akhmerov","email":"renat.akhmerov@gmail.com","username":"rakhmerov"},"change_message_id":"8027686e53e01f8bad0650e358b92826c0f8b64e","unresolved":false,"context_lines":[{"line_number":13,"context_line":"#    limitations under the License."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"def authenticate(mistral_url\u003dNone, username\u003dNone,"},{"line_number":17,"context_line":"                 api_key\u003dNone, project_name\u003dNone, auth_url\u003dNone,"},{"line_number":18,"context_line":"                 project_id\u003dNone, endpoint_type\u003d\u0027publicURL\u0027,"},{"line_number":19,"context_line":"                 service_type\u003d\u0027workflowv2\u0027, auth_token\u003dNone, user_id\u003dNone,"}],"source_content_type":"text/x-python","patch_set":8,"id":"1aa78d24_b8f639d5","line":16,"range":{"start_line":16,"start_character":0,"end_line":16,"end_character":48},"in_reply_to":"1aa78d24_b23e5ab6","updated":"2016-07-04 08:20:17.000000000","message":"Andras, this whole Keystone authentication piece is not up to date with the current Keystone guidelines. For example, we need to be using sessions and auth methods instead authenticate() method. I\u0027m planning to get it up to date later. It\u0027s not in the scope of this patch. I just moved this part into a separate module for now.","commit_id":"f7c04df5ec07426a97ff8a0fa72b718ef8e84cbd"},{"author":{"_account_id":21970,"name":"Andras Kovi","email":"akovi@nokia.com","username":"andras.kovi"},"change_message_id":"f6f0df6c9b9f629ba39c952cb4b4040ea077e720","unresolved":false,"context_lines":[{"line_number":51,"context_line":"    project_id \u003d keystone.project_id"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"    if not mistral_url:"},{"line_number":54,"context_line":"        catalog \u003d keystone.service_catalog.get_endpoints("},{"line_number":55,"context_line":"            service_type\u003dservice_type,"},{"line_number":56,"context_line":"            endpoint_type\u003dendpoint_type"},{"line_number":57,"context_line":"        )"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"        if service_type in catalog:"},{"line_number":60,"context_line":"            service \u003d catalog.get(service_type)"},{"line_number":61,"context_line":"            mistral_url \u003d service[0].get("},{"line_number":62,"context_line":"                endpoint_type) if service else None"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"    return mistral_url, token, project_id, user_id"},{"line_number":65,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"1aa78d24_6f17ed51","line":62,"range":{"start_line":54,"start_character":0,"end_line":62,"end_character":51},"updated":"2016-07-04 07:46:09.000000000","message":"from a programming perspective, this is a function that should return a value rather than modify some mutable state. Would it hurt if this logic was extracted in a function?","commit_id":"f7c04df5ec07426a97ff8a0fa72b718ef8e84cbd"},{"author":{"_account_id":8731,"name":"Renat Akhmerov","email":"renat.akhmerov@gmail.com","username":"rakhmerov"},"change_message_id":"8027686e53e01f8bad0650e358b92826c0f8b64e","unresolved":false,"context_lines":[{"line_number":51,"context_line":"    project_id \u003d keystone.project_id"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"    if not mistral_url:"},{"line_number":54,"context_line":"        catalog \u003d keystone.service_catalog.get_endpoints("},{"line_number":55,"context_line":"            service_type\u003dservice_type,"},{"line_number":56,"context_line":"            endpoint_type\u003dendpoint_type"},{"line_number":57,"context_line":"        )"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"        if service_type in catalog:"},{"line_number":60,"context_line":"            service \u003d catalog.get(service_type)"},{"line_number":61,"context_line":"            mistral_url \u003d service[0].get("},{"line_number":62,"context_line":"                endpoint_type) if service else None"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"    return mistral_url, token, project_id, user_id"},{"line_number":65,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"1aa78d24_f81721eb","line":62,"range":{"start_line":54,"start_character":0,"end_line":62,"end_character":51},"in_reply_to":"1aa78d24_6f17ed51","updated":"2016-07-04 08:20:17.000000000","message":"Agree. Let\u0027s address it separately (see my previous comment).","commit_id":"f7c04df5ec07426a97ff8a0fa72b718ef8e84cbd"}]}
