Permalink
Browse files

Set keyspace on conn after (potentially) logging in

Authenticators may require that users be logged in prior to
executing set_keyspace() now in order to avoid leaking info
about what keyspaces exist.
  • Loading branch information...
1 parent 7d6a6ee commit fb2c04a134dae435b06373d0ab09b59fd6c297a9 @thobbs thobbs committed Jan 25, 2013
Showing with 2 additions and 2 deletions.
  1. +2 −2 pycassa/connection.py
View
@@ -50,12 +50,12 @@ def __init__(self, keyspace, server, framed_transport=True, timeout=None,
Cassandra.Client.__init__(self, protocol)
self.transport.open()
- self.set_keyspace(keyspace)
-
if credentials is not None:
request = AuthenticationRequest(credentials=credentials)
self.login(request)
+ self.set_keyspace(keyspace)
+
def set_keyspace(self, keyspace):
if keyspace != self.keyspace:
Cassandra.Client.set_keyspace(self, keyspace)

0 comments on commit fb2c04a

Please sign in to comment.