1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-29 08:21:15 +03:00

fix!(cmapi): MCOL-5454: Self-signed certificate autorenew. (#3213)

[add] managers/certificate.py with CertificateManger class
[mv] creating self-signed certificate logic into CertificateManger class
[add] renew and days_before_expire methods to CertificateManger class
[mv] several certificate dependent constants to managers/certificate.py
[add] CherryPy BackgroundTask to invoke certificate check hourly (3600 secs)
[fix] tests
[fix] bug with txn timer clean (clean_txn_by_timeout, worker and invoking of it)
This commit is contained in:
Alan Mologorsky
2024-07-21 07:25:32 +03:00
committed by GitHub
parent 1964f4243c
commit 687aa463af
6 changed files with 138 additions and 134 deletions

View File

@ -8,15 +8,16 @@ from contextlib import contextmanager
from cmapi_server import helpers, node_manipulation
from mcs_node_control.models.node_config import NodeConfig
from cmapi_server.controllers.dispatcher import dispatcher, jsonify_error
from cmapi_server.test.unittest_global import create_self_signed_certificate, \
cert_filename, mcs_config_filename, cmapi_config_filename, \
tmp_mcs_config_filename, tmp_cmapi_config_filename
from cmapi_server.managers.certificate import CertificateManager
from cmapi_server.test.unittest_global import (
mcs_config_filename, cmapi_config_filename, tmp_mcs_config_filename,
tmp_cmapi_config_filename,
)
@contextmanager
def start_server():
if not os.path.exists(cert_filename):
create_self_signed_certificate()
CertificateManager.create_self_signed_certificate_if_not_exist()
app = cherrypy.tree.mount(root = None, config = cmapi_config_filename)
app.config.update({