Was this page helpful?
ScyllaDB Python Driver is available under the Apache v2 License. ScyllaDB Python Driver is a fork of DataStax Python Driver. See Copyright here.
Caution
You're viewing documentation for an unstable version of Scylla Python Driver. Switch to the latest stable version.
cassandra.auth
- Authentication¶An abstract class that defines the interface that will be used for
creating Authenticator
instances when opening new
connections to Cassandra.
Added in version 2.0.0.
Implementations of this class should return a new instance
of Authenticator
or one of its subclasses.
An abstract class that handles SASL authentication with Cassandra servers.
Each time a new connection is created and the server requires authentication,
a new instance of this class will be created by the corresponding
AuthProvider
to handler that authentication. The lifecycle of the
new Authenticator
will the be:
1) The initial_response()
method will be called. The return
value will be sent to the server to initiate the handshake.
2) The server will respond to each client response by either issuing a
challenge or indicating that the authentication is complete (successful or not).
If a new challenge is issued, evaluate_challenge()
will be called to produce a response that will be sent to the
server. This challenge/response negotiation will continue until the server
responds that authentication is successful (or an AuthenticationFailed
is raised).
3) When the server indicates that authentication is successful,
on_authentication_success()
will be called a token string that
that the server may optionally have sent.
The exact nature of the negotiation between the client and server is specific to the authentication mechanism configured server-side.
Added in version 2.0.0.
Set during the connection AUTHENTICATE phase
Returns an message to send to the server to initiate the SASL handshake.
None
may be returned to send an empty message.
Called when the server sends a challenge message. Generally, this method
should return None
when authentication is complete from a
client perspective. Otherwise, a string should be returned.
Called when the server indicates that authentication was successful.
Depending on the authentication mechanism, token may be None
or a string.
An AuthProvider
that works with Cassandra’s PasswordAuthenticator.
Example usage:
from cassandra.cluster import Cluster
from cassandra.auth import PlainTextAuthProvider
auth_provider = PlainTextAuthProvider(
username='cassandra', password='cassandra')
cluster = Cluster(auth_provider=auth_provider)
Added in version 2.0.0.
Implementations of this class should return a new instance
of Authenticator
or one of its subclasses.
Called when the server sends a challenge message. Generally, this method
should return None
when authentication is complete from a
client perspective. Otherwise, a string should be returned.
An AuthProvider
supporting general SASL auth mechanisms
Suitable for GSSAPI or other SASL mechanisms
Example usage:
from cassandra.cluster import Cluster
from cassandra.auth import SaslAuthProvider
sasl_kwargs = {'service': 'something',
'mechanism': 'GSSAPI',
'qops': 'auth'.split(',')}
auth_provider = SaslAuthProvider(**sasl_kwargs)
cluster = Cluster(auth_provider=auth_provider)
Added in version 2.1.4.
Implementations of this class should return a new instance
of Authenticator
or one of its subclasses.
A pass-through Authenticator
using the third party package
‘pure-sasl’ for authentication
Added in version 2.1.4.
Returns an message to send to the server to initiate the SASL handshake.
None
may be returned to send an empty message.
Called when the server sends a challenge message. Generally, this method
should return None
when authentication is complete from a
client perspective. Otherwise, a string should be returned.
Was this page helpful?
ScyllaDB Python Driver is available under the Apache v2 License. ScyllaDB Python Driver is a fork of DataStax Python Driver. See Copyright here.
cassandra
- Exceptions and Enumscassandra.cluster
- Clusters and Sessionscassandra.policies
- Load balancing and Failure Handling Policiescassandra.auth
- Authenticationcassandra.metadata
- Schema and Ring Topologycassandra.metrics
- Performance Metricscassandra.query
- Prepared Statements, Batch Statements, Tracing, and Row Factoriescassandra.pool
- Hosts and Connection Poolscassandra.protocol
- Protocol Featurescassandra.encoder
- Encoders for non-prepared Statementscassandra.decoder
- Data Return Formatscassandra.concurrent
- Utilities for Concurrent Statement Executioncassandra.connection
- Low Level Connection Infocassandra.util
- Utilitiescassandra.timestamps
- Timestamp Generationcassandra.io.asyncioreactor
- asyncio
Event Loopcassandra.io.asyncorereactor
- asyncore
Event Loopcassandra.io.eventletreactor
- eventlet
-compatible Connectioncassandra.io.libevreactor
- libev
Event Loopcassandra.io.geventreactor
- gevent
-compatible Event Loopcassandra.io.twistedreactor
- Twisted Event Loopcassandra.cqlengine.models
- Table models for object mappingcassandra.cqlengine.columns
- Column types for object mapping modelscassandra.cqlengine.query
- Query and filter model objectscassandra.cqlengine.connection
- Connection management for cqlenginecassandra.cqlengine.management
- Schema management for cqlenginecassandra.cqlengine.usertype
- Model classes for User Defined Types