import { getConfig } from '@/config/configuration' ; import { auth , ClientOptions } from 'cassandra-driver' ; import { ICassandraClientOptionsProvider } from './ICassandraClientOptionsProvider' ; import { ICassandraConnectParams } from '../../../typings/cassandra' ; const { CASSANDRA_BASE_AUTH_PROVIDER_USERNAME , CASSANDRA_BASE_AUTH_PROVIDER_PASSWORD , } = getConfig ( ) ; export default class LocalCassandraClientOptionsProvider implements ICassandraClientOptionsProvider { public getLocalDatacenter ( _region ) { return 'datacenter1' ; } public getAuthProvider ( _username , _password ) { if ( CASSANDRA_BASE_AUTH_PROVIDER_USERNAME === undefined || CASSANDRA_BASE_AUTH_PROVIDER_PASSWORD === undefined ) { return undefined ; } return new auth . PlainTextAuthProvider ( CASSANDRA_BASE_AUTH_PROVIDER_USERNAME , CASSANDRA_BASE_AUTH_PROVIDER_PASSWORD ) ; } public getPolicies ( _region ) { return undefined ; } public getPoolingOptions ( ) { return undefined ; } public getSocketOptions ( ) { return undefined ; } public async getSslOptions ( _params ) { return undefined ; } }