)]}'
{"doc/source/client-api.rst":[{"author":{"_account_id":597,"name":"Pete Zaitcev","email":"zaitcev@kotori.zaitcev.us","username":"zaitcev"},"change_message_id":"13700efd88e09a35f74e40e9e282bfc6a6528536","unresolved":false,"context_lines":[{"line_number":23,"context_line":""},{"line_number":24,"context_line":".. code-block:: python"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"    from keystoneauth1 import session"},{"line_number":27,"context_line":"    from keystoneauth1 import v3"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"    # Create a password auth plugin"}],"source_content_type":"text/x-rst","patch_set":8,"id":"fa6399be_72808747","line":26,"updated":"2016-10-18 00:53:09.000000000","message":"ImportError: No module named keystoneauth1","commit_id":"73e4296a389893c750f7c70a477ec828e4360197"}],"swiftclient/client.py":[{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"2e507b6758ef165bb086285b5d171bb285032bef","unresolved":false,"context_lines":[{"line_number":1536,"context_line":"                if self.attempts \u003e self.retries or err.http_status is None:"},{"line_number":1537,"context_line":"                    logger.exception(err)"},{"line_number":1538,"context_line":"                    raise"},{"line_number":1539,"context_line":"                if err.http_status \u003d\u003d 401:"},{"line_number":1540,"context_line":"                    self.url \u003d self.token \u003d self.service_token \u003d None"},{"line_number":1541,"context_line":"                    if retried_auth or not all((self.authurl,"},{"line_number":1542,"context_line":"                                                self.user,"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba0121b8_3d013306","line":1539,"range":{"start_line":1539,"start_character":19,"end_line":1539,"end_character":41},"updated":"2016-03-30 17:08:36.000000000","message":"With a session, this block won\u0027t do the right thing. We should change the re-raise condition and add something like\n\n if self.session:\n     self.session.invalidate()\n\n...although that will get a little racy if you\u0027re sharing a Keystone session between multiple Swift connections.","commit_id":"ad8d4ed1e16a95b26c00a17bc1cce5a5ab636ff7"},{"author":{"_account_id":15742,"name":"Paulo Ewerton Gomes Fragoso","email":"pauloewerton@lsd.ufcg.edu.br","username":"pauloewerton"},"change_message_id":"ac9ca82694154f1e4c0023d9978a6beb5b097a2f","unresolved":false,"context_lines":[{"line_number":1536,"context_line":"                if self.attempts \u003e self.retries or err.http_status is None:"},{"line_number":1537,"context_line":"                    logger.exception(err)"},{"line_number":1538,"context_line":"                    raise"},{"line_number":1539,"context_line":"                if err.http_status \u003d\u003d 401:"},{"line_number":1540,"context_line":"                    self.url \u003d self.token \u003d self.service_token \u003d None"},{"line_number":1541,"context_line":"                    if retried_auth or not all((self.authurl,"},{"line_number":1542,"context_line":"                                                self.user,"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba0121b8_e5ad24ea","line":1539,"range":{"start_line":1539,"start_character":19,"end_line":1539,"end_character":41},"in_reply_to":"ba0121b8_3d013306","updated":"2016-03-31 19:29:50.000000000","message":"Done","commit_id":"ad8d4ed1e16a95b26c00a17bc1cce5a5ab636ff7"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"def92a77d627120cea0ed17becb064af0148f2af","unresolved":false,"context_lines":[{"line_number":1541,"context_line":"                    if self.session:"},{"line_number":1542,"context_line":"                        invalid_sess \u003d self.session.invalidate()"},{"line_number":1543,"context_line":"                    self.url \u003d self.token \u003d self.service_token \u003d None"},{"line_number":1544,"context_line":"                    if retried_auth or invalid_sess or not all((self.authurl,"},{"line_number":1545,"context_line":"                                                                self.user,"},{"line_number":1546,"context_line":"                                                                self.key)):"},{"line_number":1547,"context_line":"                        logger.exception(err)"}],"source_content_type":"text/x-python","patch_set":5,"id":"ba0121b8_c1372d4b","line":1544,"range":{"start_line":1544,"start_character":39,"end_line":1544,"end_character":51},"updated":"2016-03-31 22:19:42.000000000","message":"We want\n\n  not invalid_sess\n\nright? session.invalidate() will return True if it\u0027s worth trying again and False if we should just fail immediately.","commit_id":"ef10d97f3f07525052a712c0b4d433e53c3ad09e"},{"author":{"_account_id":9216,"name":"Joel Wright","email":"joel.wright@gmail.com","username":"jjw-sohonet"},"change_message_id":"c0d013ae0a3da9f8942d484747bd1064d2b8cf6e","unresolved":false,"context_lines":[{"line_number":621,"context_line":""},{"line_number":622,"context_line":"    if session:"},{"line_number":623,"context_line":"        service_type \u003d os_options.get(\u0027service_type\u0027, \u0027object-store\u0027)"},{"line_number":624,"context_line":"        interface \u003d os_options.get(\u0027endpoint_type\u0027, \u0027public\u0027)"},{"line_number":625,"context_line":"        storage_url \u003d session.get_endpoint(service_type\u003dservice_type,"},{"line_number":626,"context_line":"                                           interface\u003dinterface)"},{"line_number":627,"context_line":"        token \u003d session.get_token()"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba5da102_87c5f05c","line":624,"range":{"start_line":624,"start_character":36,"end_line":624,"end_character":49},"updated":"2016-10-26 09:54:37.000000000","message":"Nit: Is this key name defined by keystoneauth1? Using \u0027endpoint_type\u0027 as the key to get the value of endpoint-\u003einterface then assigning it to a variable named \u0027interface\u0027 is a little confusing.","commit_id":"73e4296a389893c750f7c70a477ec828e4360197"},{"author":{"_account_id":9216,"name":"Joel Wright","email":"joel.wright@gmail.com","username":"jjw-sohonet"},"change_message_id":"c0d013ae0a3da9f8942d484747bd1064d2b8cf6e","unresolved":false,"context_lines":[{"line_number":663,"context_line":"                                               auth_version\u003dauth_version)"},{"line_number":664,"context_line":"    else:"},{"line_number":665,"context_line":"        raise ClientException(\u0027Unknown auth_version %s specified and no \u0027"},{"line_number":666,"context_line":"                              \u0027session found.\u0027 % auth_version)"},{"line_number":667,"context_line":""},{"line_number":668,"context_line":"    # Override storage url, if necessary"},{"line_number":669,"context_line":"    if os_options.get(\u0027object_storage_url\u0027):"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba5da102_27950440","line":666,"range":{"start_line":666,"start_character":39,"end_line":666,"end_character":44},"updated":"2016-10-26 09:54:37.000000000","message":"Nit: Is \u0027session found\u0027 really correct? \u0027session provided\u0027 would seemto make more sense.","commit_id":"73e4296a389893c750f7c70a477ec828e4360197"},{"author":{"_account_id":7191,"name":"Jamie Lennox","email":"jamielennox@gmail.com","username":"jamielennox"},"change_message_id":"11c713c7bef6fcaecbec81da3f822e9c2c629c4d","unresolved":false,"context_lines":[{"line_number":1422,"context_line":"                 os_options\u003dNone, auth_version\u003d\"1\", cacert\u003dNone,"},{"line_number":1423,"context_line":"                 insecure\u003dFalse, cert\u003dNone, cert_key\u003dNone,"},{"line_number":1424,"context_line":"                 ssl_compression\u003dTrue, retry_on_ratelimit\u003dFalse,"},{"line_number":1425,"context_line":"                 timeout\u003dNone, session\u003dNone):"},{"line_number":1426,"context_line":"        \"\"\""},{"line_number":1427,"context_line":"        :param authurl: authentication URL"},{"line_number":1428,"context_line":"        :param user: user name to authenticate as"}],"source_content_type":"text/x-python","patch_set":8,"id":"9abb7d3a_fb041f7f","line":1425,"range":{"start_line":1425,"start_character":43,"end_line":1425,"end_character":45},"updated":"2016-05-31 01:02:04.000000000","message":"So what\u0027s the chance here we could create a keystoneauth adapter here to support all the other options? [1]\n\nsession is a global object shared by lots of clients and so adapter is a wrapper around it that clients create and use that is specific to their service.\n\nSo we could do something like: \n\n# no direct dependency on keystoneauth \ntry: \n    from keystoneauth1 import adapter\nexcept ImportError: \n    adapter \u003d None\n\n...\n\nif session and not adapter:\n    raise RuntimeError(\"You passed a session but keystoneauth is not available - wtf?\") \nelif session:\n    self._adapter \u003d adapter.Adapter(session, **kwargs) \nelse:\n    self._adapter \u003d None\n\nthen just use the _adapter in Connection.get_auth and ignore module get_auth above (which would seem to be the deprecated form).\n\nThis would correctly support things like interfaces, regions, user_agent etc\n\n[1] https://github.com/openstack/keystoneauth/blob/master/keystoneauth1/adapter.py#L51","commit_id":"73e4296a389893c750f7c70a477ec828e4360197"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"235542a23660fc93c71cd3755296a4f2d6934cc1","unresolved":false,"context_lines":[{"line_number":1422,"context_line":"                 os_options\u003dNone, auth_version\u003d\"1\", cacert\u003dNone,"},{"line_number":1423,"context_line":"                 insecure\u003dFalse, cert\u003dNone, cert_key\u003dNone,"},{"line_number":1424,"context_line":"                 ssl_compression\u003dTrue, retry_on_ratelimit\u003dFalse,"},{"line_number":1425,"context_line":"                 timeout\u003dNone, session\u003dNone):"},{"line_number":1426,"context_line":"        \"\"\""},{"line_number":1427,"context_line":"        :param authurl: authentication URL"},{"line_number":1428,"context_line":"        :param user: user name to authenticate as"}],"source_content_type":"text/x-python","patch_set":8,"id":"7aa08908_82cef12b","line":1425,"range":{"start_line":1425,"start_character":43,"end_line":1425,"end_character":45},"in_reply_to":"9abb7d3a_247bc729","updated":"2016-06-08 00:33:49.000000000","message":"Long term, I think swiftclient definitely should include a keystoneauth dependency. The way Jamie\u0027s proposed wouldn\u0027t even require that, though, and we could probably hold off until we\u0027re actually instantiating Sessions ourselves.\n\nI\u0027ll look at how to use the adapter...","commit_id":"73e4296a389893c750f7c70a477ec828e4360197"},{"author":{"_account_id":15742,"name":"Paulo Ewerton Gomes Fragoso","email":"pauloewerton@lsd.ufcg.edu.br","username":"pauloewerton"},"change_message_id":"5e895aaf428beb8975bf8607cae1ff109f44fcc4","unresolved":false,"context_lines":[{"line_number":1422,"context_line":"                 os_options\u003dNone, auth_version\u003d\"1\", cacert\u003dNone,"},{"line_number":1423,"context_line":"                 insecure\u003dFalse, cert\u003dNone, cert_key\u003dNone,"},{"line_number":1424,"context_line":"                 ssl_compression\u003dTrue, retry_on_ratelimit\u003dFalse,"},{"line_number":1425,"context_line":"                 timeout\u003dNone, session\u003dNone):"},{"line_number":1426,"context_line":"        \"\"\""},{"line_number":1427,"context_line":"        :param authurl: authentication URL"},{"line_number":1428,"context_line":"        :param user: user name to authenticate as"}],"source_content_type":"text/x-python","patch_set":8,"id":"9abb7d3a_247bc729","line":1425,"range":{"start_line":1425,"start_character":43,"end_line":1425,"end_character":45},"in_reply_to":"9abb7d3a_fb041f7f","updated":"2016-05-31 19:35:42.000000000","message":"nice suggestion, I just don\u0027t know if it\u0027s ok to create the keystoneauth dependency in here","commit_id":"73e4296a389893c750f7c70a477ec828e4360197"},{"author":{"_account_id":7191,"name":"Jamie Lennox","email":"jamielennox@gmail.com","username":"jamielennox"},"change_message_id":"11c713c7bef6fcaecbec81da3f822e9c2c629c4d","unresolved":false,"context_lines":[{"line_number":1522,"context_line":"                                                         None)"},{"line_number":1523,"context_line":"        service_user \u003d opts.get(\u0027service_username\u0027, None)"},{"line_number":1524,"context_line":"        service_key \u003d opts.get(\u0027service_key\u0027, None)"},{"line_number":1525,"context_line":"        return get_auth(self.authurl, service_user, service_key,"},{"line_number":1526,"context_line":"                        session\u003dself.session,"},{"line_number":1527,"context_line":"                        snet\u003dself.snet,"},{"line_number":1528,"context_line":"                        auth_version\u003dself.auth_version,"}],"source_content_type":"text/x-python","patch_set":8,"id":"9abb7d3a_dbcafb19","line":1525,"range":{"start_line":1525,"start_character":29,"end_line":1525,"end_character":36},"updated":"2016-05-31 01:02:04.000000000","message":"service_user and service_key + session would seem to be  ignored here.","commit_id":"73e4296a389893c750f7c70a477ec828e4360197"},{"author":{"_account_id":7191,"name":"Jamie Lennox","email":"jamielennox@gmail.com","username":"jamielennox"},"change_message_id":"2bb4ca4d99e0a6c517d38b9905db432403e1b65b","unresolved":false,"context_lines":[{"line_number":1522,"context_line":"                                                         None)"},{"line_number":1523,"context_line":"        service_user \u003d opts.get(\u0027service_username\u0027, None)"},{"line_number":1524,"context_line":"        service_key \u003d opts.get(\u0027service_key\u0027, None)"},{"line_number":1525,"context_line":"        return get_auth(self.authurl, service_user, service_key,"},{"line_number":1526,"context_line":"                        session\u003dself.session,"},{"line_number":1527,"context_line":"                        snet\u003dself.snet,"},{"line_number":1528,"context_line":"                        auth_version\u003dself.auth_version,"}],"source_content_type":"text/x-python","patch_set":8,"id":"1a95cdbc_8498ba79","line":1525,"range":{"start_line":1525,"start_character":29,"end_line":1525,"end_character":36},"in_reply_to":"7aa08908_a214cd9f","updated":"2016-10-10 05:04:03.000000000","message":"Sessions are all focused on the transport layer, then auth plugins are purely handled via auth plugin.\n\nService tokens are interesting because you can class them as either. Probably we would treat them as arbitrary headers to start with and then later develop like an auth plugin wrapper that handled both user and service auth at the plugin layer. We\u0027ll probably need this for other services soon.","commit_id":"73e4296a389893c750f7c70a477ec828e4360197"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"235542a23660fc93c71cd3755296a4f2d6934cc1","unresolved":false,"context_lines":[{"line_number":1522,"context_line":"                                                         None)"},{"line_number":1523,"context_line":"        service_user \u003d opts.get(\u0027service_username\u0027, None)"},{"line_number":1524,"context_line":"        service_key \u003d opts.get(\u0027service_key\u0027, None)"},{"line_number":1525,"context_line":"        return get_auth(self.authurl, service_user, service_key,"},{"line_number":1526,"context_line":"                        session\u003dself.session,"},{"line_number":1527,"context_line":"                        snet\u003dself.snet,"},{"line_number":1528,"context_line":"                        auth_version\u003dself.auth_version,"}],"source_content_type":"text/x-python","patch_set":8,"id":"7aa08908_a214cd9f","line":1525,"range":{"start_line":1525,"start_character":29,"end_line":1525,"end_character":36},"in_reply_to":"9abb7d3a_c4059b7a","updated":"2016-06-08 00:33:49.000000000","message":"How are service users/tokens typically handled when using keystoneauth Sessions? Would there be separate Session objects for the service and the underlying user?","commit_id":"73e4296a389893c750f7c70a477ec828e4360197"},{"author":{"_account_id":15742,"name":"Paulo Ewerton Gomes Fragoso","email":"pauloewerton@lsd.ufcg.edu.br","username":"pauloewerton"},"change_message_id":"5e895aaf428beb8975bf8607cae1ff109f44fcc4","unresolved":false,"context_lines":[{"line_number":1522,"context_line":"                                                         None)"},{"line_number":1523,"context_line":"        service_user \u003d opts.get(\u0027service_username\u0027, None)"},{"line_number":1524,"context_line":"        service_key \u003d opts.get(\u0027service_key\u0027, None)"},{"line_number":1525,"context_line":"        return get_auth(self.authurl, service_user, service_key,"},{"line_number":1526,"context_line":"                        session\u003dself.session,"},{"line_number":1527,"context_line":"                        snet\u003dself.snet,"},{"line_number":1528,"context_line":"                        auth_version\u003dself.auth_version,"}],"source_content_type":"text/x-python","patch_set":8,"id":"9abb7d3a_c4059b7a","line":1525,"range":{"start_line":1525,"start_character":29,"end_line":1525,"end_character":36},"in_reply_to":"9abb7d3a_dbcafb19","updated":"2016-05-31 19:35:42.000000000","message":"hmm, yeah if we pass a session, then user and key are ignored. I\u0027m unsure what would be a better approach to this though \u003d\\","commit_id":"73e4296a389893c750f7c70a477ec828e4360197"}],"tests/unit/test_swiftclient.py":[{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"2e507b6758ef165bb086285b5d171bb285032bef","unresolved":false,"context_lines":[{"line_number":1756,"context_line":"            (\u0027HEAD\u0027, \u0027/v1/AUTH_test\u0027, \u0027\u0027, {\u0027x-auth-token\u0027: \u0027token\u0027}),"},{"line_number":1757,"context_line":"        ])"},{"line_number":1758,"context_line":""},{"line_number":1759,"context_line":"    def test_reauth_os_preauth(self):"},{"line_number":1760,"context_line":"        os_preauth_options \u003d {"},{"line_number":1761,"context_line":"            \u0027tenant_name\u0027: \u0027demo\u0027,"},{"line_number":1762,"context_line":"            \u0027object_storage_url\u0027: \u0027http://storage.example.com/v1/AUTH_test\u0027,"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba0121b8_fdc69b66","line":1759,"updated":"2016-03-30 17:08:36.000000000","message":"I\u0027d like to see a test like this one, but with just a session passed to the Connection.","commit_id":"ad8d4ed1e16a95b26c00a17bc1cce5a5ab636ff7"},{"author":{"_account_id":15742,"name":"Paulo Ewerton Gomes Fragoso","email":"pauloewerton@lsd.ufcg.edu.br","username":"pauloewerton"},"change_message_id":"ac9ca82694154f1e4c0023d9978a6beb5b097a2f","unresolved":false,"context_lines":[{"line_number":1756,"context_line":"            (\u0027HEAD\u0027, \u0027/v1/AUTH_test\u0027, \u0027\u0027, {\u0027x-auth-token\u0027: \u0027token\u0027}),"},{"line_number":1757,"context_line":"        ])"},{"line_number":1758,"context_line":""},{"line_number":1759,"context_line":"    def test_reauth_os_preauth(self):"},{"line_number":1760,"context_line":"        os_preauth_options \u003d {"},{"line_number":1761,"context_line":"            \u0027tenant_name\u0027: \u0027demo\u0027,"},{"line_number":1762,"context_line":"            \u0027object_storage_url\u0027: \u0027http://storage.example.com/v1/AUTH_test\u0027,"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba0121b8_45b9702d","line":1759,"in_reply_to":"ba0121b8_fdc69b66","updated":"2016-03-31 19:29:50.000000000","message":"Done","commit_id":"ad8d4ed1e16a95b26c00a17bc1cce5a5ab636ff7"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"def92a77d627120cea0ed17becb064af0148f2af","unresolved":false,"context_lines":[{"line_number":1781,"context_line":"        mock_session.get_endpoint.return_value \u003d \u0027http://storageurl\u0027"},{"line_number":1782,"context_line":"        mock_session.get_token.return_value \u003d \u0027expired\u0027"},{"line_number":1783,"context_line":"        conn \u003d c.Connection(session\u003dmock_session)"},{"line_number":1784,"context_line":"        fake_conn \u003d self.fake_http_connection(401)"},{"line_number":1785,"context_line":"        with mock.patch.multiple(\u0027swiftclient.client\u0027,"},{"line_number":1786,"context_line":"                                 http_connection\u003dfake_conn,"},{"line_number":1787,"context_line":"                                 sleep\u003dmock.DEFAULT):"}],"source_content_type":"text/x-python","patch_set":5,"id":"ba0121b8_218d49d6","line":1784,"range":{"start_line":1784,"start_character":46,"end_line":1784,"end_character":49},"updated":"2016-03-31 22:19:42.000000000","message":"Like the test above, let\u0027s have this first 401 (so we should invalidate the session and retry), then 200. The assertRaises should then be unnecessary, and we can even set get_token.side_effect \u003d [\u0027expired\u0027, \u0027token\u0027] to watch the token change in the requests.","commit_id":"ef10d97f3f07525052a712c0b4d433e53c3ad09e"}]}
