Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents


...

Status

Current state: ImplementingUnder Discussion

Discussion threadDev List

...

To make these work with the new system we would extend the cqlshrc file to have a configuration as the following:

[AuthProvider]

classname=<class name>
module=<path to module>

[AuthProviderExtendedProperties]
extendedparam1 = <property to be fed into a dict during initialization>
... 


Cqlsh, when invoked with this configuration, would create an instance of the given class name from the given module.

...

An individual wanting to use a SaslAuthProvider in CQLSH, initialized in client code like this:

        sasl_kwargs = {'service': 'something',
                      'mechanism': 'GSSAPI',
                      'qops': 'auth'}
        auth_provider = SaslAuthProvider(**sasl_kwargs)


would merely need to provide the following cqlshrc, to use a similar Auth Provider instance in cqlsh.

[AuthProvider]

classname=SaslAuthProvider
module=cassandra.auth

[AuthProviderExtendedProperties]
service = something
mechanism = GSSAPI
qops = auth




Adding additional cqlshrc properties to allow instantiation of plugin authenticator

...

The new heading for the cqlshrc would appear to be the following:


[AuthProvider]

classname = <class name>
module = <path to module>
path = <path to python lib>

[AuthProviderExtendedProperties]
param1 = <custom property sent to AuthProvider's constructor>


module and path would correspond to the arguments that are part of the built-in importlib functionality of Python. classname would correspond to the class name loaded.

...

These are accessible with standard period/context notation using <section Name>.<Property>.  For example to override the authprovider class name...

$ cqlsh --AuthProvider.classname=SaslAuthProvider

Dynamic loading of Custom AuthProvider class in cqlsh utility

...

To configure cqlsh to work I would add the following section to my cqlshrc file...


[AuthProvider]

classname=SAMLAuthProvider
module=com.example.cassandra.driver.auth
path=~/samlplugin


[AuthProviderExtendedProperties]
saml_file_path=~/saml.conf



After doing so, when connecting via cqlsh it would immediately use SAML to authenticate me against the cluster.

...