Added ssl_disabled option

This commit is contained in:
Sven Heidemann 2023-12-06 17:56:13 +01:00
parent 153fc8922e
commit 347418bdc5
17 changed files with 112 additions and 103 deletions

View File

@ -11,16 +11,16 @@ CPL core package
""" """
__title__ = "cpl_core" __title__ = 'cpl_core'
__author__ = "Sven Heidemann" __author__ = 'Sven Heidemann'
__license__ = "MIT" __license__ = 'MIT'
__copyright__ = "Copyright (c) 2020 - 2023 sh-edraft.de" __copyright__ = 'Copyright (c) 2020 - 2023 sh-edraft.de'
__version__ = "2023.10.0" __version__ = '2023.10.1'
from collections import namedtuple from collections import namedtuple
# imports: # imports:
VersionInfo = namedtuple("VersionInfo", "major minor micro") VersionInfo = namedtuple('VersionInfo', 'major minor micro')
version_info = VersionInfo(major="2023", minor="10", micro="0") version_info = VersionInfo(major='2023', minor='10', micro='1')

View File

@ -11,11 +11,11 @@ CPL core package
""" """
__title__ = "cpl_core.application" __title__ = 'cpl_core.application'
__author__ = "Sven Heidemann" __author__ = 'Sven Heidemann'
__license__ = "MIT" __license__ = 'MIT'
__copyright__ = "Copyright (c) 2020 - 2023 sh-edraft.de" __copyright__ = 'Copyright (c) 2020 - 2023 sh-edraft.de'
__version__ = "2023.10.0" __version__ = '2023.10.1'
from collections import namedtuple from collections import namedtuple
@ -28,5 +28,5 @@ from .application_extension_abc import ApplicationExtensionABC
from .startup_abc import StartupABC from .startup_abc import StartupABC
from .startup_extension_abc import StartupExtensionABC from .startup_extension_abc import StartupExtensionABC
VersionInfo = namedtuple("VersionInfo", "major minor micro") VersionInfo = namedtuple('VersionInfo', 'major minor micro')
version_info = VersionInfo(major="2023", minor="10", micro="0") version_info = VersionInfo(major='2023', minor='10', micro='1')

View File

@ -11,11 +11,11 @@ CPL core package
""" """
__title__ = "cpl_core.configuration" __title__ = 'cpl_core.configuration'
__author__ = "Sven Heidemann" __author__ = 'Sven Heidemann'
__license__ = "MIT" __license__ = 'MIT'
__copyright__ = "Copyright (c) 2020 - 2023 sh-edraft.de" __copyright__ = 'Copyright (c) 2020 - 2023 sh-edraft.de'
__version__ = "2023.10.0" __version__ = '2023.10.1'
from collections import namedtuple from collections import namedtuple
@ -34,5 +34,5 @@ from .flag_argument import FlagArgument
from .validator_abc import ValidatorABC from .validator_abc import ValidatorABC
from .variable_argument import VariableArgument from .variable_argument import VariableArgument
VersionInfo = namedtuple("VersionInfo", "major minor micro") VersionInfo = namedtuple('VersionInfo', 'major minor micro')
version_info = VersionInfo(major="2023", minor="10", micro="0") version_info = VersionInfo(major='2023', minor='10', micro='1')

View File

@ -11,11 +11,11 @@ CPL core package
""" """
__title__ = "cpl_core.console" __title__ = 'cpl_core.console'
__author__ = "Sven Heidemann" __author__ = 'Sven Heidemann'
__license__ = "MIT" __license__ = 'MIT'
__copyright__ = "Copyright (c) 2020 - 2023 sh-edraft.de" __copyright__ = 'Copyright (c) 2020 - 2023 sh-edraft.de'
__version__ = "2023.10.0" __version__ = '2023.10.1'
from collections import namedtuple from collections import namedtuple
@ -27,5 +27,5 @@ from .console_call import ConsoleCall
from .foreground_color_enum import ForegroundColorEnum from .foreground_color_enum import ForegroundColorEnum
from .spinner_thread import SpinnerThread from .spinner_thread import SpinnerThread
VersionInfo = namedtuple("VersionInfo", "major minor micro") VersionInfo = namedtuple('VersionInfo', 'major minor micro')
version_info = VersionInfo(major="2023", minor="10", micro="0") version_info = VersionInfo(major='2023', minor='10', micro='1')

View File

@ -4,7 +4,7 @@
"Version": { "Version": {
"Major": "2023", "Major": "2023",
"Minor": "10", "Minor": "10",
"Micro": "0" "Micro": "1"
}, },
"Author": "Sven Heidemann", "Author": "Sven Heidemann",
"AuthorEmail": "sven.heidemann@sh-edraft.de", "AuthorEmail": "sven.heidemann@sh-edraft.de",

View File

@ -11,11 +11,11 @@ CPL core package
""" """
__title__ = "cpl_core.database" __title__ = 'cpl_core.database'
__author__ = "Sven Heidemann" __author__ = 'Sven Heidemann'
__license__ = "MIT" __license__ = 'MIT'
__copyright__ = "Copyright (c) 2020 - 2023 sh-edraft.de" __copyright__ = 'Copyright (c) 2020 - 2023 sh-edraft.de'
__version__ = "2023.10.0" __version__ = '2023.10.1'
from collections import namedtuple from collections import namedtuple
@ -25,5 +25,5 @@ from .database_settings_name_enum import DatabaseSettingsNameEnum
from .database_settings import DatabaseSettings from .database_settings import DatabaseSettings
from .table_abc import TableABC from .table_abc import TableABC
VersionInfo = namedtuple("VersionInfo", "major minor micro") VersionInfo = namedtuple('VersionInfo', 'major minor micro')
version_info = VersionInfo(major="2023", minor="10", micro="0") version_info = VersionInfo(major='2023', minor='10', micro='1')

View File

@ -11,11 +11,11 @@ CPL core package
""" """
__title__ = "cpl_core.database.connection" __title__ = 'cpl_core.database.connection'
__author__ = "Sven Heidemann" __author__ = 'Sven Heidemann'
__license__ = "MIT" __license__ = 'MIT'
__copyright__ = "Copyright (c) 2020 - 2023 sh-edraft.de" __copyright__ = 'Copyright (c) 2020 - 2023 sh-edraft.de'
__version__ = "2023.10.0" __version__ = '2023.10.1'
from collections import namedtuple from collections import namedtuple
@ -24,5 +24,5 @@ from collections import namedtuple
from .database_connection import DatabaseConnection from .database_connection import DatabaseConnection
from .database_connection_abc import DatabaseConnectionABC from .database_connection_abc import DatabaseConnectionABC
VersionInfo = namedtuple("VersionInfo", "major minor micro") VersionInfo = namedtuple('VersionInfo', 'major minor micro')
version_info = VersionInfo(major="2023", minor="10", micro="0") version_info = VersionInfo(major='2023', minor='10', micro='1')

View File

@ -1,11 +1,12 @@
from typing import Optional from typing import Optional
import mysql.connector as sql import mysql.connector as sql
from mysql.connector.abstracts import MySQLConnectionAbstract
from mysql.connector.cursor import MySQLCursorBuffered
from cpl_core.database.connection.database_connection_abc import DatabaseConnectionABC from cpl_core.database.connection.database_connection_abc import DatabaseConnectionABC
from cpl_core.database.database_settings import DatabaseSettings from cpl_core.database.database_settings import DatabaseSettings
from cpl_core.utils.credential_manager import CredentialManager from cpl_core.utils.credential_manager import CredentialManager
from mysql.connector.abstracts import MySQLConnectionAbstract
from mysql.connector.cursor import MySQLCursorBuffered
class DatabaseConnection(DatabaseConnectionABC): class DatabaseConnection(DatabaseConnectionABC):
@ -35,6 +36,7 @@ class DatabaseConnection(DatabaseConnectionABC):
use_unicode=settings.use_unicode, use_unicode=settings.use_unicode,
buffered=settings.buffered, buffered=settings.buffered,
auth_plugin=settings.auth_plugin, auth_plugin=settings.auth_plugin,
ssl_disabled=settings.ssl_disabled,
) )
connection.cursor().execute(f"CREATE DATABASE IF NOT EXISTS `{settings.database}`;") connection.cursor().execute(f"CREATE DATABASE IF NOT EXISTS `{settings.database}`;")
self._database = sql.connect( self._database = sql.connect(
@ -47,5 +49,6 @@ class DatabaseConnection(DatabaseConnectionABC):
use_unicode=settings.use_unicode, use_unicode=settings.use_unicode,
buffered=settings.buffered, buffered=settings.buffered,
auth_plugin=settings.auth_plugin, auth_plugin=settings.auth_plugin,
ssl_disabled=settings.ssl_disabled,
) )
self._cursor = self._database.cursor() self._cursor = self._database.cursor()

View File

@ -11,11 +11,11 @@ CPL core package
""" """
__title__ = "cpl_core.database.context" __title__ = 'cpl_core.database.context'
__author__ = "Sven Heidemann" __author__ = 'Sven Heidemann'
__license__ = "MIT" __license__ = 'MIT'
__copyright__ = "Copyright (c) 2020 - 2023 sh-edraft.de" __copyright__ = 'Copyright (c) 2020 - 2023 sh-edraft.de'
__version__ = "2023.10.0" __version__ = '2023.10.1'
from collections import namedtuple from collections import namedtuple
@ -24,5 +24,5 @@ from collections import namedtuple
from .database_context import DatabaseContext from .database_context import DatabaseContext
from .database_context_abc import DatabaseContextABC from .database_context_abc import DatabaseContextABC
VersionInfo = namedtuple("VersionInfo", "major minor micro") VersionInfo = namedtuple('VersionInfo', 'major minor micro')
version_info = VersionInfo(major="2023", minor="10", micro="0") version_info = VersionInfo(major='2023', minor='10', micro='1')

View File

@ -17,6 +17,7 @@ class DatabaseSettings(ConfigurationModelABC):
use_unicode: bool = False, use_unicode: bool = False,
buffered: bool = False, buffered: bool = False,
auth_plugin: str = "caching_sha2_password", auth_plugin: str = "caching_sha2_password",
ssl_disabled: bool = False,
): ):
ConfigurationModelABC.__init__(self) ConfigurationModelABC.__init__(self)
@ -24,11 +25,12 @@ class DatabaseSettings(ConfigurationModelABC):
self._port: Optional[int] = port self._port: Optional[int] = port
self._user: Optional[str] = user self._user: Optional[str] = user
self._password: Optional[str] = password self._password: Optional[str] = password
self._databse: Optional[str] = database self._database: Optional[str] = database
self._charset: Optional[str] = charset self._charset: Optional[str] = charset
self._use_unicode: Optional[bool] = use_unicode self._use_unicode: Optional[bool] = use_unicode
self._buffered: Optional[bool] = buffered self._buffered: Optional[bool] = buffered
self._auth_plugin: Optional[str] = auth_plugin self._auth_plugin: Optional[str] = auth_plugin
self._ssl_disabled: Optional[bool] = ssl_disabled
@property @property
def host(self) -> Optional[str]: def host(self) -> Optional[str]:
@ -48,7 +50,7 @@ class DatabaseSettings(ConfigurationModelABC):
@property @property
def database(self) -> Optional[str]: def database(self) -> Optional[str]:
return self._databse return self._database
@property @property
def charset(self) -> Optional[str]: def charset(self) -> Optional[str]:
@ -65,3 +67,7 @@ class DatabaseSettings(ConfigurationModelABC):
@property @property
def auth_plugin(self) -> Optional[str]: def auth_plugin(self) -> Optional[str]:
return self._auth_plugin return self._auth_plugin
@property
def ssl_disabled(self) -> Optional[bool]:
return self._ssl_disabled

View File

@ -11,11 +11,11 @@ CPL core package
""" """
__title__ = "cpl_core.dependency_injection" __title__ = 'cpl_core.dependency_injection'
__author__ = "Sven Heidemann" __author__ = 'Sven Heidemann'
__license__ = "MIT" __license__ = 'MIT'
__copyright__ = "Copyright (c) 2020 - 2023 sh-edraft.de" __copyright__ = 'Copyright (c) 2020 - 2023 sh-edraft.de'
__version__ = "2023.10.0" __version__ = '2023.10.1'
from collections import namedtuple from collections import namedtuple
@ -30,5 +30,5 @@ from .service_lifetime_enum import ServiceLifetimeEnum
from .service_provider import ServiceProvider from .service_provider import ServiceProvider
from .service_provider_abc import ServiceProviderABC from .service_provider_abc import ServiceProviderABC
VersionInfo = namedtuple("VersionInfo", "major minor micro") VersionInfo = namedtuple('VersionInfo', 'major minor micro')
version_info = VersionInfo(major="2023", minor="10", micro="0") version_info = VersionInfo(major='2023', minor='10', micro='1')

View File

@ -11,11 +11,11 @@ CPL core package
""" """
__title__ = "cpl_core.environment" __title__ = 'cpl_core.environment'
__author__ = "Sven Heidemann" __author__ = 'Sven Heidemann'
__license__ = "MIT" __license__ = 'MIT'
__copyright__ = "Copyright (c) 2020 - 2023 sh-edraft.de" __copyright__ = 'Copyright (c) 2020 - 2023 sh-edraft.de'
__version__ = "2023.10.0" __version__ = '2023.10.1'
from collections import namedtuple from collections import namedtuple
@ -25,5 +25,5 @@ from .application_environment_abc import ApplicationEnvironmentABC
from .environment_name_enum import EnvironmentNameEnum from .environment_name_enum import EnvironmentNameEnum
from .application_environment import ApplicationEnvironment from .application_environment import ApplicationEnvironment
VersionInfo = namedtuple("VersionInfo", "major minor micro") VersionInfo = namedtuple('VersionInfo', 'major minor micro')
version_info = VersionInfo(major="2023", minor="10", micro="0") version_info = VersionInfo(major='2023', minor='10', micro='1')

View File

@ -11,11 +11,11 @@ CPL core package
""" """
__title__ = "cpl_core.logging" __title__ = 'cpl_core.logging'
__author__ = "Sven Heidemann" __author__ = 'Sven Heidemann'
__license__ = "MIT" __license__ = 'MIT'
__copyright__ = "Copyright (c) 2020 - 2023 sh-edraft.de" __copyright__ = 'Copyright (c) 2020 - 2023 sh-edraft.de'
__version__ = "2023.10.0" __version__ = '2023.10.1'
from collections import namedtuple from collections import namedtuple
@ -27,5 +27,5 @@ from .logging_level_enum import LoggingLevelEnum
from .logging_settings import LoggingSettings from .logging_settings import LoggingSettings
from .logging_settings_name_enum import LoggingSettingsNameEnum from .logging_settings_name_enum import LoggingSettingsNameEnum
VersionInfo = namedtuple("VersionInfo", "major minor micro") VersionInfo = namedtuple('VersionInfo', 'major minor micro')
version_info = VersionInfo(major="2023", minor="10", micro="0") version_info = VersionInfo(major='2023', minor='10', micro='1')

View File

@ -11,11 +11,11 @@ CPL core package
""" """
__title__ = "cpl_core.mailing" __title__ = 'cpl_core.mailing'
__author__ = "Sven Heidemann" __author__ = 'Sven Heidemann'
__license__ = "MIT" __license__ = 'MIT'
__copyright__ = "Copyright (c) 2020 - 2023 sh-edraft.de" __copyright__ = 'Copyright (c) 2020 - 2023 sh-edraft.de'
__version__ = "2023.10.0" __version__ = '2023.10.1'
from collections import namedtuple from collections import namedtuple
@ -27,5 +27,5 @@ from .email_client_abc import EMailClientABC
from .email_client_settings import EMailClientSettings from .email_client_settings import EMailClientSettings
from .email_client_settings_name_enum import EMailClientSettingsNameEnum from .email_client_settings_name_enum import EMailClientSettingsNameEnum
VersionInfo = namedtuple("VersionInfo", "major minor micro") VersionInfo = namedtuple('VersionInfo', 'major minor micro')
version_info = VersionInfo(major="2023", minor="10", micro="0") version_info = VersionInfo(major='2023', minor='10', micro='1')

View File

@ -11,11 +11,11 @@ CPL core package
""" """
__title__ = "cpl_core.pipes" __title__ = 'cpl_core.pipes'
__author__ = "Sven Heidemann" __author__ = 'Sven Heidemann'
__license__ = "MIT" __license__ = 'MIT'
__copyright__ = "Copyright (c) 2020 - 2023 sh-edraft.de" __copyright__ = 'Copyright (c) 2020 - 2023 sh-edraft.de'
__version__ = "2023.10.0" __version__ = '2023.10.1'
from collections import namedtuple from collections import namedtuple
@ -25,5 +25,5 @@ from .bool_pipe import BoolPipe
from .ip_address_pipe import IPAddressPipe from .ip_address_pipe import IPAddressPipe
from .pipe_abc import PipeABC from .pipe_abc import PipeABC
VersionInfo = namedtuple("VersionInfo", "major minor micro") VersionInfo = namedtuple('VersionInfo', 'major minor micro')
version_info = VersionInfo(major="2023", minor="10", micro="0") version_info = VersionInfo(major='2023', minor='10', micro='1')

View File

@ -11,11 +11,11 @@ CPL core package
""" """
__title__ = "cpl_core.time" __title__ = 'cpl_core.time'
__author__ = "Sven Heidemann" __author__ = 'Sven Heidemann'
__license__ = "MIT" __license__ = 'MIT'
__copyright__ = "Copyright (c) 2020 - 2023 sh-edraft.de" __copyright__ = 'Copyright (c) 2020 - 2023 sh-edraft.de'
__version__ = "2023.10.0" __version__ = '2023.10.1'
from collections import namedtuple from collections import namedtuple
@ -24,5 +24,5 @@ from collections import namedtuple
from .time_format_settings import TimeFormatSettings from .time_format_settings import TimeFormatSettings
from .time_format_settings_names_enum import TimeFormatSettingsNamesEnum from .time_format_settings_names_enum import TimeFormatSettingsNamesEnum
VersionInfo = namedtuple("VersionInfo", "major minor micro") VersionInfo = namedtuple('VersionInfo', 'major minor micro')
version_info = VersionInfo(major="2023", minor="10", micro="0") version_info = VersionInfo(major='2023', minor='10', micro='1')

View File

@ -11,11 +11,11 @@ CPL core package
""" """
__title__ = "cpl_core.utils" __title__ = 'cpl_core.utils'
__author__ = "Sven Heidemann" __author__ = 'Sven Heidemann'
__license__ = "MIT" __license__ = 'MIT'
__copyright__ = "Copyright (c) 2020 - 2023 sh-edraft.de" __copyright__ = 'Copyright (c) 2020 - 2023 sh-edraft.de'
__version__ = "2023.10.0" __version__ = '2023.10.1'
from collections import namedtuple from collections import namedtuple
@ -25,5 +25,5 @@ from .credential_manager import CredentialManager
from .string import String from .string import String
from .pip import Pip from .pip import Pip
VersionInfo = namedtuple("VersionInfo", "major minor micro") VersionInfo = namedtuple('VersionInfo', 'major minor micro')
version_info = VersionInfo(major="2023", minor="10", micro="0") version_info = VersionInfo(major='2023', minor='10', micro='1')