How to use the pyexasol.utils.encrypt_password function in pyexasol

To help you get started, we’ve selected a few pyexasol examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github badoo / pyexasol / pyexasol / connection.py View on Github external
def _login(self):
        ret = self.req({
            'command': 'login',
            'protocolVersion': 1,
        })

        self.login_info = self.req({
            'username': self.options['user'],
            'password': utils.encrypt_password(ret['responseData']['publicKeyPem'], self.options['password']),
            'driverName': f'{constant.DRIVER_NAME} {__version__}',
            'clientName': self.options['client_name'] if self.options['client_name'] else constant.DRIVER_NAME,
            'clientVersion': self.options['client_version'] if self.options['client_version'] else __version__,
            'clientOs': platform.platform(),
            'clientOsUsername': getpass.getuser(),
            'clientRuntime': f'Python {platform.python_version()}',
            'useCompression': self.options['compression'],
            'attributes': {
                'currentSchema': str(self.options['schema']),
                'autocommit': self.options['autocommit'],
                'queryTimeout': self.options['query_timeout'],
                'snapshotTransactionsEnabled': self.options['snapshot_transactions'],
            }
        })['responseData']

        if self.options['compression']: