An :class:`~.AuthProvider` that works with Cassandra's PasswordAuthenticator. Example usage:: from cassandra.cluster import Cluster from cassandra.auth import PlainTextAuthProvider auth_provider = PlainTextAuthProvider( username='cassandra', passwo
| 115 | |
| 116 | |
| 117 | class PlainTextAuthProvider(AuthProvider): |
| 118 | """ |
| 119 | An :class:`~.AuthProvider` that works with Cassandra's PasswordAuthenticator. |
| 120 | |
| 121 | Example usage:: |
| 122 | |
| 123 | from cassandra.cluster import Cluster |
| 124 | from cassandra.auth import PlainTextAuthProvider |
| 125 | |
| 126 | auth_provider = PlainTextAuthProvider( |
| 127 | username='cassandra', password='cassandra') |
| 128 | cluster = Cluster(auth_provider=auth_provider) |
| 129 | |
| 130 | .. versionadded:: 2.0.0 |
| 131 | """ |
| 132 | |
| 133 | def __init__(self, username, password): |
| 134 | self.username = username |
| 135 | self.password = password |
| 136 | |
| 137 | def new_authenticator(self, host): |
| 138 | return PlainTextAuthenticator(self.username, self.password) |
| 139 | |
| 140 | |
| 141 | class TransitionalModePlainTextAuthProvider(object): |
no outgoing calls