@@ -42,15 +42,18 @@ Protocol v1 Authentication
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
When working with Cassandra 1.2 (or a higher version with
|
||||
:attr:`~.Cluster.protocol_version` set to ``1``), you will not pass in
|
||||
an :class:`~.AuthProvider` instance. Instead, you should pass a dict
|
||||
of credentials with a ``username`` and ``password`` key:
|
||||
an :class:`~.AuthProvider` instance. Instead, you should pass in a
|
||||
function that takes one argument, the IP address of a host, and returns
|
||||
a dict of credentials with a ``username`` and ``password`` key:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
from cassandra.cluster import Cluster
|
||||
|
||||
credentials = {'username': 'joe', 'password': '1234'}
|
||||
cluster = Cluster(auth_provider=credentials, protocol_version=1)
|
||||
def get_credentials(host_address):
|
||||
return {'username': 'joe', 'password': '1234'}
|
||||
|
||||
cluster = Cluster(auth_provider=get_credentials, protocol_version=1)
|
||||
|
||||
SSL
|
||||
---
|
||||
|
Reference in New Issue
Block a user