From 9c40ebe3b7f0964ae283aedeaa45bdfab529dbfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20L=C3=B6sche?= Date: Thu, 16 May 2024 10:58:47 +0200 Subject: [PATCH] Bump libs and migrate resotolib -> fixlib --- fixca/__main__.py | 16 ++-- fixca/args.py | 2 +- fixca/ca.py | 6 +- fixca/k8s.py | 2 +- pyproject.toml | 2 +- requirements-test.txt | 200 +++++++++++++++++++++--------------------- requirements.txt | 150 +++++++++++++++---------------- 7 files changed, 185 insertions(+), 193 deletions(-) diff --git a/fixca/__main__.py b/fixca/__main__.py index 6831731..84314a3 100644 --- a/fixca/__main__.py +++ b/fixca/__main__.py @@ -1,12 +1,12 @@ import os import sys -import resotolib.proc +import fixlib.proc from signal import SIGTERM from tempfile import TemporaryDirectory -from resotolib.logger import log, setup_logger, add_args as logging_add_args -from resotolib.web import WebServer -from resotolib.event import EventType, add_event_listener -from resotolib.x509 import gen_csr, gen_rsa_key, write_cert_to_file, write_key_to_file +from fixlib.logger import log, setup_logger, add_args as logging_add_args +from fixlib.web import WebServer +from fixlib.event import EventType, add_event_listener +from fixlib.x509 import gen_csr, gen_rsa_key, write_cert_to_file, write_key_to_file from .args import parse_args from .ca import CA, WebApp, CaApp from threading import Event @@ -25,8 +25,8 @@ def main() -> None: setup_logger("fixca") args = parse_args([logging_add_args]) # type: ignore log.info(f"Starting FIX CA on port {args.port}") - resotolib.proc.initializer() - resotolib.proc.parent_pid = os.getpid() + fixlib.proc.initializer() + fixlib.proc.parent_pid = os.getpid() add_event_listener(EventType.SHUTDOWN, shutdown) @@ -71,7 +71,7 @@ def main() -> None: shutdown_event.wait() web_server.shutdown() - resotolib.proc.kill_children(SIGTERM, ensure_death=True) + fixlib.proc.kill_children(SIGTERM, ensure_death=True) log.info("Shutdown complete") sys.exit(0) diff --git a/fixca/args.py b/fixca/args.py index 5eb61f7..fde71c4 100644 --- a/fixca/args.py +++ b/fixca/args.py @@ -1,6 +1,6 @@ import os from argparse import ArgumentParser, Namespace -from resotolib.args import ArgumentParser as ResotoArgumentParser +from fixlib.args import ArgumentParser as ResotoArgumentParser from typing import Callable, List, Union diff --git a/fixca/ca.py b/fixca/ca.py index 34c1c14..a25a589 100644 --- a/fixca/ca.py +++ b/fixca/ca.py @@ -5,8 +5,8 @@ from typing import Optional, Dict, Callable, Tuple, Union, Any, List from cryptography.hazmat.primitives.asymmetric.rsa import RSAPrivateKey from cryptography.x509.base import Certificate, CertificateSigningRequest -from resotolib.logger import log -from resotolib.x509 import ( +from fixlib.logger import log +from fixlib.x509 import ( bootstrap_ca, sign_csr, cert_to_bytes, @@ -19,7 +19,7 @@ gen_csr, gen_ca_bundle_bytes, ) -from resotolib.jwt import encode_jwt, decode_jwt_from_headers +from fixlib.jwt import encode_jwt, decode_jwt_from_headers from .k8s import get_secret, set_secret, get_namespaces from .utils import str_to_bool diff --git a/fixca/k8s.py b/fixca/k8s.py index 24b8981..25971f4 100644 --- a/fixca/k8s.py +++ b/fixca/k8s.py @@ -1,7 +1,7 @@ import sys import base64 from typing import Optional -from resotolib.logger import log +from fixlib.logger import log from kubernetes import client, config from kubernetes.client.exceptions import ApiException from kubernetes.client.models.v1_namespace_list import V1NamespaceList diff --git a/pyproject.toml b/pyproject.toml index f4930f8..50a8bd0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,7 +29,7 @@ keywords = ["cloud security"] dependencies = [ "cryptography", - "resotolib", + "fixinventorylib", "kubernetes", ] diff --git a/requirements-test.txt b/requirements-test.txt index c2db344..e8e1bc3 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,34 +1,32 @@ -aiodns==3.0.0 +aiodns==3.2.0 # via aiohttp -aiohttp[speedups]==3.8.5 - # via resotolib +aiohttp[speedups]==3.9.5 + # via fixinventorylib aiosignal==1.3.1 # via aiohttp -annotated-types==0.5.0 - # via pydantic -astroid==3.0.0 +astroid==3.2.0 # via pylint -async-timeout==4.0.3 - # via aiohttp -attrs==23.1.0 +attrs==23.2.0 # via # aiohttp # cattrs + # fixinventorylib # hypothesis - # resotolib autocommand==2.2.2 # via jaraco-text -black==23.9.1 +backports-tarfile==1.1.1 + # via jaraco-context +black==24.4.2 # via fixca (pyproject.toml) brotli==1.1.0 # via aiohttp -cachetools==5.3.1 +cachetools==5.3.3 # via # google-auth # tox -cattrs==23.1.2 - # via resotolib -certifi==2023.7.22 +cattrs==23.2.3 + # via fixinventorylib +certifi==2024.2.2 # via # kubernetes # requests @@ -38,228 +36,226 @@ cffi==1.16.0 # pycares chardet==5.2.0 # via tox -charset-normalizer==3.3.0 - # via - # aiohttp - # requests -cheroot==10.0.0 +charset-normalizer==3.3.2 + # via requests +cheroot==10.0.1 # via cherrypy -cherrypy==18.8.0 - # via resotolib +cherrypy==18.9.0 + # via fixinventorylib click==8.1.7 # via black colorama==0.4.6 # via tox -coverage[toml]==7.3.2 +coverage[toml]==7.5.1 # via # fixca (pyproject.toml) # pytest-cov -cryptography==42.0.4 +cryptography==42.0.7 # via # fixca (pyproject.toml) - # resotolib -dill==0.3.7 + # fixinventorylib +dill==0.3.8 # via pylint -distlib==0.3.7 +distlib==0.3.8 # via virtualenv -filelock==3.12.4 +filelock==3.14.0 # via # tox # virtualenv -flake8==6.1.0 +fixinventorylib==4.0.5 + # via fixca (pyproject.toml) +flake8==7.0.0 # via # fixca (pyproject.toml) # pep8-naming -frozendict==2.3.8 - # via resotolib -frozenlist==1.4.0 +frozendict==2.4.4 + # via fixinventorylib +frozenlist==1.4.1 # via # aiohttp # aiosignal -google-auth==2.23.2 +google-auth==2.29.0 # via kubernetes -hypothesis==6.87.1 +hypothesis==6.102.4 # via fixca (pyproject.toml) -idna==3.4 +idna==3.7 # via # requests # yarl -inflect==7.0.0 +inflect==7.2.1 # via jaraco-text iniconfig==2.0.0 # via pytest -isort==5.12.0 +isodate==0.6.1 + # via fixinventorylib +isort==5.13.2 # via pylint -jaraco-collections==4.3.0 +jaraco-collections==5.0.1 # via cherrypy -jaraco-context==4.3.0 +jaraco-context==5.3.0 # via jaraco-text -jaraco-functools==3.9.0 +jaraco-functools==4.0.1 # via # cheroot # jaraco-text # tempora -jaraco-text==3.11.1 +jaraco-text==3.12.0 # via jaraco-collections jsons==1.6.3 - # via resotolib -kubernetes==28.1.0 + # via fixinventorylib +kubernetes==29.0.0 # via fixca (pyproject.toml) mccabe==0.7.0 # via # flake8 # pylint -more-itertools==10.1.0 +more-itertools==10.2.0 # via # cheroot # cherrypy + # inflect # jaraco-functools # jaraco-text -multidict==6.0.4 +multidict==6.0.5 # via # aiohttp # yarl -mypy==1.5.1 +mypy==1.10.0 # via fixca (pyproject.toml) mypy-extensions==1.0.0 # via # black # mypy -networkx==3.1 - # via resotolib +networkx==3.3 + # via fixinventorylib oauthlib==3.2.2 # via # kubernetes # requests-oauthlib -packaging==23.2 +packaging==24.0 # via # black # pyproject-api # pytest # tox parsy==2.1 - # via resotolib -pathspec==0.11.2 + # via fixinventorylib +pathspec==0.12.1 # via black pep8-naming==0.13.3 # via fixca (pyproject.toml) -pint==0.22 - # via resotolib -platformdirs==3.11.0 +pint==0.23 + # via fixinventorylib +platformdirs==4.2.2 # via # black # pylint # tox # virtualenv -pluggy==1.3.0 +pluggy==1.5.0 # via # pytest # tox portend==3.2.0 # via cherrypy -prometheus-client==0.17.1 - # via resotolib -psutil==5.9.5 - # via resotolib -pyasn1==0.5.0 +prometheus-client==0.20.0 + # via fixinventorylib +psutil==5.9.8 + # via fixinventorylib +pyasn1==0.6.0 # via # pyasn1-modules # rsa -pyasn1-modules==0.3.0 +pyasn1-modules==0.4.0 # via google-auth -pycares==4.3.0 +pycares==4.4.0 # via aiodns -pycodestyle==2.11.0 +pycodestyle==2.11.1 # via flake8 -pycparser==2.21 +pycparser==2.22 # via cffi -pydantic==2.4.2 - # via inflect -pydantic-core==2.10.1 - # via pydantic -pyflakes==3.1.0 +pyflakes==3.2.0 # via flake8 pyjwt==2.8.0 - # via resotolib -pylint==3.0.0 + # via fixinventorylib +pylint==3.2.0 # via fixca (pyproject.toml) pyproject-api==1.6.1 # via tox -pytest==7.4.2 +pytest==8.2.0 # via # fixca (pyproject.toml) # pytest-asyncio # pytest-cov -pytest-asyncio==0.21.1 +pytest-asyncio==0.23.6 # via fixca (pyproject.toml) -pytest-cov==4.1.0 +pytest-cov==5.0.0 # via fixca (pyproject.toml) -pytest-runner==6.0.0 +pytest-runner==6.0.1 # via fixca (pyproject.toml) -python-dateutil==2.8.2 +python-dateutil==2.9.0.post0 # via + # fixinventorylib # kubernetes - # resotolib -pytz==2023.3.post1 +pytz==2024.1 # via tempora pyyaml==6.0.1 # via + # fixinventorylib # kubernetes - # resotolib requests==2.31.0 # via + # fixinventorylib # kubernetes # requests-oauthlib - # resotolib -requests-oauthlib==1.3.1 +requests-oauthlib==2.0.0 # via kubernetes -resotolib==3.8.0 - # via fixca (pyproject.toml) rsa==4.9 # via google-auth -setuptools==68.2.2 +setuptools==69.5.1 # via zc-lockfile six==1.16.0 # via + # isodate # kubernetes # python-dateutil sortedcontainers==2.4.0 # via hypothesis -tempora==5.5.0 +tempora==5.5.1 # via portend -tomlkit==0.12.1 +tomlkit==0.12.5 # via pylint -tox==4.11.3 +tox==4.15.0 # via fixca (pyproject.toml) -typeguard==4.1.5 - # via resotolib -typing-extensions==4.8.0 +typeguard==4.2.1 + # via + # fixinventorylib + # inflect +typing-extensions==4.11.0 # via # inflect # mypy # pint - # pydantic - # pydantic-core # typeguard typish==1.9.3 # via jsons -tzdata==2023.3 - # via resotolib -tzlocal==5.0.1 - # via resotolib -urllib3==1.26.18 +tzdata==2024.1 + # via fixinventorylib +tzlocal==5.2 + # via fixinventorylib +urllib3==2.2.1 # via # kubernetes # requests -virtualenv==20.24.5 +virtualenv==20.26.2 # via tox -websocket-client==1.6.3 +websocket-client==1.8.0 # via + # fixinventorylib # kubernetes - # resotolib -wheel==0.41.2 +wheel==0.43.0 # via fixca (pyproject.toml) -yarl==1.9.2 +yarl==1.9.4 # via aiohttp zc-lockfile==3.0.post1 # via cherrypy diff --git a/requirements.txt b/requirements.txt index 573dfaa..160017d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,27 +1,25 @@ -aiodns==3.0.0 +aiodns==3.2.0 # via aiohttp -aiohttp[speedups]==3.8.5 - # via resotolib +aiohttp[speedups]==3.9.5 + # via fixinventorylib aiosignal==1.3.1 # via aiohttp -annotated-types==0.5.0 - # via pydantic -async-timeout==4.0.3 - # via aiohttp -attrs==23.1.0 +attrs==23.2.0 # via # aiohttp # cattrs - # resotolib + # fixinventorylib autocommand==2.2.2 # via jaraco-text +backports-tarfile==1.1.1 + # via jaraco-context brotli==1.1.0 # via aiohttp -cachetools==5.3.1 +cachetools==5.3.3 # via google-auth -cattrs==23.1.2 - # via resotolib -certifi==2023.7.22 +cattrs==23.2.3 + # via fixinventorylib +certifi==2024.2.2 # via # kubernetes # requests @@ -29,142 +27,140 @@ cffi==1.16.0 # via # cryptography # pycares -charset-normalizer==3.3.0 - # via - # aiohttp - # requests -cheroot==10.0.0 +charset-normalizer==3.3.2 + # via requests +cheroot==10.0.1 # via cherrypy -cherrypy==18.8.0 - # via resotolib -cryptography==42.0.4 +cherrypy==18.9.0 + # via fixinventorylib +cryptography==42.0.7 # via # fixca (pyproject.toml) - # resotolib -frozendict==2.3.8 - # via resotolib -frozenlist==1.4.0 + # fixinventorylib +fixinventorylib==4.0.5 + # via fixca (pyproject.toml) +frozendict==2.4.4 + # via fixinventorylib +frozenlist==1.4.1 # via # aiohttp # aiosignal -google-auth==2.23.2 +google-auth==2.29.0 # via kubernetes -idna==3.4 +idna==3.7 # via # requests # yarl -inflect==7.0.0 +inflect==7.2.1 # via jaraco-text -jaraco-collections==4.3.0 +isodate==0.6.1 + # via fixinventorylib +jaraco-collections==5.0.1 # via cherrypy -jaraco-context==4.3.0 +jaraco-context==5.3.0 # via jaraco-text -jaraco-functools==3.9.0 +jaraco-functools==4.0.1 # via # cheroot # jaraco-text # tempora -jaraco-text==3.11.1 +jaraco-text==3.12.0 # via jaraco-collections jsons==1.6.3 - # via resotolib -kubernetes==28.1.0 + # via fixinventorylib +kubernetes==29.0.0 # via fixca (pyproject.toml) -more-itertools==10.1.0 +more-itertools==10.2.0 # via # cheroot # cherrypy + # inflect # jaraco-functools # jaraco-text -multidict==6.0.4 +multidict==6.0.5 # via # aiohttp # yarl -networkx==3.1 - # via resotolib +networkx==3.3 + # via fixinventorylib oauthlib==3.2.2 # via # kubernetes # requests-oauthlib parsy==2.1 - # via resotolib -pint==0.22 - # via resotolib + # via fixinventorylib +pint==0.23 + # via fixinventorylib portend==3.2.0 # via cherrypy -prometheus-client==0.17.1 - # via resotolib -psutil==5.9.5 - # via resotolib -pyasn1==0.5.0 +prometheus-client==0.20.0 + # via fixinventorylib +psutil==5.9.8 + # via fixinventorylib +pyasn1==0.6.0 # via # pyasn1-modules # rsa -pyasn1-modules==0.3.0 +pyasn1-modules==0.4.0 # via google-auth -pycares==4.3.0 +pycares==4.4.0 # via aiodns -pycparser==2.21 +pycparser==2.22 # via cffi -pydantic==2.4.2 - # via inflect -pydantic-core==2.10.1 - # via pydantic pyjwt==2.8.0 - # via resotolib -python-dateutil==2.8.2 + # via fixinventorylib +python-dateutil==2.9.0.post0 # via + # fixinventorylib # kubernetes - # resotolib -pytz==2023.3.post1 +pytz==2024.1 # via tempora pyyaml==6.0.1 # via + # fixinventorylib # kubernetes - # resotolib requests==2.31.0 # via + # fixinventorylib # kubernetes # requests-oauthlib - # resotolib -requests-oauthlib==1.3.1 +requests-oauthlib==2.0.0 # via kubernetes -resotolib==3.8.0 - # via fixca (pyproject.toml) rsa==4.9 # via google-auth -setuptools==68.2.2 +setuptools==69.5.1 # via zc-lockfile six==1.16.0 # via + # isodate # kubernetes # python-dateutil -tempora==5.5.0 +tempora==5.5.1 # via portend -typeguard==4.1.5 - # via resotolib -typing-extensions==4.8.0 +typeguard==4.2.1 + # via + # fixinventorylib + # inflect +typing-extensions==4.11.0 # via # inflect # pint - # pydantic - # pydantic-core # typeguard typish==1.9.3 # via jsons -tzdata==2023.3 - # via resotolib -tzlocal==5.0.1 - # via resotolib -urllib3==1.26.18 +tzdata==2024.1 + # via fixinventorylib +tzlocal==5.2 + # via fixinventorylib +urllib3==2.2.1 # via # kubernetes # requests -websocket-client==1.6.3 +websocket-client==1.8.0 # via + # fixinventorylib # kubernetes - # resotolib -yarl==1.9.2 +yarl==1.9.4 # via aiohttp zc-lockfile==3.0.post1 # via cherrypy