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 dependencies, bump version to 0.9.0 #42

Merged
merged 4 commits into from
Jun 8, 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
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ format:
test:
pip3 install .
ifdef GITHUB_ACTIONS
coverage run -m pytest -v --with_mongodb
coverage run -m pytest -W error -v --with_mongodb
else
coverage run -m pytest -v
coverage run -m pytest -W error -v
endif
coverage report -m
15 changes: 8 additions & 7 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
mypy==1.6.0
black==22.3.0
isort==5.10.1
flake8==6.1.0
coverage==6.3.2
pytest==7.1.2
pytest-asyncio==0.18.3
mypy==1.10.0
black==24.4.2
isort==5.13.2
flake8==7.0.0
coverage==7.5.3
pytest==8.2.2
pytest-asyncio==0.23.7
setuptools==70.0.0
9 changes: 7 additions & 2 deletions enochecker3/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def format(self, record: logging.LogRecord) -> str:
trunc: int = message_size + len(suffix) - 32766
msg.message = msg.message[:-trunc] + suffix

return LOGGING_PREFIX + msg.json(by_alias=True)
return LOGGING_PREFIX + msg.model_dump_json(by_alias=True)

def to_level(self, levelname: str) -> int:
if levelname == "CRITICAL":
Expand All @@ -67,7 +67,9 @@ def create_message(self, record: logging.LogRecord) -> EnoLogMessage:
type="infrastructure",
severity=record.levelname,
severity_level=self.to_level(record.levelname),
timestamp=datetime.datetime.utcnow().strftime("%Y-%m-%dT%H:%M:%S.%fZ"),
timestamp=datetime.datetime.now(datetime.timezone.utc).strftime(
"%Y-%m-%dT%H:%M:%S.%fZ"
),
message=record.msg,
module=record.module,
function=record.funcName,
Expand All @@ -81,4 +83,7 @@ def create_message(self, record: logging.LogRecord) -> EnoLogMessage:
flag=getattr(checker_task, "flag", None),
variant_id=getattr(checker_task, "variant_id", None),
task_chain_id=getattr(checker_task, "task_chain_id", None),
flag_regex=getattr(checker_task, "flag_regex", None),
flag_hash=getattr(checker_task, "flag_hash", None),
attack_info=getattr(checker_task, "attack_info", None),
)
12 changes: 8 additions & 4 deletions enochecker3/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
from enum import Enum
from typing import ClassVar, Optional

from pydantic import AliasGenerator
from pydantic import BaseModel as PydanticBaseModel
from pydantic import ConfigDict
from pydantic.alias_generators import to_camel

SNAKE_CASE_PATTERN = re.compile("(_[a-z])")

Expand All @@ -12,10 +15,11 @@ def _to_camel_case(x: str) -> str:


class BaseModel(PydanticBaseModel):
class Config:
use_enum_values = True
alias_generator = _to_camel_case
allow_population_by_field_name = True
model_config = ConfigDict(
use_enum_values=True,
alias_generator=AliasGenerator(serialization_alias=to_camel),
populate_by_name=True,
)


class CheckerTaskResult(str, Enum):
Expand Down
10 changes: 5 additions & 5 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
httpx>=0.23.0,<0.24.0
motor>=3.1.2,<4.0.0
fastapi>=0.75.2,<0.76.0
uvicorn>=0.17.6,<0.18.0
gunicorn==20.1.0
httpx>=0.27.0,<0.28.0
motor>=3.4.0,<4.0.0
fastapi>=0.111.0,<0.112.0
uvicorn>=0.30.1,<0.31.0
gunicorn==22.0.0
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

setuptools.setup(
name="enochecker3",
version="0.8.1",
version="0.9.0",
author="ldruschk",
author_email="[email protected]",
description="FastAPI based library for building async python checkers for the EnoEngine A/D CTF Framework",
Expand Down
Loading