Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump libs and migrate resotolib -> fixlib #12

Merged
merged 2 commits into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions fixca/__main__.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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)

Expand Down Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion fixca/args.py
Original file line number Diff line number Diff line change
@@ -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


Expand Down
6 changes: 3 additions & 3 deletions fixca/ca.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion fixca/k8s.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ keywords = ["cloud security"]

dependencies = [
"cryptography",
"resotolib",
"fixinventorylib",
"kubernetes",
]

Expand Down
Loading
Loading