mirror of
https://github.com/trailofbits/buttercup
synced 2026-06-21 14:11:39 +00:00
Revert "refactor: standardize packaging across all components (#266)"
This reverts commit cc938e105f.
This commit is contained in:
committed by
Riccardo Schirone
parent
465d05fa9c
commit
a533a28d47
+11
-65
@@ -1,41 +1,24 @@
|
||||
[project]
|
||||
name = "common"
|
||||
version = "0.1.0"
|
||||
description = "Shared utilities and components for Buttercup CRS"
|
||||
authors = [{ name = "Trail of Bits", email = "opensource@trailofbits.com" }]
|
||||
license = "AGPL-3.0"
|
||||
requires-python = ">=3.12,<3.13"
|
||||
keywords = ["cybersecurity", "crs", "utilities", "protobuf", "redis", "telemetry"]
|
||||
classifiers = [
|
||||
"Development Status :: 4 - Beta",
|
||||
"Intended Audience :: Developers",
|
||||
"License :: OSI Approved :: GNU Affero General Public License v3",
|
||||
"Programming Language :: Python :: 3",
|
||||
"Programming Language :: Python :: 3.12",
|
||||
"Topic :: Security",
|
||||
"Topic :: Software Development :: Libraries :: Python Modules",
|
||||
"Operating System :: POSIX :: Linux",
|
||||
]
|
||||
description = ""
|
||||
authors = [{ name = "Trail of Bits", email = "opensource@trailofbits" }]
|
||||
requires-python = ">=3.10,<3.13"
|
||||
dependencies = [
|
||||
"protobuf (>=3.20, <=3.20.3)",
|
||||
"pydantic-settings~=2.7.1",
|
||||
"pymongo~=4.10.1",
|
||||
"redis~=5.2.1",
|
||||
"pydantic-settings>=2.7.1",
|
||||
"pymongo>=4.10.1",
|
||||
"redis (>=5.2.1,<6.0.0)",
|
||||
"langchain-core~=0.3.32",
|
||||
"langchain-openai~=0.3.2",
|
||||
"langfuse ~= 2.59.2",
|
||||
"langchain ~= 0.3.18",
|
||||
"six~=1.17.0",
|
||||
"six>=1.17.0",
|
||||
"openlit == 1.32.12", # 1.33 currently fails to import opentelemetry.sdk._events
|
||||
"langchain-community ~= 0.3.20", # implicit dep of openlit if you instrument langchain
|
||||
"langchain-text-splitters ~= 0.3.7", # implicit dep of openlit if you instrument langchain
|
||||
]
|
||||
|
||||
[project.urls]
|
||||
Repository = "https://github.com/trailofbits/buttercup"
|
||||
Issues = "https://github.com/trailofbits/buttercup/issues"
|
||||
Documentation = "https://github.com/trailofbits/buttercup#readme"
|
||||
|
||||
[project.scripts]
|
||||
buttercup-util = "buttercup.common.util_cli:main"
|
||||
buttercup-challenge-task = "buttercup.common.challenge_task_cli:main"
|
||||
@@ -51,42 +34,17 @@ build-backend = "hatchling.build"
|
||||
|
||||
[dependency-groups]
|
||||
dev = [
|
||||
"pytest ~= 8.3.4",
|
||||
"ruff ~= 0.12.8",
|
||||
"mypy ~= 1.15.0",
|
||||
"pytest>=8.3.4",
|
||||
"ruff>=0.9.2",
|
||||
"mypy>=1.15.0",
|
||||
"types-requests",
|
||||
"types-PyYAML",
|
||||
"types-redis",
|
||||
"dirty-equals ~= 0.9.0",
|
||||
]
|
||||
|
||||
[tool.coverage.run]
|
||||
source = ["src/buttercup"]
|
||||
omit = ["*/tests/*", "*/__cli__.py", "*/_cli.py", "*/util_cli.py", "*/challenge_task_cli.py", "*/task_registry.py"]
|
||||
|
||||
[tool.coverage.report]
|
||||
exclude_lines = [
|
||||
"pragma: no cover",
|
||||
"def __repr__",
|
||||
"if __name__ == .__main__.:",
|
||||
"raise NotImplementedError",
|
||||
"if TYPE_CHECKING:",
|
||||
]
|
||||
|
||||
[tool.pytest.ini_options]
|
||||
testpaths = ["tests"]
|
||||
python_files = ["test_*.py"]
|
||||
python_classes = ["Test*"]
|
||||
python_functions = ["test_*"]
|
||||
addopts = "-v --tb=short --strict-markers"
|
||||
markers = [
|
||||
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
|
||||
"integration: marks tests as integration tests",
|
||||
"dirty-equals>=0.9.0",
|
||||
]
|
||||
|
||||
[tool.ruff]
|
||||
line-length = 120
|
||||
target-version = "py312"
|
||||
exclude = [
|
||||
"./src/buttercup/common/datastructures",
|
||||
"./src/buttercup/common/clusterfuzz_env",
|
||||
@@ -94,18 +52,6 @@ exclude = [
|
||||
"src/buttercup/common/clusterfuzz_utils.py",
|
||||
]
|
||||
|
||||
[tool.ruff.lint]
|
||||
select = ["E", "F", "I", "W", "UP"]
|
||||
ignore = ["COM812", "ISC001"] # Formatter conflicts
|
||||
|
||||
[tool.ruff.lint.per-file-ignores]
|
||||
"tests/**/*.py" = ["S101", "D"] # Allow asserts, no docstrings in tests
|
||||
"*/__cli__.py" = ["T201"] # Allow print in CLI modules
|
||||
"*/util_cli.py" = ["T201"]
|
||||
"*/challenge_task_cli.py" = ["T201"]
|
||||
"*/task_registry.py" = ["T201"]
|
||||
"src/buttercup/common/node_local.py" = ["UP040"] # PEP 695 type aliases break runtime usage as constructors
|
||||
|
||||
[tool.mypy]
|
||||
plugins = ["pydantic.mypy"]
|
||||
mypy_path = "src"
|
||||
|
||||
@@ -1,29 +1,26 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from dataclasses import dataclass, field
|
||||
from pathlib import Path
|
||||
from typing import Dict, Any, Callable, TypeVar, cast
|
||||
from os import PathLike
|
||||
from functools import wraps, cached_property
|
||||
import contextlib
|
||||
import logging
|
||||
import os
|
||||
import re
|
||||
import shlex
|
||||
import shutil
|
||||
import subprocess
|
||||
import tempfile
|
||||
import uuid
|
||||
from collections.abc import Callable, Iterator
|
||||
import os
|
||||
from contextlib import contextmanager
|
||||
from dataclasses import dataclass, field
|
||||
from functools import cached_property, wraps
|
||||
from os import PathLike
|
||||
from pathlib import Path
|
||||
from typing import Any, TypeVar, cast
|
||||
|
||||
from packaging.version import Version
|
||||
|
||||
import buttercup.common.node_local as node_local
|
||||
from buttercup.common.constants import ARCHITECTURE
|
||||
from buttercup.common.stack_parsing import get_crash_token
|
||||
import tempfile
|
||||
import shutil
|
||||
import uuid
|
||||
import subprocess
|
||||
import re
|
||||
from buttercup.common.task_meta import TaskMeta
|
||||
from buttercup.common.utils import copyanything, get_diffs
|
||||
from buttercup.common.stack_parsing import get_crash_token
|
||||
from typing import Iterator
|
||||
import buttercup.common.node_local as node_local
|
||||
from buttercup.common.constants import ARCHITECTURE
|
||||
from packaging.version import Version
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -367,7 +364,7 @@ class ChallengeTask:
|
||||
return current_line
|
||||
|
||||
def _run_cmd(
|
||||
self, cmd: list[str], cwd: Path | None = None, log: bool = True, env_helper: dict[str, str] | None = None
|
||||
self, cmd: list[str], cwd: Path | None = None, log: bool = True, env_helper: Dict[str, str] | None = None
|
||||
) -> CommandResult:
|
||||
try:
|
||||
if env_helper:
|
||||
@@ -422,7 +419,7 @@ class ChallengeTask:
|
||||
logger.exception(f"Command failed (cwd={cwd}): {' '.join(cmd)}")
|
||||
return CommandResult(success=False, returncode=None, error=str(e).encode(), output=None)
|
||||
|
||||
def _run_helper_cmd(self, cmd: list[str], env_helper: dict[str, str] | None = None) -> CommandResult:
|
||||
def _run_helper_cmd(self, cmd: list[str], env_helper: Dict[str, str] | None = None) -> CommandResult:
|
||||
oss_fuzz_subpath = self.get_oss_fuzz_subpath()
|
||||
if oss_fuzz_subpath is None:
|
||||
raise ChallengeTaskError("OSS-Fuzz path not found")
|
||||
@@ -567,8 +564,8 @@ class ChallengeTask:
|
||||
architecture: str | None = ARCHITECTURE,
|
||||
engine: str | None = None,
|
||||
sanitizer: str | None = None,
|
||||
env: dict[str, str] | None = None,
|
||||
env_helper: dict[str, str] | None = None,
|
||||
env: Dict[str, str] | None = None,
|
||||
env_helper: Dict[str, str] | None = None,
|
||||
) -> CommandResult:
|
||||
logger.info(
|
||||
"Building fuzzers for project %s | architecture=%s | engine=%s | sanitizer=%s | env=%s | use_source_dir=%s",
|
||||
@@ -613,8 +610,8 @@ class ChallengeTask:
|
||||
engine: str | None = None,
|
||||
sanitizer: str | None = None,
|
||||
pull_latest_base_image: bool = True,
|
||||
env: dict[str, str] | None = None,
|
||||
env_helper: dict[str, str] | None = None,
|
||||
env: Dict[str, str] | None = None,
|
||||
env_helper: Dict[str, str] | None = None,
|
||||
) -> CommandResult:
|
||||
check_build_res = self.check_build(architecture=architecture, engine=engine, sanitizer=sanitizer, env=env)
|
||||
if check_build_res.success:
|
||||
@@ -642,7 +639,7 @@ class ChallengeTask:
|
||||
engine: str | None = None,
|
||||
sanitizer: str | None = None,
|
||||
pull_latest_base_image: bool = True,
|
||||
env: dict[str, str] | None = None,
|
||||
env: Dict[str, str] | None = None,
|
||||
) -> CommandResult:
|
||||
env_helper = {
|
||||
"OSS_FUZZ_SAVE_CONTAINERS_NAME": container_name,
|
||||
@@ -665,7 +662,7 @@ class ChallengeTask:
|
||||
architecture: str | None = ARCHITECTURE,
|
||||
engine: str | None = None,
|
||||
sanitizer: str | None = None,
|
||||
env: dict[str, str] | None = None,
|
||||
env: Dict[str, str] | None = None,
|
||||
) -> CommandResult:
|
||||
logger.info(
|
||||
"Checking build for project %s | architecture=%s | engine=%s | sanitizer=%s | env=%s",
|
||||
@@ -694,11 +691,10 @@ class ChallengeTask:
|
||||
fuzzer_args: list[str] | None = None,
|
||||
*,
|
||||
architecture: str | None = ARCHITECTURE,
|
||||
env: dict[str, str] | None = None,
|
||||
env: Dict[str, str] | None = None,
|
||||
) -> ReproduceResult:
|
||||
logger.info(
|
||||
"Reproducing POV for project %s | fuzzer_name=%s | crash_path=%s | "
|
||||
"fuzzer_args=%s | architecture=%s | env=%s",
|
||||
"Reproducing POV for project %s | fuzzer_name=%s | crash_path=%s | fuzzer_args=%s | architecture=%s | env=%s",
|
||||
self.project_name,
|
||||
fuzzer_name,
|
||||
crash_path,
|
||||
@@ -743,11 +739,10 @@ class ChallengeTask:
|
||||
architecture: str | None = ARCHITECTURE,
|
||||
engine: str | None = None,
|
||||
sanitizer: str | None = None,
|
||||
env: dict[str, str] | None = None,
|
||||
env: Dict[str, str] | None = None,
|
||||
) -> CommandResult:
|
||||
logger.info(
|
||||
"Running fuzzer for project %s | harness_name=%s | fuzzer_args=%s | corpus_dir=%s | "
|
||||
"architecture=%s | engine=%s | sanitizer=%s | env=%s",
|
||||
"Running fuzzer for project %s | harness_name=%s | fuzzer_args=%s | corpus_dir=%s | architecture=%s | engine=%s | sanitizer=%s | env=%s",
|
||||
self.project_name,
|
||||
harness_name,
|
||||
fuzzer_args,
|
||||
@@ -779,7 +774,7 @@ class ChallengeTask:
|
||||
harness_name: str,
|
||||
corpus_dir: str,
|
||||
architecture: str | None = ARCHITECTURE,
|
||||
env: dict[str, str] | None = None,
|
||||
env: Dict[str, str] | None = None,
|
||||
) -> CommandResult:
|
||||
logger.info(
|
||||
"Running coverage for project %s | harness_name=%s | corpus_dir=%s | architecture=%s | env=%s",
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
from collections.abc import Iterator
|
||||
from contextlib import contextmanager
|
||||
from pathlib import Path
|
||||
|
||||
from pydantic_settings import BaseSettings, CliSubCommand, get_subcommand, CliImplicitFlag
|
||||
from pydantic import BaseModel
|
||||
from pydantic_settings import BaseSettings, CliImplicitFlag, CliSubCommand, get_subcommand
|
||||
|
||||
from buttercup.common.challenge_task import ChallengeTask, CommandResult, ReproduceResult
|
||||
from buttercup.common.logger import setup_package_logger
|
||||
from pathlib import Path
|
||||
from typing import Dict
|
||||
from contextlib import contextmanager
|
||||
from typing import Iterator
|
||||
|
||||
|
||||
class BuildImageCommand(BaseModel):
|
||||
@@ -23,7 +22,7 @@ class BuildFuzzersCommand(BaseModel):
|
||||
architecture: str | None = None
|
||||
engine: str | None = None
|
||||
sanitizer: str | None = None
|
||||
env: dict[str, str] | None = None
|
||||
env: Dict[str, str] | None = None
|
||||
use_cache: bool = True
|
||||
|
||||
|
||||
@@ -31,7 +30,7 @@ class CheckBuildCommand(BaseModel):
|
||||
architecture: str | None = None
|
||||
engine: str | None = None
|
||||
sanitizer: str | None = None
|
||||
env: dict[str, str] | None = None
|
||||
env: Dict[str, str] | None = None
|
||||
|
||||
|
||||
class ReproducePovCommand(BaseModel):
|
||||
@@ -39,7 +38,7 @@ class ReproducePovCommand(BaseModel):
|
||||
crash_path: Path
|
||||
fuzzer_args: list[str] | None = None
|
||||
architecture: str | None = None
|
||||
env: dict[str, str] | None = None
|
||||
env: Dict[str, str] | None = None
|
||||
|
||||
|
||||
class Settings(BaseSettings):
|
||||
|
||||
@@ -1,17 +1,15 @@
|
||||
import hashlib
|
||||
import logging
|
||||
import os
|
||||
import shutil
|
||||
import subprocess
|
||||
import tempfile
|
||||
from pathlib import Path
|
||||
from typing import BinaryIO
|
||||
|
||||
from redis import Redis
|
||||
|
||||
from typing import BinaryIO, List
|
||||
import buttercup.common.node_local as node_local
|
||||
from buttercup.common.constants import CORPUS_DIR_NAME, CRASH_DIR_NAME
|
||||
import os
|
||||
import hashlib
|
||||
import shutil
|
||||
import subprocess
|
||||
from pathlib import Path
|
||||
from redis import Redis
|
||||
from buttercup.common.sets import MergedCorpusSet
|
||||
import tempfile
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -99,7 +97,7 @@ class InputDir:
|
||||
return len(name) == 64 and all(c in "0123456789abcdef" for c in name)
|
||||
|
||||
@classmethod
|
||||
def hash_corpus(cls, path: str) -> list[str]:
|
||||
def hash_corpus(cls, path: str) -> List[str]:
|
||||
hashed_files = []
|
||||
for file in os.listdir(path):
|
||||
# If the file is already a hash, skip it
|
||||
|
||||
@@ -8,13 +8,12 @@ from pathlib import Path
|
||||
from typing import Any
|
||||
|
||||
from redis import Redis
|
||||
|
||||
from buttercup.common.maps import CoverageMap, FunctionCoverage, HarnessWeights
|
||||
|
||||
# Add matplotlib import for visualization
|
||||
try:
|
||||
import matplotlib.dates as mdates
|
||||
import matplotlib.pyplot as plt
|
||||
import matplotlib.dates as mdates
|
||||
|
||||
MATPLOTLIB_AVAILABLE = True
|
||||
except ImportError:
|
||||
@@ -369,7 +368,7 @@ class CoverageMonitor:
|
||||
list_only: If True, only list the available harnesses without analyzing.
|
||||
"""
|
||||
try:
|
||||
with open(file_path) as f:
|
||||
with open(file_path, "r") as f:
|
||||
coverage_snapshots = json.load(f)
|
||||
|
||||
if not coverage_snapshots:
|
||||
@@ -383,9 +382,10 @@ class CoverageMonitor:
|
||||
|
||||
# List all available harnesses
|
||||
print(f"Coverage file: {file_path}")
|
||||
start_time = datetime.fromtimestamp(coverage_snapshots[0]['timestamp']).strftime('%Y-%m-%d %H:%M:%S')
|
||||
end_time = datetime.fromtimestamp(coverage_snapshots[-1]['timestamp']).strftime('%Y-%m-%d %H:%M:%S')
|
||||
print(f"Time range: {start_time} - {end_time}")
|
||||
print(
|
||||
f"Time range: {datetime.fromtimestamp(coverage_snapshots[0]['timestamp']).strftime('%Y-%m-%d %H:%M:%S')} - "
|
||||
f"{datetime.fromtimestamp(coverage_snapshots[-1]['timestamp']).strftime('%Y-%m-%d %H:%M:%S')}"
|
||||
)
|
||||
print(f"Total snapshots: {len(coverage_snapshots)}")
|
||||
print("\nAvailable harnesses:")
|
||||
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
import logging
|
||||
import random
|
||||
from abc import ABC, abstractmethod
|
||||
|
||||
from redis import Redis
|
||||
|
||||
from buttercup.common.datastructures.msg_pb2 import BuildOutput, BuildType, WeightedHarness
|
||||
from buttercup.common.maps import BuildMap, HarnessWeights
|
||||
from buttercup.common.utils import serve_loop
|
||||
from buttercup.common.datastructures.msg_pb2 import WeightedHarness, BuildOutput, BuildType
|
||||
from buttercup.common.maps import HarnessWeights, BuildMap
|
||||
|
||||
import random
|
||||
import logging
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
import functools
|
||||
import logging
|
||||
import os
|
||||
from enum import Enum
|
||||
from typing import Any
|
||||
|
||||
import requests
|
||||
from langchain.callbacks.base import BaseCallbackHandler
|
||||
import functools
|
||||
from langchain_core.language_models import BaseChatModel
|
||||
from langchain_core.runnables import ConfigurableField
|
||||
from langchain_openai.chat_models import ChatOpenAI
|
||||
from langfuse.callback import CallbackHandler
|
||||
from langchain.callbacks.base import BaseCallbackHandler
|
||||
from langchain_core.runnables import ConfigurableField
|
||||
|
||||
import logging
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -1,20 +1,17 @@
|
||||
import os
|
||||
|
||||
from opentelemetry._logs import set_logger_provider
|
||||
import os
|
||||
|
||||
if os.environ.get("OTEL_EXPORTER_OTLP_PROTOCOL") == "grpc":
|
||||
from opentelemetry.exporter.otlp.proto.grpc._log_exporter import OTLPLogExporter
|
||||
else:
|
||||
from opentelemetry.exporter.otlp.proto.http._log_exporter import OTLPLogExporter # type: ignore
|
||||
|
||||
import logging
|
||||
import tempfile
|
||||
|
||||
from opentelemetry.sdk._logs import LoggerProvider, LoggingHandler
|
||||
from opentelemetry.sdk._logs.export import BatchLogRecordProcessor
|
||||
from opentelemetry.sdk.resources import Resource
|
||||
|
||||
from buttercup.common.telemetry import crs_instance_id, service_instance_id
|
||||
import logging
|
||||
import tempfile
|
||||
|
||||
_is_initialized = False
|
||||
PACKAGE_LOGGER_NAME = "buttercup"
|
||||
|
||||
@@ -1,17 +1,16 @@
|
||||
from collections.abc import Iterator
|
||||
|
||||
from bson.json_util import CANONICAL_JSON_OPTIONS, dumps
|
||||
from google.protobuf.message import Message
|
||||
from typing import Generic, TypeVar, Type, Iterator
|
||||
from buttercup.common.datastructures.msg_pb2 import WeightedHarness, BuildOutput, FunctionCoverage, BuildType
|
||||
from redis import Redis
|
||||
|
||||
from buttercup.common.datastructures.msg_pb2 import BuildOutput, BuildType, FunctionCoverage, WeightedHarness
|
||||
from bson.json_util import dumps, CANONICAL_JSON_OPTIONS
|
||||
from google.protobuf.message import Message
|
||||
from buttercup.common.sets import RedisSet
|
||||
|
||||
MsgType = TypeVar("MsgType", bound=Message)
|
||||
MSG_FIELD_NAME = b"msg"
|
||||
|
||||
|
||||
class RedisMap[MsgType: Message]:
|
||||
def __init__(self, redis: Redis, hash_name: str, msg_builder: type[MsgType]):
|
||||
class RedisMap(Generic[MsgType]):
|
||||
def __init__(self, redis: Redis, hash_name: str, msg_builder: Type[MsgType]):
|
||||
self.redis = redis
|
||||
self.msg_builder = msg_builder
|
||||
self.hash_name = hash_name
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
# Store the node local path for subsequent use
|
||||
from contextlib import contextmanager
|
||||
import logging
|
||||
import os
|
||||
from pathlib import Path
|
||||
import shutil
|
||||
import tarfile
|
||||
import tempfile
|
||||
from collections.abc import Iterator
|
||||
from contextlib import AbstractContextManager, contextmanager
|
||||
from pathlib import Path
|
||||
from tempfile import NamedTemporaryFile
|
||||
from typing import Any, TypeAlias
|
||||
import tempfile
|
||||
from typing import Any, Iterator, TypeAlias
|
||||
from contextlib import AbstractContextManager
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
from dataclasses import dataclass, field
|
||||
from enum import Enum
|
||||
|
||||
import yaml
|
||||
|
||||
from buttercup.common.challenge_task import ChallengeTask
|
||||
from enum import Enum
|
||||
|
||||
|
||||
class Language(str, Enum):
|
||||
|
||||
@@ -1,32 +1,31 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import logging
|
||||
import os
|
||||
import uuid
|
||||
from collections.abc import Callable
|
||||
from dataclasses import dataclass, field
|
||||
from enum import Enum
|
||||
from functools import wraps
|
||||
from typing import Any, Literal, TypeVar, cast, overload
|
||||
|
||||
from google.protobuf.message import Message
|
||||
from redis import Redis, RedisError
|
||||
|
||||
from google.protobuf.message import Message
|
||||
from functools import wraps
|
||||
from buttercup.common.datastructures.msg_pb2 import (
|
||||
BuildOutput,
|
||||
BuildRequest,
|
||||
ConfirmedVulnerability,
|
||||
BuildOutput,
|
||||
Crash,
|
||||
IndexOutput,
|
||||
IndexRequest,
|
||||
Patch,
|
||||
POVReproduceRequest,
|
||||
POVReproduceResponse,
|
||||
TaskDelete,
|
||||
TaskDownload,
|
||||
TaskReady,
|
||||
TaskDelete,
|
||||
Patch,
|
||||
ConfirmedVulnerability,
|
||||
IndexRequest,
|
||||
IndexOutput,
|
||||
TracedCrash,
|
||||
POVReproduceRequest,
|
||||
POVReproduceResponse,
|
||||
)
|
||||
import logging
|
||||
from typing import Type, Generic, TypeVar, Literal, overload, Callable, cast
|
||||
import uuid
|
||||
import os
|
||||
from enum import Enum
|
||||
from typing import Any
|
||||
|
||||
|
||||
TIMES_DELIVERED_FIELD = "times_delivered"
|
||||
|
||||
@@ -80,8 +79,13 @@ POV_REPRODUCER_RESPONSES_TASK_TIMEOUT_MS = int(os.getenv("POV_REPRODUCER_RESPONS
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
# Type variable for protobuf Message subclasses
|
||||
# Used for type-hinting of reliable queue items
|
||||
MsgType = TypeVar("MsgType", bound=Message)
|
||||
|
||||
|
||||
@dataclass
|
||||
class RQItem[MsgType: Message]:
|
||||
class RQItem(Generic[MsgType]):
|
||||
"""
|
||||
A single item in a reliable queue.
|
||||
"""
|
||||
@@ -91,14 +95,14 @@ class RQItem[MsgType: Message]:
|
||||
|
||||
|
||||
@dataclass
|
||||
class ReliableQueue[MsgType: Message]:
|
||||
class ReliableQueue(Generic[MsgType]):
|
||||
"""
|
||||
A queue that is reliable and can be used to process tasks in a distributed environment.
|
||||
"""
|
||||
|
||||
redis: Redis
|
||||
queue_name: str
|
||||
msg_builder: type[MsgType]
|
||||
msg_builder: Type[MsgType]
|
||||
group_name: str | None = None
|
||||
task_timeout_ms: int = 180000
|
||||
reader_name: str | None = None
|
||||
@@ -135,9 +139,7 @@ class ReliableQueue[MsgType: Message]:
|
||||
@staticmethod
|
||||
def _ensure_group_name(func: F) -> F:
|
||||
@wraps(func)
|
||||
# Note: Must use Message instead of MsgType here since MsgType is a class-level
|
||||
# type parameter that's not in scope within this static method decorator
|
||||
def wrapper(self: ReliableQueue[Message], *args: Any, **kwargs: Any) -> Any:
|
||||
def wrapper(self: ReliableQueue[MsgType], *args: Any, **kwargs: Any) -> Any:
|
||||
if self.group_name is None:
|
||||
raise ValueError("group_name must be set for this operation")
|
||||
|
||||
@@ -213,7 +215,7 @@ class ReliableQueue[MsgType: Message]:
|
||||
@dataclass
|
||||
class QueueConfig:
|
||||
queue_name: QueueNames
|
||||
msg_builder: type
|
||||
msg_builder: Type
|
||||
task_timeout_ms: int
|
||||
group_names: list[GroupNames] = field(default_factory=list)
|
||||
|
||||
@@ -374,11 +376,11 @@ class QueueFactory:
|
||||
@overload
|
||||
def create(
|
||||
self, queue_name: QueueNames, group_name: GroupNames | None = None, **kwargs: Any
|
||||
) -> ReliableQueue[Message]: ...
|
||||
) -> ReliableQueue[MsgType]: ...
|
||||
|
||||
def create(
|
||||
self, queue_name: QueueNames, group_name: GroupNames | None = None, **kwargs: Any
|
||||
) -> ReliableQueue[Message]:
|
||||
) -> ReliableQueue[MsgType]:
|
||||
if queue_name not in self._config:
|
||||
raise ValueError(f"Invalid queue name: {queue_name}")
|
||||
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
from buttercup.common.datastructures.msg_pb2 import BuildOutput
|
||||
from buttercup.common.challenge_task import ReproduceResult, ChallengeTask
|
||||
from pathlib import Path
|
||||
from typing import Generator
|
||||
from contextlib import contextmanager
|
||||
import contextlib
|
||||
import logging
|
||||
from collections.abc import Generator
|
||||
from contextlib import contextmanager
|
||||
from pathlib import Path
|
||||
|
||||
from buttercup.common.challenge_task import ChallengeTask, ReproduceResult
|
||||
from buttercup.common.datastructures.msg_pb2 import BuildOutput
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any
|
||||
|
||||
from typing import Dict, Any, List
|
||||
from pydantic import BaseModel, Field
|
||||
from redis import Redis
|
||||
|
||||
@@ -9,12 +8,11 @@ from redis import Redis
|
||||
class SARIFBroadcastDetail(BaseModel):
|
||||
"""Model for SARIF broadcast details, matches the model in types.py"""
|
||||
|
||||
metadata: dict[str, Any] = Field(
|
||||
metadata: Dict[str, Any] = Field(
|
||||
...,
|
||||
description="String to string map containing data that should be attached to outputs like log messages "
|
||||
"and OpenTelemetry trace attributes for traceability",
|
||||
description="String to string map containing data that should be attached to outputs like log messages and OpenTelemetry trace attributes for traceability",
|
||||
)
|
||||
sarif: dict[str, Any] = Field(..., description="SARIF Report compliant with provided schema")
|
||||
sarif: Dict[str, Any] = Field(..., description="SARIF Report compliant with provided schema")
|
||||
sarif_id: str
|
||||
task_id: str
|
||||
|
||||
@@ -75,7 +73,7 @@ class SARIFStore:
|
||||
# Add to the list for this task
|
||||
self.redis.rpush(key, sarif_json)
|
||||
|
||||
def get_all(self) -> list[SARIFBroadcastDetail]:
|
||||
def get_all(self) -> List[SARIFBroadcastDetail]:
|
||||
"""
|
||||
Retrieve all SARIF objects from Redis.
|
||||
|
||||
@@ -99,7 +97,7 @@ class SARIFStore:
|
||||
|
||||
return result
|
||||
|
||||
def get_by_task_id(self, task_id: str) -> list[SARIFBroadcastDetail]:
|
||||
def get_by_task_id(self, task_id: str) -> List[SARIFBroadcastDetail]:
|
||||
"""
|
||||
Retrieve all SARIF objects for a specific task.
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@ Utility script for SARIF storage and retrieval operations.
|
||||
|
||||
import argparse
|
||||
import json
|
||||
|
||||
from redis import Redis
|
||||
|
||||
from buttercup.common.sarif_store import SARIFStore
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import json
|
||||
import random
|
||||
from collections.abc import Generator, Iterator
|
||||
from contextlib import contextmanager
|
||||
from functools import lru_cache
|
||||
|
||||
from bson.json_util import CANONICAL_JSON_OPTIONS, dumps
|
||||
from typing import Iterator
|
||||
from redis import Redis
|
||||
from redis.exceptions import ResponseError
|
||||
from bson.json_util import dumps, CANONICAL_JSON_OPTIONS
|
||||
from contextlib import contextmanager
|
||||
import random
|
||||
import json
|
||||
from functools import lru_cache
|
||||
from typing import Generator
|
||||
|
||||
# Import POVReproduceRequest for the refactored PoVReproduceStatus
|
||||
from buttercup.common.datastructures.msg_pb2 import POVReproduceRequest, POVReproduceResponse
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
import logging
|
||||
import re
|
||||
|
||||
from bson.json_util import CANONICAL_JSON_OPTIONS, dumps
|
||||
from redis import Redis
|
||||
|
||||
from buttercup.common.clusterfuzz_parser import CrashInfo, StackParser
|
||||
from buttercup.common.clusterfuzz_parser import StackParser, CrashInfo
|
||||
import logging
|
||||
from buttercup.common.sets import RedisSet
|
||||
from redis import Redis
|
||||
from bson.json_util import dumps, CANONICAL_JSON_OPTIONS
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from dataclasses import dataclass, asdict
|
||||
import json
|
||||
from dataclasses import asdict, dataclass
|
||||
from os import PathLike
|
||||
from pathlib import Path
|
||||
from os import PathLike
|
||||
|
||||
|
||||
@dataclass
|
||||
|
||||
@@ -1,14 +1,11 @@
|
||||
import builtins
|
||||
import time
|
||||
from collections.abc import Iterator
|
||||
from dataclasses import dataclass
|
||||
from functools import lru_cache
|
||||
|
||||
from google.protobuf import text_format
|
||||
from redis import Redis
|
||||
|
||||
from buttercup.common.datastructures.msg_pb2 import Task
|
||||
from redis import Redis
|
||||
from buttercup.common.queues import HashNames
|
||||
from dataclasses import dataclass
|
||||
from google.protobuf import text_format
|
||||
import time
|
||||
from typing import Set, Iterator
|
||||
|
||||
# Redis set keys for tracking task states
|
||||
CANCELLED_TASKS_SET = "cancelled_tasks"
|
||||
@@ -185,7 +182,7 @@ class TaskRegistry:
|
||||
# Decode bytes to strings if needed
|
||||
return [task_id.decode("utf-8") if isinstance(task_id, bytes) else task_id for task_id in cancelled_ids]
|
||||
|
||||
def should_stop_processing(self, task_or_id: str | Task, cancelled_ids: builtins.set[str] | None = None) -> bool:
|
||||
def should_stop_processing(self, task_or_id: str | Task, cancelled_ids: Set[str] | None = None) -> bool:
|
||||
"""Check if a task should no longer be processed due to cancellation or expiration.
|
||||
|
||||
Args:
|
||||
@@ -285,10 +282,9 @@ class TaskRegistry:
|
||||
|
||||
def task_registry_cli() -> None:
|
||||
"""CLI for the task registry"""
|
||||
from typing import Annotated
|
||||
|
||||
from pydantic import Field
|
||||
from pydantic_settings import BaseSettings
|
||||
from typing import Annotated
|
||||
from pydantic import Field
|
||||
|
||||
class TaskRegistrySettings(BaseSettings):
|
||||
redis_url: Annotated[str, Field(default="redis://localhost:6379", description="Redis URL")]
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import logging
|
||||
import os
|
||||
import uuid
|
||||
import logging
|
||||
from enum import Enum
|
||||
import uuid
|
||||
from typing import Any
|
||||
|
||||
import openlit
|
||||
import opentelemetry.attributes
|
||||
from langchain_core.prompt_values import ChatPromptValue
|
||||
from opentelemetry import trace
|
||||
from opentelemetry.trace import Span, Status, StatusCode, Tracer
|
||||
from opentelemetry.trace import Span, Tracer, Status, StatusCode
|
||||
from langchain_core.prompt_values import ChatPromptValue
|
||||
|
||||
# Monkey patch the _clean_attribute function to handle ChatPromptValue
|
||||
_clean_attribute_orig = opentelemetry.attributes._clean_attribute
|
||||
|
||||
@@ -1,27 +1,26 @@
|
||||
import logging
|
||||
from pathlib import Path
|
||||
from typing import Annotated
|
||||
from uuid import uuid4
|
||||
|
||||
from google.protobuf.text_format import Parse
|
||||
from pydantic import BaseModel, Field
|
||||
from pydantic_settings import BaseSettings, CliPositionalArg, CliSubCommand, get_subcommand
|
||||
from redis import Redis
|
||||
|
||||
from buttercup.common.datastructures.msg_pb2 import (
|
||||
BuildOutput,
|
||||
BuildType,
|
||||
SubmissionEntry,
|
||||
SubmissionResult,
|
||||
WeightedHarness,
|
||||
)
|
||||
from buttercup.common.logger import setup_package_logger
|
||||
from buttercup.common.maps import (
|
||||
BuildMap,
|
||||
HarnessWeights,
|
||||
)
|
||||
from buttercup.common.datastructures.msg_pb2 import (
|
||||
BuildOutput,
|
||||
BuildType,
|
||||
WeightedHarness,
|
||||
SubmissionEntry,
|
||||
SubmissionResult,
|
||||
)
|
||||
from buttercup.common.queues import QueueFactory, QueueNames, ReliableQueue
|
||||
from buttercup.common.task_registry import TaskRegistry
|
||||
from uuid import uuid4
|
||||
from redis import Redis
|
||||
from pydantic_settings import BaseSettings, CliSubCommand, CliPositionalArg, get_subcommand
|
||||
from pydantic import BaseModel
|
||||
from typing import Annotated
|
||||
from pydantic import Field
|
||||
from pathlib import Path
|
||||
from google.protobuf.text_format import Parse
|
||||
import logging
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
import shutil
|
||||
import errno
|
||||
import logging
|
||||
import os
|
||||
import shutil
|
||||
import threading
|
||||
import time
|
||||
from collections.abc import Callable
|
||||
from os import PathLike
|
||||
from typing import Any, Callable
|
||||
from pathlib import Path
|
||||
from typing import Any
|
||||
from os import PathLike
|
||||
import time
|
||||
import threading
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -1,20 +1,18 @@
|
||||
import base64
|
||||
import os
|
||||
import subprocess
|
||||
import tempfile
|
||||
from pathlib import Path
|
||||
from unittest.mock import MagicMock, patch
|
||||
|
||||
import pytest
|
||||
from unittest.mock import MagicMock, patch
|
||||
from dirty_equals import IsStr
|
||||
|
||||
import subprocess
|
||||
import os
|
||||
import base64
|
||||
from buttercup.common.challenge_task import (
|
||||
ChallengeTask,
|
||||
ChallengeTaskError,
|
||||
CommandResult,
|
||||
ReproduceResult,
|
||||
CommandResult,
|
||||
)
|
||||
from buttercup.common.task_meta import TaskMeta
|
||||
import tempfile
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
@@ -1042,10 +1040,7 @@ def test_reproduce_result_methods():
|
||||
command_result=CommandResult(
|
||||
success=False,
|
||||
returncode=124, # TIMEOUT_ERR_RESULT
|
||||
output=(
|
||||
b"INFO: Seed: 12345\nRunning normally\n"
|
||||
b"==ERROR: AddressSanitizer: heap-buffer-overflow\nTimeout occurred"
|
||||
),
|
||||
output=b"INFO: Seed: 12345\nRunning normally\n==ERROR: AddressSanitizer: heap-buffer-overflow\nTimeout occurred",
|
||||
error=None,
|
||||
)
|
||||
)
|
||||
@@ -1065,58 +1060,42 @@ def test_reproduce_result_methods():
|
||||
assert result7.did_crash() is False # Should not detect crash due to no crash token
|
||||
|
||||
# Test case 8: Timeout with crash token in error output
|
||||
output = (
|
||||
b"/out/fuzzer-postauth_nomaths -rss_limit_mb=2560 -timeout=25 -runs=100 /testcase "
|
||||
b"-max_len=50000 -timeout_exitcode=0 -dict=fuzzer-postauth_nomaths.dict < /dev/null\n"
|
||||
b"INFO: found LLVMFuzzerCustomMutator (0x5595fa311560). Disabling -len_control by default.\n"
|
||||
b"Dictionary: 58 entries\n"
|
||||
b"INFO: Running with entropic power schedule (0xFF, 100).\n"
|
||||
b"INFO: Seed: 3932698478\n"
|
||||
b"INFO: Loaded 1 modules (7459 inline 8-bit counters): 7459 [0x5595fa3cec00, 0x5595fa3d0923),\n"
|
||||
b"INFO: Loaded 1 PC tables (7459 PCs): 7459 [0x5595fa3d0928,0x5595fa3edb58),\n"
|
||||
b"/out/fuzzer-postauth_nomaths: Running 1 inputs 100 time(s) each.\n"
|
||||
b"Running: /testcase\n"
|
||||
b"Dropbear fuzzer: Disabling stderr output\n"
|
||||
b"fuzzer-postauth_nomaths: src/../fuzz/fuzz-wrapfd.c:216: "
|
||||
b"int wrapfd_select(int, fd_set *, fd_set *, fd_set *, struct timeval *): "
|
||||
b"Assertion `wrap_fds[i].mode != UNUSED' failed.\n"
|
||||
b"AddressSanitizer:DEADLYSIGNAL\n"
|
||||
b"=================================================================\n"
|
||||
b"==18==ERROR: AddressSanitizer: ABRT on unknown address 0x000000000012 "
|
||||
b"(pc 0x7f99ebd7600b bp 0x7f99ebeeb588 sp 0x7ffe363d6470 T0)\n"
|
||||
b"SCARINESS: 10 (signal)\n"
|
||||
b" #0 0x7f99ebd7600b in raise (/lib/x86_64-linux-gnu/libc.so.6+0x4300b) "
|
||||
b"(BuildId: 5792732f783158c66fb4f3756458ca24e46e827d)\n"
|
||||
b" #1 0x7f99ebd55858 in abort (/lib/x86_64-linux-gnu/libc.so.6+0x22858) "
|
||||
b"(BuildId: 5792732f783158c66fb4f3756458ca24e46e827d)\n"
|
||||
b" #2 0x7f99ebd55728 (/lib/x86_64-linux-gnu/libc.so.6+0x22728) "
|
||||
b"(BuildId: 5792732f783158c66fb4f3756458ca24e46e827d)\n"
|
||||
b" #3 0x7f99ebd66fd5 in __assert_fail (/lib/x86_64-linux-gnu/libc.so.6+0x33fd5) "
|
||||
b"(BuildId: 5792732f783158c66fb4f3756458ca24e46e827d)\n"
|
||||
b" #4 0x5595fa2befa5 in wrapfd_select /src/dropbear/src/../fuzz/fuzz-wrapfd.c:216:5\n"
|
||||
b" #5 0x5595fa2c004d in session_loop /src/dropbear/src/common-session.c:210:9\n"
|
||||
b" #6 0x5595fa3064a0 in svr_session /src/dropbear/src/svr-session.c:208:2\n"
|
||||
b" #7 0x5595fa2bcff1 in fuzz_run_server /src/dropbear/src/../fuzz/fuzz-common.c:287:9\n"
|
||||
b" #8 0x5595fa156620 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) "
|
||||
b"/src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:614:13\n"
|
||||
b" #9 0x5595fa141895 in fuzzer::RunOneTest(fuzzer::Fuzzer*, char const*, unsigned long) "
|
||||
b"/src/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:327:6\n"
|
||||
b" #10 0x5595fa14732f in fuzzer::FuzzerDriver(int*, char***, "
|
||||
b"int (*)(unsigned char const*, unsigned long)) "
|
||||
b"/src/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:862:9\n"
|
||||
b" #11 0x5595fa1725d2 in main /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerMain.cpp:20:10\n"
|
||||
b" #12 0x7f99ebd57082 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24082) "
|
||||
b"(BuildId: 5792732f783158c66fb4f3756458ca24e46e827d)\n"
|
||||
b" #13 0x5595fa139a7d in _start (/out/fuzzer-postauth_nomaths+0x7ea7d)\n"
|
||||
b"\n"
|
||||
b"DEDUP_TOKEN: raise--abort--\n"
|
||||
b"AddressSanitizer can not provide additional info.\n"
|
||||
b"SUMMARY: AddressSanitizer: ABRT (/lib/x86_64-linux-gnu/libc.so.6+0x4300b) "
|
||||
b"(BuildId: 5792732f783158c66fb4f3756458ca24e46e827d) in raise\n"
|
||||
b"==18==ABORTING\n"
|
||||
b"MS: 0 ; base unit: 0000000000000000000000000000000000000000\n"
|
||||
b"subprocess command returned a non-zero exit status: 1"
|
||||
)
|
||||
output = b"""/out/fuzzer-postauth_nomaths -rss_limit_mb=2560 -timeout=25 -runs=100 /testcase -max_len=50000 -timeout_exitcode=0 -dict=fuzzer-postauth_nomaths.dict < /dev/null
|
||||
INFO: found LLVMFuzzerCustomMutator (0x5595fa311560). Disabling -len_control by default.
|
||||
Dictionary: 58 entries
|
||||
INFO: Running with entropic power schedule (0xFF, 100).
|
||||
INFO: Seed: 3932698478
|
||||
INFO: Loaded 1 modules (7459 inline 8-bit counters): 7459 [0x5595fa3cec00, 0x5595fa3d0923),
|
||||
INFO: Loaded 1 PC tables (7459 PCs): 7459 [0x5595fa3d0928,0x5595fa3edb58),
|
||||
/out/fuzzer-postauth_nomaths: Running 1 inputs 100 time(s) each.
|
||||
Running: /testcase
|
||||
Dropbear fuzzer: Disabling stderr output
|
||||
fuzzer-postauth_nomaths: src/../fuzz/fuzz-wrapfd.c:216: int wrapfd_select(int, fd_set *, fd_set *, fd_set *, struct timeval *): Assertion `wrap_fds[i].mode != UNUSED' failed.
|
||||
AddressSanitizer:DEADLYSIGNAL
|
||||
=================================================================
|
||||
==18==ERROR: AddressSanitizer: ABRT on unknown address 0x000000000012 (pc 0x7f99ebd7600b bp 0x7f99ebeeb588 sp 0x7ffe363d6470 T0)
|
||||
SCARINESS: 10 (signal)
|
||||
#0 0x7f99ebd7600b in raise (/lib/x86_64-linux-gnu/libc.so.6+0x4300b) (BuildId: 5792732f783158c66fb4f3756458ca24e46e827d)
|
||||
#1 0x7f99ebd55858 in abort (/lib/x86_64-linux-gnu/libc.so.6+0x22858) (BuildId: 5792732f783158c66fb4f3756458ca24e46e827d)
|
||||
#2 0x7f99ebd55728 (/lib/x86_64-linux-gnu/libc.so.6+0x22728) (BuildId: 5792732f783158c66fb4f3756458ca24e46e827d)
|
||||
#3 0x7f99ebd66fd5 in __assert_fail (/lib/x86_64-linux-gnu/libc.so.6+0x33fd5) (BuildId: 5792732f783158c66fb4f3756458ca24e46e827d)
|
||||
#4 0x5595fa2befa5 in wrapfd_select /src/dropbear/src/../fuzz/fuzz-wrapfd.c:216:5
|
||||
#5 0x5595fa2c004d in session_loop /src/dropbear/src/common-session.c:210:9
|
||||
#6 0x5595fa3064a0 in svr_session /src/dropbear/src/svr-session.c:208:2
|
||||
#7 0x5595fa2bcff1 in fuzz_run_server /src/dropbear/src/../fuzz/fuzz-common.c:287:9
|
||||
#8 0x5595fa156620 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:614:13
|
||||
#9 0x5595fa141895 in fuzzer::RunOneTest(fuzzer::Fuzzer*, char const*, unsigned long) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:327:6
|
||||
#10 0x5595fa14732f in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:862:9
|
||||
#11 0x5595fa1725d2 in main /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerMain.cpp:20:10
|
||||
#12 0x7f99ebd57082 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24082) (BuildId: 5792732f783158c66fb4f3756458ca24e46e827d)
|
||||
#13 0x5595fa139a7d in _start (/out/fuzzer-postauth_nomaths+0x7ea7d)
|
||||
|
||||
DEDUP_TOKEN: raise--abort--
|
||||
AddressSanitizer can not provide additional info.
|
||||
SUMMARY: AddressSanitizer: ABRT (/lib/x86_64-linux-gnu/libc.so.6+0x4300b) (BuildId: 5792732f783158c66fb4f3756458ca24e46e827d) in raise
|
||||
==18==ABORTING
|
||||
MS: 0 ; base unit: 0000000000000000000000000000000000000000
|
||||
subprocess command returned a non-zero exit status: 1"""
|
||||
result8 = ReproduceResult(
|
||||
command_result=CommandResult(
|
||||
success=False,
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
import pytest
|
||||
import os
|
||||
import shutil
|
||||
import tempfile
|
||||
from pathlib import Path
|
||||
from unittest.mock import patch
|
||||
|
||||
import pytest
|
||||
|
||||
from buttercup.common.corpus import Corpus, InputDir
|
||||
from buttercup.common.corpus import InputDir, Corpus
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import pytest
|
||||
from redis import Redis
|
||||
|
||||
from buttercup.common.datastructures.msg_pb2 import FunctionCoverage
|
||||
from buttercup.common.maps import CoverageMap
|
||||
from buttercup.common.datastructures.msg_pb2 import FunctionCoverage
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
|
||||
@@ -3,7 +3,7 @@ import tempfile
|
||||
import unittest
|
||||
from unittest.mock import patch
|
||||
|
||||
from buttercup.common.clusterfuzz_utils import EXTRA_BUILD_DIR, get_fuzz_targets
|
||||
from buttercup.common.clusterfuzz_utils import get_fuzz_targets, EXTRA_BUILD_DIR
|
||||
|
||||
|
||||
class TestGetFuzzTargets(unittest.TestCase):
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import pytest
|
||||
from redis import Redis
|
||||
|
||||
from buttercup.common.datastructures.msg_pb2 import WeightedHarness
|
||||
from buttercup.common.maps import RedisMap
|
||||
from buttercup.common.datastructures.msg_pb2 import WeightedHarness
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
from pathlib import Path
|
||||
from unittest.mock import MagicMock, patch
|
||||
|
||||
from pathlib import Path
|
||||
import pytest
|
||||
|
||||
from buttercup.common.challenge_task import CommandResult, ReproduceResult
|
||||
from buttercup.common.datastructures.msg_pb2 import BuildOutput
|
||||
from buttercup.common.reproduce_multiple import ReproduceMultiple
|
||||
from buttercup.common.datastructures.msg_pb2 import BuildOutput
|
||||
from buttercup.common.challenge_task import ReproduceResult, CommandResult
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
@@ -19,22 +17,20 @@ def build_outputs():
|
||||
VALID_STDOUT = b"""
|
||||
INFO: Running with entropic power schedule (0xFF, 100).
|
||||
INFO: Seed: 954068278
|
||||
INFO: Loaded 1 modules (6849 inline 8-bit counters): 6849 [0x561a974abfe8, 0x561a974adaa9),
|
||||
INFO: Loaded 1 PC tables (6849 PCs): 6849 [0x561a974adab0,0x561a974c86c0),
|
||||
INFO: Loaded 1 modules (6849 inline 8-bit counters): 6849 [0x561a974abfe8, 0x561a974adaa9),
|
||||
INFO: Loaded 1 PC tables (6849 PCs): 6849 [0x561a974adab0,0x561a974c86c0),
|
||||
/out/libpng_read_fuzzer: Running 1 inputs 100 time(s) each.
|
||||
Running: /testcase
|
||||
DEBUG - pngrutil.c:1447:10: runtime error:
|
||||
DEBUG - pngrutil.c:1447:10: runtime error:
|
||||
"""
|
||||
|
||||
INVALID_STDOUT = (
|
||||
b"Unable to find image 'ghcr.io/aixcc-finals/base-runner:v1.0.0' locally\n"
|
||||
b'docker: Error response from daemon: Get "https://ghcr.io/v2/": net/http: '
|
||||
b"request canceled while waiting for connection "
|
||||
b"(Client.Timeout exceeded while awaiting headers)\n"
|
||||
b"\n"
|
||||
b"Run 'docker run --help' for more information\n"
|
||||
b"ERROR:__main__:libpng_read_fuzzer does not seem to exist. Please run build_fuzzers first.\n"
|
||||
)
|
||||
INVALID_STDOUT = b"""
|
||||
Unable to find image \'ghcr.io/aixcc-finals/base-runner:v1.0.0\' locally
|
||||
docker: Error response from daemon: Get "https://ghcr.io/v2/": net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
|
||||
|
||||
Run \'docker run --help\' for more information
|
||||
ERROR:__main__:libpng_read_fuzzer does not seem to exist. Please run build_fuzzers first.
|
||||
"""
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
|
||||
@@ -1,29 +1,25 @@
|
||||
import os
|
||||
from contextlib import contextmanager
|
||||
from pathlib import Path
|
||||
from unittest.mock import MagicMock, mock_open, patch
|
||||
|
||||
import pytest
|
||||
import os
|
||||
from unittest.mock import patch, mock_open, MagicMock
|
||||
from contextlib import contextmanager
|
||||
|
||||
from buttercup.common.node_local import (
|
||||
TmpDir,
|
||||
_get_root_path,
|
||||
dir_to_remote_archive,
|
||||
local_scratch_file,
|
||||
lopen,
|
||||
remote_scratch_file,
|
||||
rename_atomically,
|
||||
scratch_dir,
|
||||
scratch_path,
|
||||
TmpDir,
|
||||
temp_dir,
|
||||
)
|
||||
from buttercup.common.node_local import (
|
||||
remote_archive_path as remote_archive_path_func,
|
||||
)
|
||||
from buttercup.common.node_local import (
|
||||
rename_atomically,
|
||||
remote_path as remote_path_func,
|
||||
remote_archive_path as remote_archive_path_func,
|
||||
scratch_path,
|
||||
scratch_dir,
|
||||
local_scratch_file,
|
||||
remote_scratch_file,
|
||||
dir_to_remote_archive,
|
||||
lopen,
|
||||
)
|
||||
|
||||
|
||||
# Use this root path for all tests
|
||||
TEST_ROOT_PATH = Path("/test/node/data/dir")
|
||||
|
||||
|
||||
@@ -1,19 +1,17 @@
|
||||
import time
|
||||
|
||||
import pytest
|
||||
from google.protobuf.struct_pb2 import Struct
|
||||
import time
|
||||
from redis import Redis
|
||||
|
||||
from buttercup.common.datastructures.msg_pb2 import BuildOutput, BuildRequest
|
||||
from google.protobuf.struct_pb2 import Struct
|
||||
from buttercup.common.queues import (
|
||||
BUILD_OUTPUT_TASK_TIMEOUT_MS,
|
||||
BUILD_TASK_TIMEOUT_MS,
|
||||
GroupNames,
|
||||
QueueFactory,
|
||||
QueueNames,
|
||||
ReliableQueue,
|
||||
RQItem,
|
||||
QueueFactory,
|
||||
QueueNames,
|
||||
GroupNames,
|
||||
BUILD_TASK_TIMEOUT_MS,
|
||||
BUILD_OUTPUT_TASK_TIMEOUT_MS,
|
||||
)
|
||||
from buttercup.common.datastructures.msg_pb2 import BuildRequest, BuildOutput
|
||||
|
||||
GROUP_NAME = "test_group"
|
||||
QUEUE_NAME = "test_queue"
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
import json
|
||||
|
||||
import pytest
|
||||
import json
|
||||
from redis import Redis
|
||||
|
||||
from buttercup.common.sarif_store import SARIFBroadcastDetail, SARIFStore
|
||||
from buttercup.common.sarif_store import SARIFStore, SARIFBroadcastDetail
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
from unittest.mock import MagicMock
|
||||
|
||||
import pytest
|
||||
from redis import Redis
|
||||
|
||||
from buttercup.common.sets import RedisSet, PoVReproduceStatus
|
||||
from buttercup.common.datastructures.msg_pb2 import POVReproduceRequest, POVReproduceResponse
|
||||
from buttercup.common.sets import PoVReproduceStatus, RedisSet
|
||||
from unittest.mock import MagicMock
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1,11 +1,11 @@
|
||||
import time
|
||||
from unittest.mock import Mock, patch
|
||||
|
||||
import pytest
|
||||
from unittest.mock import Mock
|
||||
from buttercup.common.task_registry import TaskRegistry, CANCELLED_TASKS_SET, SUCCEEDED_TASKS_SET, ERRORED_TASKS_SET
|
||||
from buttercup.common.datastructures.msg_pb2 import Task, SourceDetail
|
||||
import time
|
||||
from typing import Set
|
||||
from redis import Redis
|
||||
|
||||
from buttercup.common.datastructures.msg_pb2 import SourceDetail, Task
|
||||
from buttercup.common.task_registry import CANCELLED_TASKS_SET, ERRORED_TASKS_SET, SUCCEEDED_TASKS_SET, TaskRegistry
|
||||
from unittest.mock import patch
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
@@ -432,7 +432,7 @@ def test_get_cancelled_task_ids(task_registry, redis_client):
|
||||
def test_should_stop_processing_with_cancelled_ids(task_registry, redis_client):
|
||||
"""Test that should_stop_processing handles cancelled_ids correctly."""
|
||||
# Create a set of cancelled IDs
|
||||
cancelled_ids: set[str] = {"cancelled-task-1", "cancelled-task-2"}
|
||||
cancelled_ids: Set[str] = {"cancelled-task-1", "cancelled-task-2"}
|
||||
|
||||
# Create tasks to test with
|
||||
current_time = int(time.time())
|
||||
|
||||
Generated
+755
-58
File diff suppressed because it is too large
Load Diff
+9
-68
@@ -1,38 +1,19 @@
|
||||
[project]
|
||||
name = "fuzzing-infra"
|
||||
version = "0.1.0"
|
||||
description = "Automated vulnerability discovery through intelligent fuzzing"
|
||||
readme = "README.md"
|
||||
authors = [{ name = "Trail of Bits", email = "opensource@trailofbits.com" }]
|
||||
license = "AGPL-3.0"
|
||||
requires-python = ">=3.12,<3.13"
|
||||
keywords = ["fuzzing", "oss-fuzz", "libfuzzer", "vulnerability-discovery", "coverage", "cybersecurity"]
|
||||
classifiers = [
|
||||
"Development Status :: 4 - Beta",
|
||||
"Intended Audience :: Developers",
|
||||
"License :: OSI Approved :: GNU Affero General Public License v3",
|
||||
"Programming Language :: Python :: 3",
|
||||
"Programming Language :: Python :: 3.12",
|
||||
"Topic :: Security",
|
||||
"Topic :: Software Development :: Testing",
|
||||
"Topic :: Software Development :: Quality Assurance",
|
||||
"Operating System :: POSIX :: Linux",
|
||||
]
|
||||
description = ""
|
||||
authors = [{ name = "Trail of Bits", email = "opensource@trailofbits" }]
|
||||
requires-python = ">=3.10,<3.13"
|
||||
dependencies = [
|
||||
"protobuf (>=3.20, <=3.20.3)",
|
||||
"redis ~= 5.2.1",
|
||||
"clusterfuzz == 2.6.0",
|
||||
"redis (>=5.2.1,<6.0.0)",
|
||||
"clusterfuzz==2.6.0",
|
||||
"common",
|
||||
"pydantic-settings ~= 2.7.1",
|
||||
"beautifulsoup4 >= 4.13.3",
|
||||
"lxml >= 5.3.1",
|
||||
"pydantic-settings>=2.7.1",
|
||||
"beautifulsoup4>=4.13.3",
|
||||
"lxml>=5.3.1",
|
||||
]
|
||||
|
||||
[project.urls]
|
||||
Repository = "https://github.com/trailofbits/buttercup"
|
||||
Issues = "https://github.com/trailofbits/buttercup/issues"
|
||||
Documentation = "https://github.com/trailofbits/buttercup#readme"
|
||||
|
||||
[project.scripts]
|
||||
buttercup-fuzzer-builder = "buttercup.fuzzing_infra.builder_bot:main"
|
||||
buttercup-fuzzer = "buttercup.fuzzing_infra.fuzzer_bot:main"
|
||||
@@ -53,50 +34,10 @@ requires = ["hatchling"]
|
||||
build-backend = "hatchling.build"
|
||||
|
||||
[dependency-groups]
|
||||
dev = ["pytest ~= 8.3.4", "ruff ~= 0.12.8", "mypy ~= 1.15.0"]
|
||||
|
||||
[tool.coverage.run]
|
||||
source = ["src/buttercup"]
|
||||
omit = ["*/tests/*", "*/__cli__.py", "*/_cli.py", "*/builder_bot.py", "*/fuzzer_bot.py", "*/coverage_bot.py", "*/tracer_bot.py", "*/corpus_sync.py", "*/corpus_merger.py", "*/utils_cli.py"]
|
||||
|
||||
[tool.coverage.report]
|
||||
exclude_lines = [
|
||||
"pragma: no cover",
|
||||
"def __repr__",
|
||||
"if __name__ == .__main__.:",
|
||||
"raise NotImplementedError",
|
||||
"if TYPE_CHECKING:",
|
||||
]
|
||||
|
||||
[tool.pytest.ini_options]
|
||||
testpaths = ["tests"]
|
||||
python_files = ["test_*.py"]
|
||||
python_classes = ["Test*"]
|
||||
python_functions = ["test_*"]
|
||||
addopts = "-v --tb=short --strict-markers"
|
||||
markers = [
|
||||
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
|
||||
"integration: marks tests as integration tests",
|
||||
]
|
||||
dev = ["pytest>=8.3.4", "ruff>=0.9.2", "mypy>=1.15.0"]
|
||||
|
||||
[tool.ruff]
|
||||
line-length = 120
|
||||
target-version = "py312"
|
||||
|
||||
[tool.ruff.lint]
|
||||
select = ["E", "F", "I", "W", "UP"]
|
||||
ignore = ["COM812", "ISC001"] # Formatter conflicts
|
||||
|
||||
[tool.ruff.lint.per-file-ignores]
|
||||
"tests/**/*.py" = ["S101", "D"] # Allow asserts, no docstrings in tests
|
||||
"*/__cli__.py" = ["T201"] # Allow print in CLI modules
|
||||
"*/builder_bot.py" = ["T201"]
|
||||
"*/fuzzer_bot.py" = ["T201"]
|
||||
"*/coverage_bot.py" = ["T201"]
|
||||
"*/tracer_bot.py" = ["T201"]
|
||||
"*/corpus_sync.py" = ["T201"]
|
||||
"*/corpus_merger.py" = ["T201"]
|
||||
"*/utils_cli.py" = ["T201"]
|
||||
|
||||
[tool.mypy]
|
||||
plugins = ["pydantic.mypy"]
|
||||
|
||||
@@ -1,21 +1,22 @@
|
||||
from buttercup.common.queues import QueueNames, GroupNames
|
||||
from redis import Redis
|
||||
from buttercup.common.queues import QueueFactory
|
||||
from buttercup.common.datastructures.msg_pb2 import BuildType, BuildOutput, BuildRequest
|
||||
from buttercup.common.logger import setup_package_logger
|
||||
from dataclasses import dataclass, field
|
||||
from buttercup.common.queues import ReliableQueue
|
||||
import logging
|
||||
import tempfile
|
||||
from dataclasses import dataclass, field
|
||||
from buttercup.common.utils import serve_loop
|
||||
from buttercup.common.challenge_task import ChallengeTask, ChallengeTaskError
|
||||
from pathlib import Path
|
||||
|
||||
from buttercup.fuzzing_infra.settings import BuilderBotSettings
|
||||
import buttercup.common.node_local as node_local
|
||||
from buttercup.common.telemetry import init_telemetry
|
||||
from opentelemetry import trace
|
||||
from opentelemetry.trace import Status, StatusCode
|
||||
from redis import Redis
|
||||
|
||||
import buttercup.common.node_local as node_local
|
||||
from buttercup.common.challenge_task import ChallengeTask, ChallengeTaskError
|
||||
from buttercup.common.datastructures.msg_pb2 import BuildOutput, BuildRequest, BuildType
|
||||
from buttercup.common.logger import setup_package_logger
|
||||
from buttercup.common.queues import GroupNames, QueueFactory, QueueNames, ReliableQueue
|
||||
from buttercup.common.telemetry import set_crs_attributes, CRSActionCategory
|
||||
from buttercup.common.task_registry import TaskRegistry
|
||||
from buttercup.common.telemetry import CRSActionCategory, init_telemetry, set_crs_attributes
|
||||
from buttercup.common.utils import serve_loop
|
||||
from buttercup.fuzzing_infra.settings import BuilderBotSettings
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -43,15 +44,13 @@ class BuilderBot:
|
||||
def _apply_challenge_diff(self, task: ChallengeTask, msg: BuildRequest) -> bool:
|
||||
if msg.apply_diff and task.is_delta_mode():
|
||||
logger.info(
|
||||
f"Applying diff for {msg.task_id} | {msg.engine} | {msg.sanitizer} | "
|
||||
f"{BuildType.Name(msg.build_type)} | diff {msg.apply_diff}"
|
||||
f"Applying diff for {msg.task_id} | {msg.engine} | {msg.sanitizer} | {BuildType.Name(msg.build_type)} | diff {msg.apply_diff}"
|
||||
)
|
||||
try:
|
||||
res = task.apply_patch_diff()
|
||||
if not res:
|
||||
logger.warning(
|
||||
f"No diffs for {msg.task_id} | {msg.engine} | {msg.sanitizer} | "
|
||||
f"{BuildType.Name(msg.build_type)} | diff {msg.apply_diff}"
|
||||
f"No diffs for {msg.task_id} | {msg.engine} | {msg.sanitizer} | {BuildType.Name(msg.build_type)} | diff {msg.apply_diff}"
|
||||
)
|
||||
return False
|
||||
except ChallengeTaskError:
|
||||
@@ -75,15 +74,13 @@ class BuilderBot:
|
||||
logger.debug("Patch written to %s", patch_file.name)
|
||||
|
||||
logger.info(
|
||||
f"Applying patch for {msg.task_id} | {msg.engine} | {msg.sanitizer} | "
|
||||
f"{BuildType.Name(msg.build_type)} | diff {msg.apply_diff}"
|
||||
f"Applying patch for {msg.task_id} | {msg.engine} | {msg.sanitizer} | {BuildType.Name(msg.build_type)} | diff {msg.apply_diff}"
|
||||
)
|
||||
try:
|
||||
res = task.apply_patch_diff(Path(patch_file.name))
|
||||
if not res:
|
||||
logger.info(
|
||||
f"Failed to apply patch for {msg.task_id} | {msg.engine} | {msg.sanitizer} | "
|
||||
f"{BuildType.Name(msg.build_type)} | diff {msg.apply_diff}"
|
||||
f"Failed to apply patch for {msg.task_id} | {msg.engine} | {msg.sanitizer} | {BuildType.Name(msg.build_type)} | diff {msg.apply_diff}"
|
||||
)
|
||||
return False
|
||||
except ChallengeTaskError:
|
||||
@@ -106,8 +103,7 @@ class BuilderBot:
|
||||
|
||||
msg = rqit.deserialized
|
||||
logger.info(
|
||||
f"Received build request for {msg.task_id} | {msg.engine} | {msg.sanitizer} | "
|
||||
f"{BuildType.Name(msg.build_type)} | diff {msg.apply_diff}"
|
||||
f"Received build request for {msg.task_id} | {msg.engine} | {msg.sanitizer} | {BuildType.Name(msg.build_type)} | diff {msg.apply_diff}"
|
||||
)
|
||||
|
||||
# Check if task should not be processed (expired or cancelled)
|
||||
@@ -133,8 +129,7 @@ class BuilderBot:
|
||||
if not self._apply_challenge_diff(task, msg):
|
||||
if self._build_requests_queue.times_delivered(rqit.item_id) > self.max_tries:
|
||||
logger.error(
|
||||
f"Max tries reached for {msg.task_id} | {msg.engine} | {msg.sanitizer} | "
|
||||
f"{BuildType.Name(msg.build_type)} | diff {msg.apply_diff}"
|
||||
f"Max tries reached for {msg.task_id} | {msg.engine} | {msg.sanitizer} | {BuildType.Name(msg.build_type)} | diff {msg.apply_diff}"
|
||||
)
|
||||
self._build_requests_queue.ack_item(rqit.item_id)
|
||||
|
||||
@@ -143,9 +138,7 @@ class BuilderBot:
|
||||
if not self._apply_patch(task, msg):
|
||||
if self._build_requests_queue.times_delivered(rqit.item_id) > self.max_tries:
|
||||
logger.error(
|
||||
f"Max tries reached for {msg.task_id} | {msg.engine} | {msg.sanitizer} | "
|
||||
f"{BuildType.Name(msg.build_type)} | diff {msg.apply_diff} | "
|
||||
f"patch {msg.internal_patch_id}"
|
||||
f"Max tries reached for {msg.task_id} | {msg.engine} | {msg.sanitizer} | {BuildType.Name(msg.build_type)} | diff {msg.apply_diff} | patch {msg.internal_patch_id}"
|
||||
)
|
||||
self._build_requests_queue.ack_item(rqit.item_id)
|
||||
|
||||
@@ -166,8 +159,7 @@ class BuilderBot:
|
||||
|
||||
if not res.success:
|
||||
logger.error(
|
||||
f"Could not build fuzzer {msg.task_id} | {msg.engine} | {msg.sanitizer} | "
|
||||
f"{BuildType.Name(msg.build_type)} | diff {msg.apply_diff}"
|
||||
f"Could not build fuzzer {msg.task_id} | {msg.engine} | {msg.sanitizer} | {BuildType.Name(msg.build_type)} | diff {msg.apply_diff}"
|
||||
)
|
||||
span.set_status(Status(StatusCode.ERROR))
|
||||
return True
|
||||
@@ -176,8 +168,7 @@ class BuilderBot:
|
||||
|
||||
task.commit()
|
||||
logger.info(
|
||||
f"Pushing build output for {msg.task_id} | {msg.engine} | {msg.sanitizer} | "
|
||||
f"{BuildType.Name(msg.build_type)} | diff {msg.apply_diff}"
|
||||
f"Pushing build output for {msg.task_id} | {msg.engine} | {msg.sanitizer} | {BuildType.Name(msg.build_type)} | diff {msg.apply_diff}"
|
||||
)
|
||||
node_local.dir_to_remote_archive(task.task_dir)
|
||||
self._build_outputs_queue.push(
|
||||
@@ -192,8 +183,7 @@ class BuilderBot:
|
||||
)
|
||||
)
|
||||
logger.info(
|
||||
f"Acked build request for {msg.task_id} | {msg.engine} | {msg.sanitizer} | "
|
||||
f"{BuildType.Name(msg.build_type)} | diff {msg.apply_diff}"
|
||||
f"Acked build request for {msg.task_id} | {msg.engine} | {msg.sanitizer} | {BuildType.Name(msg.build_type)} | diff {msg.apply_diff}"
|
||||
)
|
||||
self._build_requests_queue.ack_item(rqit.item_id)
|
||||
return True
|
||||
|
||||
@@ -1,35 +1,37 @@
|
||||
import datetime
|
||||
import logging
|
||||
import os
|
||||
import random
|
||||
import shutil
|
||||
from buttercup.common import node_local
|
||||
from buttercup.fuzzing_infra.runner import Runner, Conf, FuzzConfiguration
|
||||
from dataclasses import dataclass
|
||||
import os
|
||||
from buttercup.common.datastructures.msg_pb2 import BuildType, WeightedHarness
|
||||
from buttercup.common.datastructures.aliases import BuildType as BuildTypeHint
|
||||
from buttercup.common.corpus import Corpus
|
||||
from buttercup.common.maps import HarnessWeights, BuildMap
|
||||
from buttercup.common.utils import serve_loop, setup_periodic_zombie_reaper
|
||||
from buttercup.common.logger import setup_package_logger
|
||||
from redis import Redis
|
||||
from typing import List
|
||||
from os import PathLike
|
||||
|
||||
import random
|
||||
from buttercup.common.datastructures.msg_pb2 import BuildOutput
|
||||
import logging
|
||||
from buttercup.common.challenge_task import ChallengeTask
|
||||
from buttercup.fuzzing_infra.settings import FuzzerBotSettings
|
||||
from buttercup.common.sets import MergedCorpusSetLock
|
||||
from buttercup.common.constants import ADDRESS_SANITIZER
|
||||
from buttercup.common.sets import FailedToAcquireLock
|
||||
from buttercup.common.sets import MERGING_LOCK_TIMEOUT_SECONDS
|
||||
from buttercup.common.telemetry import init_telemetry
|
||||
from opentelemetry import trace
|
||||
from opentelemetry.trace import Status, StatusCode
|
||||
from redis import Redis
|
||||
|
||||
from buttercup.common import node_local
|
||||
from buttercup.common.challenge_task import ChallengeTask
|
||||
from buttercup.common.constants import ADDRESS_SANITIZER
|
||||
from buttercup.common.corpus import Corpus
|
||||
from buttercup.common.datastructures.aliases import BuildType as BuildTypeHint
|
||||
from buttercup.common.datastructures.msg_pb2 import BuildOutput, BuildType, WeightedHarness
|
||||
from buttercup.common.logger import setup_package_logger
|
||||
from buttercup.common.maps import BuildMap, HarnessWeights
|
||||
from buttercup.common.sets import MERGING_LOCK_TIMEOUT_SECONDS, FailedToAcquireLock, MergedCorpusSetLock
|
||||
from buttercup.common.telemetry import CRSActionCategory, init_telemetry, set_crs_attributes
|
||||
from buttercup.common.utils import serve_loop, setup_periodic_zombie_reaper
|
||||
from buttercup.fuzzing_infra.runner import Conf, FuzzConfiguration, Runner
|
||||
from buttercup.fuzzing_infra.settings import FuzzerBotSettings
|
||||
from buttercup.common.telemetry import set_crs_attributes, CRSActionCategory
|
||||
import datetime
|
||||
import shutil
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
# NOTE: The idea of using three distinct classes to represent the local, remote, and merged corpuses
|
||||
# is to make the code more readable and easier to understand.
|
||||
# The BaseCorpus class is used to represent the initial corpus state,
|
||||
# before any merge operations have been performed.
|
||||
# The BaseCorpus class is used to represent the initial corpus state, before any merge operations have been performed.
|
||||
# The PartitionedCorpus class is used to partition the corpus into local and remote parts.
|
||||
# The FinalCorpus class is used to represent the corpus after the merge operation has been performed.
|
||||
|
||||
@@ -200,7 +202,7 @@ class MergerBot:
|
||||
self.builds = BuildMap(redis)
|
||||
self.max_local_files = max_local_files
|
||||
|
||||
def required_builds(self) -> list[BuildTypeHint]:
|
||||
def required_builds(self) -> List[BuildTypeHint]:
|
||||
return [BuildType.FUZZER]
|
||||
|
||||
def _run_merge_operation(
|
||||
@@ -261,8 +263,7 @@ class MergerBot:
|
||||
},
|
||||
)
|
||||
|
||||
# We specify the remote_dir as the target dir as that will cause any `local_dir`
|
||||
# files that adds coverage to be moved to remote_dir.
|
||||
# We specify the remote_dir as the target dir as that will cause any `local_dir` files that adds coverage to be moved to remote_dir.
|
||||
self.runner.merge_corpus(fuzz_conf, os.fspath(remote_dir))
|
||||
span.set_status(Status(StatusCode.OK))
|
||||
|
||||
@@ -272,8 +273,7 @@ class MergerBot:
|
||||
Given a task/WeightedHarness, we want to merge the local corpus into the remote corpus if it adds coverage
|
||||
- acquire a lock on the merged corpus set, if not possible, return and move on to next task
|
||||
- ensure all of the remotely stored corpus files are available locally
|
||||
- partition the the local corpus into R and L, where R is the remote corpus and L is
|
||||
the local corpus excluding remote files (L = local_files - remote_files)
|
||||
- partition the the local corpus into R and L, where R is the remote corpus and L is the local corpus excluding remote files (L = local_files - remote_files)
|
||||
- if L is empty the node is up to date, release the lock and move on to next task.
|
||||
- copy the local corpus into R and L directories respectively
|
||||
- run merger on R and L, moving files from L to R if they add coverage
|
||||
@@ -309,14 +309,12 @@ class MergerBot:
|
||||
# If L is empty, the node is up to date
|
||||
if not partitioned_corpus.local_only_files:
|
||||
logger.debug(
|
||||
f"Skipping merge for {task.harness_name} | {task.package_name} | "
|
||||
f"{task.task_id} because local corpus is up to date"
|
||||
f"Skipping merge for {task.harness_name} | {task.package_name} | {task.task_id} because local corpus is up to date"
|
||||
)
|
||||
return False # We did not do any work
|
||||
|
||||
logger.info(
|
||||
f"Found {len(partitioned_corpus.local_only_files)} files only in local corpus "
|
||||
f"for {task.harness_name}. Will run merge operation."
|
||||
f"Found {len(partitioned_corpus.local_only_files)} files only in local corpus for {task.harness_name}. Will run merge operation."
|
||||
)
|
||||
|
||||
try:
|
||||
@@ -353,8 +351,7 @@ class MergerBot:
|
||||
|
||||
except FailedToAcquireLock:
|
||||
logger.debug(
|
||||
f"Skipping merge for {task.harness_name} | {task.package_name} | {task.task_id} "
|
||||
f"because another worker is already merging"
|
||||
f"Skipping merge for {task.harness_name} | {task.package_name} | {task.task_id} because another worker is already merging"
|
||||
)
|
||||
except Exception as e:
|
||||
logger.error(f"Error merging corpus: {e}")
|
||||
|
||||
@@ -1,27 +1,27 @@
|
||||
from functools import lru_cache
|
||||
import logging
|
||||
import os
|
||||
import random
|
||||
import shutil
|
||||
from collections.abc import Generator
|
||||
from contextlib import contextmanager
|
||||
from functools import lru_cache
|
||||
|
||||
from opentelemetry import trace
|
||||
from opentelemetry.trace import Status, StatusCode
|
||||
from redis import Redis
|
||||
|
||||
import buttercup.common.node_local as node_local
|
||||
from buttercup.common.challenge_task import ChallengeTask
|
||||
from buttercup.common.corpus import Corpus
|
||||
from buttercup.common.datastructures.aliases import BuildType as BuildTypeHint
|
||||
from buttercup.common.datastructures.msg_pb2 import BuildOutput, BuildType, FunctionCoverage, WeightedHarness
|
||||
from buttercup.common.default_task_loop import TaskLoop
|
||||
from buttercup.common.logger import setup_package_logger
|
||||
from buttercup.common.default_task_loop import TaskLoop
|
||||
from buttercup.common.datastructures.msg_pb2 import BuildType, WeightedHarness, FunctionCoverage
|
||||
from buttercup.common.datastructures.aliases import BuildType as BuildTypeHint
|
||||
from buttercup.common.maps import CoverageMap
|
||||
from buttercup.common.telemetry import CRSActionCategory, init_telemetry, set_crs_attributes
|
||||
from buttercup.common.utils import setup_periodic_zombie_reaper
|
||||
from typing import List, Generator
|
||||
from redis import Redis
|
||||
from buttercup.common.datastructures.msg_pb2 import BuildOutput
|
||||
from buttercup.common.corpus import Corpus
|
||||
from buttercup.fuzzing_infra.coverage_runner import CoverageRunner, CoveredFunction
|
||||
from buttercup.fuzzing_infra.settings import CoverageBotSettings
|
||||
from buttercup.common.challenge_task import ChallengeTask
|
||||
from buttercup.common.utils import setup_periodic_zombie_reaper
|
||||
import shutil
|
||||
import buttercup.common.node_local as node_local
|
||||
from contextlib import contextmanager
|
||||
from buttercup.common.telemetry import init_telemetry
|
||||
from opentelemetry import trace
|
||||
from opentelemetry.trace import Status, StatusCode
|
||||
from buttercup.common.telemetry import set_crs_attributes, CRSActionCategory
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -53,7 +53,7 @@ class CoverageBot(TaskLoop):
|
||||
logger.info(f"Coverage bot initialized with sample_size: {sample_size}")
|
||||
super().__init__(redis, timer_seconds)
|
||||
|
||||
def required_builds(self) -> list[BuildTypeHint]:
|
||||
def required_builds(self) -> List[BuildTypeHint]:
|
||||
return [BuildType.COVERAGE]
|
||||
|
||||
@contextmanager
|
||||
@@ -154,8 +154,7 @@ class CoverageBot(TaskLoop):
|
||||
|
||||
if func_coverage is None:
|
||||
logger.error(
|
||||
f"No function coverage found for {task.harness_name} | {corpus.path} | "
|
||||
f"{local_tsk.project_name}"
|
||||
f"No function coverage found for {task.harness_name} | {corpus.path} | {local_tsk.project_name}"
|
||||
)
|
||||
span.set_status(Status(StatusCode.ERROR))
|
||||
return
|
||||
@@ -163,8 +162,7 @@ class CoverageBot(TaskLoop):
|
||||
|
||||
get_processed_coverage(corpus.path).update(remaining_files)
|
||||
logger.info(
|
||||
f"Coverage for {task.harness_name} | {corpus.path} | {local_tsk.project_name} | "
|
||||
f"processed {len(func_coverage)} functions"
|
||||
f"Coverage for {task.harness_name} | {corpus.path} | {local_tsk.project_name} | processed {len(func_coverage)} functions"
|
||||
)
|
||||
self._submit_function_coverage(func_coverage, task.harness_name, task.package_name, task.task_id)
|
||||
|
||||
|
||||
@@ -1,14 +1,12 @@
|
||||
from buttercup.common.challenge_task import ChallengeTask
|
||||
import argparse
|
||||
import subprocess
|
||||
import json
|
||||
import logging
|
||||
import subprocess
|
||||
from dataclasses import dataclass
|
||||
from typing import Any, cast
|
||||
|
||||
from buttercup.common.project_yaml import ProjectYaml, Language
|
||||
from bs4 import BeautifulSoup, Tag
|
||||
|
||||
from buttercup.common.challenge_task import ChallengeTask
|
||||
from buttercup.common.project_yaml import Language, ProjectYaml
|
||||
from typing import Any, cast
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -107,13 +105,12 @@ class CoverageRunner:
|
||||
jacoco_path = build_dir / "dumps" / f"{harness_name}.xml"
|
||||
if not jacoco_path.exists():
|
||||
logger.error(
|
||||
f"Failed to find jacoco file for {harness_name} | {corpus_dir} | "
|
||||
f"{self.tool.project_name} | in {jacoco_path}"
|
||||
f"Failed to find jacoco file for {harness_name} | {corpus_dir} | {self.tool.project_name} | in {jacoco_path}"
|
||||
)
|
||||
return None
|
||||
|
||||
# parse the jacoco file
|
||||
with open(jacoco_path) as f:
|
||||
with open(jacoco_path, "r") as f:
|
||||
soup = BeautifulSoup(f, "xml")
|
||||
covered_functions = []
|
||||
for target_class in soup.find_all("class"):
|
||||
@@ -158,8 +155,7 @@ class CoverageRunner:
|
||||
profdata_path = package_path / "dumps" / "merged.profdata"
|
||||
if not profdata_path.exists():
|
||||
logger.error(
|
||||
f"Failed to find profdata for {harness_name} | {corpus_dir} | "
|
||||
f"{self.tool.project_name} | in {profdata_path}"
|
||||
f"Failed to find profdata for {harness_name} | {corpus_dir} | {self.tool.project_name} | in {profdata_path}"
|
||||
)
|
||||
return None
|
||||
|
||||
|
||||
@@ -1,26 +1,26 @@
|
||||
import logging
|
||||
import random
|
||||
from pathlib import Path
|
||||
|
||||
from buttercup.fuzzing_infra.runner import Runner, Conf, FuzzConfiguration
|
||||
from buttercup.common.datastructures.msg_pb2 import BuildType, WeightedHarness, Crash
|
||||
from buttercup.common.datastructures.aliases import BuildType as BuildTypeHint
|
||||
from buttercup.common.queues import QueueFactory, QueueNames
|
||||
from buttercup.common.corpus import Corpus, CrashDir
|
||||
from buttercup.common import stack_parsing
|
||||
from buttercup.common.stack_parsing import CrashSet
|
||||
from buttercup.common.logger import setup_package_logger
|
||||
from buttercup.common.utils import setup_periodic_zombie_reaper
|
||||
from redis import Redis
|
||||
from clusterfuzz.fuzz import engine
|
||||
from buttercup.common.default_task_loop import TaskLoop
|
||||
from typing import List
|
||||
import random
|
||||
from buttercup.common.datastructures.msg_pb2 import BuildOutput
|
||||
import logging
|
||||
from buttercup.common.challenge_task import ChallengeTask
|
||||
from buttercup.fuzzing_infra.settings import FuzzerBotSettings
|
||||
from buttercup.common.telemetry import init_telemetry, CRSActionCategory, set_crs_attributes
|
||||
from opentelemetry import trace
|
||||
from opentelemetry.trace.status import Status, StatusCode
|
||||
from redis import Redis
|
||||
|
||||
from buttercup.common import stack_parsing
|
||||
from buttercup.common.challenge_task import ChallengeTask
|
||||
from buttercup.common.corpus import Corpus, CrashDir
|
||||
from buttercup.common.datastructures.aliases import BuildType as BuildTypeHint
|
||||
from buttercup.common.datastructures.msg_pb2 import BuildOutput, BuildType, Crash, WeightedHarness
|
||||
from buttercup.common.default_task_loop import TaskLoop
|
||||
from buttercup.common.logger import setup_package_logger
|
||||
from buttercup.common.node_local import scratch_dir
|
||||
from buttercup.common.queues import QueueFactory, QueueNames
|
||||
from buttercup.common.stack_parsing import CrashSet
|
||||
from buttercup.common.telemetry import CRSActionCategory, init_telemetry, set_crs_attributes
|
||||
from buttercup.common.utils import setup_periodic_zombie_reaper
|
||||
from buttercup.fuzzing_infra.runner import Conf, FuzzConfiguration, Runner
|
||||
from buttercup.fuzzing_infra.settings import FuzzerBotSettings
|
||||
from pathlib import Path
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -44,7 +44,7 @@ class FuzzerBot(TaskLoop):
|
||||
self.max_pov_size = max_pov_size
|
||||
super().__init__(redis, timer_seconds)
|
||||
|
||||
def required_builds(self) -> list[BuildTypeHint]:
|
||||
def required_builds(self) -> List[BuildTypeHint]:
|
||||
return [BuildType.FUZZER]
|
||||
|
||||
def run_task(self, task: WeightedHarness, builds: dict[BuildTypeHint, BuildOutput]) -> None:
|
||||
|
||||
@@ -1,20 +1,19 @@
|
||||
import argparse
|
||||
import os
|
||||
import time
|
||||
|
||||
from redis import Redis
|
||||
|
||||
from buttercup.common.clusterfuzz_utils import get_fuzz_targets
|
||||
from buttercup.common.datastructures.msg_pb2 import BuildOutput, BuildType, WeightedHarness
|
||||
from buttercup.common.logger import setup_package_logger
|
||||
from buttercup.common.maps import BuildMap, HarnessWeights
|
||||
from buttercup.common.queues import (
|
||||
GroupNames,
|
||||
QueueFactory,
|
||||
QueueNames,
|
||||
ReliableQueue,
|
||||
RQItem,
|
||||
QueueFactory,
|
||||
QueueNames,
|
||||
GroupNames,
|
||||
)
|
||||
from buttercup.common.maps import HarnessWeights, BuildMap
|
||||
|
||||
import argparse
|
||||
from redis import Redis
|
||||
from buttercup.common.datastructures.msg_pb2 import BuildType, BuildOutput, WeightedHarness
|
||||
import time
|
||||
from buttercup.common.clusterfuzz_utils import get_fuzz_targets
|
||||
import os
|
||||
from buttercup.common.logger import setup_package_logger
|
||||
|
||||
logger = setup_package_logger("fuzzer-orchestrator", __name__)
|
||||
DEFAULT_WEIGHT = 1.0
|
||||
|
||||
@@ -1,17 +1,15 @@
|
||||
import argparse
|
||||
import logging
|
||||
import os
|
||||
import typing
|
||||
import uuid
|
||||
from dataclasses import dataclass
|
||||
|
||||
from clusterfuzz.fuzz import get_engine
|
||||
from clusterfuzz.fuzz.engine import Engine, FuzzOptions, FuzzResult
|
||||
|
||||
from clusterfuzz.fuzz.engine import Engine, FuzzResult, FuzzOptions
|
||||
from buttercup.common.queues import FuzzConfiguration
|
||||
from buttercup.common.logger import setup_package_logger
|
||||
from buttercup.common.node_local import scratch_dir
|
||||
from buttercup.common.queues import FuzzConfiguration
|
||||
from buttercup.fuzzing_infra.temp_dir import patched_temp_dir, scratch_cwd
|
||||
import typing
|
||||
import os
|
||||
from dataclasses import dataclass
|
||||
import argparse
|
||||
import uuid
|
||||
import logging
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
from typing import Annotated
|
||||
|
||||
from pydantic import Field
|
||||
from pydantic_settings import BaseSettings
|
||||
from pydantic import Field
|
||||
from typing import Annotated
|
||||
|
||||
|
||||
class Config:
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
import argparse
|
||||
|
||||
from redis import Redis
|
||||
|
||||
from buttercup.common.datastructures.msg_pb2 import BuildRequest, BuildType
|
||||
from buttercup.common.queues import QueueFactory, QueueNames
|
||||
from buttercup.common.datastructures.msg_pb2 import BuildRequest, BuildType
|
||||
|
||||
|
||||
def main() -> None:
|
||||
|
||||
@@ -1,14 +1,12 @@
|
||||
import contextvars
|
||||
import logging
|
||||
import os
|
||||
import tempfile
|
||||
from collections.abc import Iterator
|
||||
import contextvars
|
||||
import logging
|
||||
from contextlib import contextmanager
|
||||
from typing import Iterator
|
||||
from unittest.mock import patch
|
||||
|
||||
from clusterfuzz._internal.system import environment, shell
|
||||
|
||||
from buttercup.common.node_local import TmpDir, scratch_dir
|
||||
from buttercup.common.node_local import scratch_dir, TmpDir
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -1,19 +1,17 @@
|
||||
import logging
|
||||
import os
|
||||
from pathlib import Path
|
||||
|
||||
from redis import Redis
|
||||
|
||||
import buttercup.common.node_local as node_local
|
||||
from buttercup.common import stack_parsing
|
||||
from buttercup.common.datastructures.msg_pb2 import TracedCrash
|
||||
from buttercup.common.logger import setup_package_logger
|
||||
from buttercup.common.queues import GroupNames, QueueFactory, QueueNames
|
||||
from buttercup.common.task_registry import TaskRegistry
|
||||
from buttercup.common.telemetry import init_telemetry
|
||||
from buttercup.common.utils import serve_loop, setup_periodic_zombie_reaper
|
||||
from buttercup.fuzzing_infra.settings import TracerSettings
|
||||
from buttercup.fuzzing_infra.tracer_runner import TracerRunner
|
||||
from buttercup.common.logger import setup_package_logger
|
||||
import os
|
||||
import logging
|
||||
from redis import Redis
|
||||
from buttercup.common.queues import QueueFactory, QueueNames, GroupNames
|
||||
from buttercup.common.datastructures.msg_pb2 import TracedCrash
|
||||
from buttercup.common.task_registry import TaskRegistry
|
||||
from pathlib import Path
|
||||
from buttercup.common import stack_parsing
|
||||
from buttercup.common.utils import serve_loop, setup_periodic_zombie_reaper
|
||||
import buttercup.common.node_local as node_local
|
||||
from buttercup.common.telemetry import init_telemetry
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -1,15 +1,13 @@
|
||||
import logging
|
||||
from dataclasses import dataclass
|
||||
from pathlib import Path
|
||||
|
||||
from opentelemetry import trace
|
||||
from opentelemetry.trace import Status, StatusCode
|
||||
from redis import Redis
|
||||
|
||||
from buttercup.common.maps import BuildMap
|
||||
from buttercup.common.challenge_task import ChallengeTask, ReproduceResult
|
||||
from buttercup.common.datastructures.msg_pb2 import BuildType
|
||||
from buttercup.common.maps import BuildMap
|
||||
from buttercup.common.telemetry import CRSActionCategory, set_crs_attributes
|
||||
from pathlib import Path
|
||||
from dataclasses import dataclass
|
||||
import logging
|
||||
from redis import Redis
|
||||
from opentelemetry import trace
|
||||
from opentelemetry.trace import Status, StatusCode
|
||||
from buttercup.common.telemetry import set_crs_attributes, CRSActionCategory
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
import argparse
|
||||
import sys
|
||||
from pathlib import Path
|
||||
from typing import Optional
|
||||
|
||||
from buttercup.common.stack_parsing import get_crash_data
|
||||
|
||||
@@ -31,7 +32,7 @@ def parse_args() -> argparse.Namespace:
|
||||
return parser.parse_args()
|
||||
|
||||
|
||||
def read_stacktrace(file_path: Path | None = None) -> str:
|
||||
def read_stacktrace(file_path: Optional[Path] = None) -> str:
|
||||
"""Read stacktrace from file or stdin."""
|
||||
if file_path:
|
||||
return file_path.read_text()
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
import unittest
|
||||
from pathlib import Path
|
||||
from unittest.mock import MagicMock, Mock, patch
|
||||
|
||||
from unittest.mock import Mock, patch, MagicMock
|
||||
from redis import Redis
|
||||
from pathlib import Path
|
||||
|
||||
from buttercup.common.datastructures.msg_pb2 import BuildOutput, BuildRequest, BuildType
|
||||
from buttercup.common.task_registry import TaskRegistry
|
||||
from buttercup.fuzzing_infra.builder_bot import BuilderBot
|
||||
from buttercup.common.datastructures.msg_pb2 import BuildRequest, BuildOutput, BuildType
|
||||
from buttercup.common.task_registry import TaskRegistry
|
||||
|
||||
|
||||
class TestBuilderBot(unittest.TestCase):
|
||||
|
||||
@@ -1,14 +1,12 @@
|
||||
import pytest
|
||||
import os
|
||||
import tempfile
|
||||
from unittest.mock import MagicMock, patch
|
||||
|
||||
import pytest
|
||||
from unittest.mock import patch, MagicMock
|
||||
from redis import Redis
|
||||
|
||||
from buttercup.common.datastructures.msg_pb2 import FunctionCoverage
|
||||
from buttercup.common.maps import CoverageMap
|
||||
from buttercup.fuzzing_infra.coverage_bot import CoverageBot
|
||||
from buttercup.fuzzing_infra.coverage_runner import CoveredFunction
|
||||
from buttercup.common.maps import CoverageMap
|
||||
from buttercup.common.datastructures.msg_pb2 import FunctionCoverage
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
import unittest
|
||||
from pathlib import Path
|
||||
from unittest.mock import MagicMock, Mock, patch
|
||||
|
||||
from unittest.mock import Mock, patch, MagicMock
|
||||
from redis import Redis
|
||||
from pathlib import Path
|
||||
|
||||
from buttercup.common.constants import ADDRESS_SANITIZER
|
||||
from buttercup.common.datastructures.msg_pb2 import BuildOutput, WeightedHarness
|
||||
from buttercup.fuzzing_infra.corpus_merger import MergerBot, BaseCorpus, PartitionedCorpus
|
||||
from buttercup.common.datastructures.msg_pb2 import WeightedHarness, BuildOutput
|
||||
from buttercup.common.sets import FailedToAcquireLock
|
||||
from buttercup.fuzzing_infra.corpus_merger import BaseCorpus, MergerBot, PartitionedCorpus
|
||||
from buttercup.common.constants import ADDRESS_SANITIZER
|
||||
|
||||
|
||||
class TestMergerBot(unittest.TestCase):
|
||||
@@ -487,8 +486,7 @@ class TestPartitionedCorpus(unittest.TestCase):
|
||||
def test_initialization_remote_file_missing(
|
||||
self, path_exists_mock, path_join_mock, shutil_copy_mock, scratch_dir_mock, corpus_mock
|
||||
):
|
||||
"""Test that when a file is missing from corpus.path but available in corpus.remote_path,
|
||||
it's copied from remote."""
|
||||
"""Test that when a file is missing from corpus.path but available in corpus.remote_path, it's copied from remote."""
|
||||
# Setup mocks
|
||||
corpus_instance = corpus_mock.return_value
|
||||
corpus_instance.path = "/corpus/path"
|
||||
@@ -517,8 +515,7 @@ class TestPartitionedCorpus(unittest.TestCase):
|
||||
# Mock shutil.copy to fail for the first call to a specific file, then succeed for the second call
|
||||
|
||||
def mock_copy(src, dst):
|
||||
# For a specific file in remote_files, fail on first attempt (corpus.path)
|
||||
# but succeed on second (corpus.remote_path)
|
||||
# For a specific file in remote_files, fail on first attempt (corpus.path) but succeed on second (corpus.remote_path)
|
||||
if "missing_remote" in src:
|
||||
if "/corpus/path/" in src:
|
||||
raise FileNotFoundError(f"File not found in local corpus: {src}")
|
||||
|
||||
@@ -3,9 +3,9 @@ import tempfile
|
||||
import threading
|
||||
import time
|
||||
import unittest
|
||||
from unittest.mock import MagicMock, patch
|
||||
from unittest.mock import patch, MagicMock
|
||||
|
||||
from buttercup.fuzzing_infra.temp_dir import _scratch_path_var, get_temp_dir, patched_temp_dir
|
||||
from buttercup.fuzzing_infra.temp_dir import get_temp_dir, patched_temp_dir, _scratch_path_var
|
||||
|
||||
|
||||
class TestGetTempDir(unittest.TestCase):
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
import time
|
||||
from unittest.mock import MagicMock, patch
|
||||
|
||||
import pytest
|
||||
from unittest.mock import patch, MagicMock
|
||||
from redis import Redis
|
||||
|
||||
from buttercup.common.datastructures.msg_pb2 import BuildOutput, Crash, Task
|
||||
from buttercup.common.task_registry import TaskRegistry
|
||||
from buttercup.fuzzing_infra.tracer_bot import TracerBot
|
||||
from buttercup.common.datastructures.msg_pb2 import Crash, Task, BuildOutput
|
||||
from buttercup.common.task_registry import TaskRegistry
|
||||
import time
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
|
||||
Generated
+782
-63
File diff suppressed because it is too large
Load Diff
+29
-82
@@ -1,45 +1,27 @@
|
||||
[project]
|
||||
name = "orchestrator"
|
||||
version = "0.5.0"
|
||||
description = "Central coordination and task management for Buttercup CRS"
|
||||
description = "Buttercup orchestrator"
|
||||
readme = "README.md"
|
||||
authors = [{ name = "Trail of Bits", email = "opensource@trailofbits.com" }]
|
||||
license = "AGPL-3.0"
|
||||
requires-python = ">=3.12,<3.13"
|
||||
keywords = ["orchestration", "task-management", "scheduler", "api", "fastapi", "cybersecurity"]
|
||||
classifiers = [
|
||||
"Development Status :: 4 - Beta",
|
||||
"Framework :: FastAPI",
|
||||
"Intended Audience :: Developers",
|
||||
"License :: OSI Approved :: GNU Affero General Public License v3",
|
||||
"Programming Language :: Python :: 3",
|
||||
"Programming Language :: Python :: 3.12",
|
||||
"Topic :: Security",
|
||||
"Topic :: System :: Distributed Computing",
|
||||
"Operating System :: POSIX :: Linux",
|
||||
]
|
||||
dependencies = [
|
||||
"argon2-cffi ~= 21.3.0",
|
||||
"argon2-cffi>=21.0.0",
|
||||
"common",
|
||||
"fastapi ~= 0.115.6",
|
||||
"pydantic ~= 2.10.5",
|
||||
"pydantic-settings ~= 2.7.1",
|
||||
"python-dateutil ~= 2.9.0",
|
||||
"pyyaml ~= 6.0.1",
|
||||
"requests ~= 2.32.3",
|
||||
"requests-file ~= 2.1.0",
|
||||
"rich >= 13.9.4",
|
||||
"sqlalchemy ~= 2.0.0",
|
||||
"typing-extensions >= 4.12.2",
|
||||
"urllib3 ~= 2.3.0",
|
||||
"uvicorn ~= 0.34.0",
|
||||
"fastapi>=0.115.6",
|
||||
"pydantic>=2.10.5",
|
||||
"pydantic-settings>=2.7.1",
|
||||
"python-dateutil>=2.9.0.post0",
|
||||
"pyyaml>=6.0.1",
|
||||
"requests>=2.32.3",
|
||||
"requests-file>=2.1.0",
|
||||
"rich>=13.9.4",
|
||||
"sqlalchemy>=2.0.0",
|
||||
"typing-extensions>=4.12.2",
|
||||
"urllib3>=2.3.0",
|
||||
"uvicorn>=0.34.0",
|
||||
]
|
||||
|
||||
[project.urls]
|
||||
Repository = "https://github.com/trailofbits/buttercup"
|
||||
Issues = "https://github.com/trailofbits/buttercup/issues"
|
||||
Documentation = "https://github.com/trailofbits/buttercup#readme"
|
||||
|
||||
[project.scripts]
|
||||
buttercup-task-server = "buttercup.orchestrator.task_server.__cli__:main"
|
||||
buttercup-task-downloader = "buttercup.orchestrator.downloader.__cli__:main"
|
||||
@@ -50,21 +32,21 @@ buttercup-scratch-cleaner = "buttercup.orchestrator.scratch_cleaner.__cli__:main
|
||||
buttercup-ui = "buttercup.orchestrator.ui.__cli__:main"
|
||||
|
||||
|
||||
[dependency-groups]
|
||||
dev = [
|
||||
"flake8 ~= 7.1.1",
|
||||
"mypy ~= 1.15.0",
|
||||
"pytest ~= 8.3.4",
|
||||
"pytest-asyncio ~= 0.25.2",
|
||||
"pytest-cov ~= 6.0.0",
|
||||
"pytest-xdist ~= 3.6.1",
|
||||
"ruff ~= 0.12.8",
|
||||
"types-python-dateutil ~= 2.9.0.20241206",
|
||||
"types-requests ~= 2.32.0",
|
||||
"types-redis ~= 4.6.0",
|
||||
"fastapi[standard] ~= 0.115.6",
|
||||
"responses ~= 0.25.6",
|
||||
"httpx ~= 0.28.1",
|
||||
[project.optional-dependencies]
|
||||
tests = [
|
||||
"flake8>=7.1.1",
|
||||
"mypy>=1.15.0",
|
||||
"pytest>=8.3.4",
|
||||
"pytest-asyncio>=0.25.2",
|
||||
"pytest-cov>=6.0.0",
|
||||
"pytest-xdist>=3.6.1",
|
||||
"ruff>=0.9.2",
|
||||
"types-python-dateutil>=2.9.0.20241206",
|
||||
"types-requests>=2.32.0",
|
||||
"types-redis>=4.6.0",
|
||||
"fastapi[standard]>=0.115.6",
|
||||
"responses>=0.25.6",
|
||||
"httpx>=0.28.1",
|
||||
]
|
||||
|
||||
[build-system]
|
||||
@@ -77,33 +59,8 @@ packages = ["src/buttercup"]
|
||||
[tool.uv.sources]
|
||||
common = { path = "../common", editable = true }
|
||||
|
||||
[tool.coverage.run]
|
||||
source = ["src/buttercup"]
|
||||
omit = ["*/tests/*", "*/__cli__.py", "*/_cli.py", "*/auth_tool.py"]
|
||||
|
||||
[tool.coverage.report]
|
||||
exclude_lines = [
|
||||
"pragma: no cover",
|
||||
"def __repr__",
|
||||
"if __name__ == .__main__.:",
|
||||
"raise NotImplementedError",
|
||||
"if TYPE_CHECKING:",
|
||||
]
|
||||
|
||||
[tool.pytest.ini_options]
|
||||
testpaths = ["tests"]
|
||||
python_files = ["test_*.py"]
|
||||
python_classes = ["Test*"]
|
||||
python_functions = ["test_*"]
|
||||
addopts = "-v --tb=short --strict-markers"
|
||||
markers = [
|
||||
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
|
||||
"integration: marks tests as integration tests",
|
||||
]
|
||||
|
||||
[tool.ruff]
|
||||
line-length = 120
|
||||
target-version = "py312"
|
||||
exclude = [
|
||||
"src/buttercup/orchestrator/competition_api_client",
|
||||
"test/test_types_*.py",
|
||||
@@ -113,16 +70,6 @@ exclude = [
|
||||
"src/buttercup/orchestrator/task_server/models/",
|
||||
]
|
||||
|
||||
[tool.ruff.lint]
|
||||
select = ["E", "F", "I", "W", "UP"]
|
||||
ignore = ["COM812", "ISC001"] # Formatter conflicts
|
||||
|
||||
[tool.ruff.lint.per-file-ignores]
|
||||
"tests/**/*.py" = ["S101", "D"] # Allow asserts, no docstrings in tests
|
||||
"test/test_submissions.py" = ["S101", "D", "UP045"] # UP045: Protobuf enums don't support | operator
|
||||
"*/__cli__.py" = ["T201"] # Allow print in CLI modules
|
||||
"*/auth_tool.py" = ["T201"]
|
||||
|
||||
[tool.mypy]
|
||||
plugins = ["pydantic.mypy"]
|
||||
mypy_path = "src"
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
import argparse
|
||||
import json
|
||||
import sys
|
||||
import time
|
||||
import urllib.request
|
||||
import sys
|
||||
from typing import Any
|
||||
|
||||
SECONDS = 1
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import logging
|
||||
|
||||
from buttercup.orchestrator.competition_api_client.api_client import ApiClient
|
||||
from buttercup.orchestrator.competition_api_client.configuration import Configuration
|
||||
from buttercup.orchestrator.competition_api_client.api_client import ApiClient
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -3,14 +3,14 @@
|
||||
# flake8: noqa
|
||||
|
||||
"""
|
||||
Example Competition API
|
||||
Example Competition API
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: 1.4.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
The version of the OpenAPI document: 1.4.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
@@ -60,9 +60,7 @@ __all__ = [
|
||||
]
|
||||
|
||||
# import apis into sdk package
|
||||
from buttercup.orchestrator.competition_api_client.api.broadcast_sarif_assessment_api import (
|
||||
BroadcastSarifAssessmentApi as BroadcastSarifAssessmentApi,
|
||||
)
|
||||
from buttercup.orchestrator.competition_api_client.api.broadcast_sarif_assessment_api import BroadcastSarifAssessmentApi as BroadcastSarifAssessmentApi
|
||||
from buttercup.orchestrator.competition_api_client.api.bundle_api import BundleApi as BundleApi
|
||||
from buttercup.orchestrator.competition_api_client.api.freeform_api import FreeformApi as FreeformApi
|
||||
from buttercup.orchestrator.competition_api_client.api.patch_api import PatchApi as PatchApi
|
||||
@@ -83,63 +81,25 @@ from buttercup.orchestrator.competition_api_client.exceptions import ApiAttribut
|
||||
from buttercup.orchestrator.competition_api_client.exceptions import ApiException as ApiException
|
||||
|
||||
# import models into sdk package
|
||||
from buttercup.orchestrator.competition_api_client.models.types_architecture import (
|
||||
TypesArchitecture as TypesArchitecture,
|
||||
)
|
||||
from buttercup.orchestrator.competition_api_client.models.types_architecture import TypesArchitecture as TypesArchitecture
|
||||
from buttercup.orchestrator.competition_api_client.models.types_assessment import TypesAssessment as TypesAssessment
|
||||
from buttercup.orchestrator.competition_api_client.models.types_bundle_submission import (
|
||||
TypesBundleSubmission as TypesBundleSubmission,
|
||||
)
|
||||
from buttercup.orchestrator.competition_api_client.models.types_bundle_submission_response import (
|
||||
TypesBundleSubmissionResponse as TypesBundleSubmissionResponse,
|
||||
)
|
||||
from buttercup.orchestrator.competition_api_client.models.types_bundle_submission_response_verbose import (
|
||||
TypesBundleSubmissionResponseVerbose as TypesBundleSubmissionResponseVerbose,
|
||||
)
|
||||
from buttercup.orchestrator.competition_api_client.models.types_bundle_submission import TypesBundleSubmission as TypesBundleSubmission
|
||||
from buttercup.orchestrator.competition_api_client.models.types_bundle_submission_response import TypesBundleSubmissionResponse as TypesBundleSubmissionResponse
|
||||
from buttercup.orchestrator.competition_api_client.models.types_bundle_submission_response_verbose import TypesBundleSubmissionResponseVerbose as TypesBundleSubmissionResponseVerbose
|
||||
from buttercup.orchestrator.competition_api_client.models.types_error import TypesError as TypesError
|
||||
from buttercup.orchestrator.competition_api_client.models.types_freeform_response import (
|
||||
TypesFreeformResponse as TypesFreeformResponse,
|
||||
)
|
||||
from buttercup.orchestrator.competition_api_client.models.types_freeform_submission import (
|
||||
TypesFreeformSubmission as TypesFreeformSubmission,
|
||||
)
|
||||
from buttercup.orchestrator.competition_api_client.models.types_fuzzing_engine import (
|
||||
TypesFuzzingEngine as TypesFuzzingEngine,
|
||||
)
|
||||
from buttercup.orchestrator.competition_api_client.models.types_freeform_response import TypesFreeformResponse as TypesFreeformResponse
|
||||
from buttercup.orchestrator.competition_api_client.models.types_freeform_submission import TypesFreeformSubmission as TypesFreeformSubmission
|
||||
from buttercup.orchestrator.competition_api_client.models.types_fuzzing_engine import TypesFuzzingEngine as TypesFuzzingEngine
|
||||
from buttercup.orchestrator.competition_api_client.models.types_message import TypesMessage as TypesMessage
|
||||
from buttercup.orchestrator.competition_api_client.models.types_pov_submission import (
|
||||
TypesPOVSubmission as TypesPOVSubmission,
|
||||
)
|
||||
from buttercup.orchestrator.competition_api_client.models.types_pov_submission_response import (
|
||||
TypesPOVSubmissionResponse as TypesPOVSubmissionResponse,
|
||||
)
|
||||
from buttercup.orchestrator.competition_api_client.models.types_patch_submission import (
|
||||
TypesPatchSubmission as TypesPatchSubmission,
|
||||
)
|
||||
from buttercup.orchestrator.competition_api_client.models.types_patch_submission_response import (
|
||||
TypesPatchSubmissionResponse as TypesPatchSubmissionResponse,
|
||||
)
|
||||
from buttercup.orchestrator.competition_api_client.models.types_ping_response import (
|
||||
TypesPingResponse as TypesPingResponse,
|
||||
)
|
||||
from buttercup.orchestrator.competition_api_client.models.types_request_list_response import (
|
||||
TypesRequestListResponse as TypesRequestListResponse,
|
||||
)
|
||||
from buttercup.orchestrator.competition_api_client.models.types_request_submission import (
|
||||
TypesRequestSubmission as TypesRequestSubmission,
|
||||
)
|
||||
from buttercup.orchestrator.competition_api_client.models.types_sarif_submission import (
|
||||
TypesSARIFSubmission as TypesSARIFSubmission,
|
||||
)
|
||||
from buttercup.orchestrator.competition_api_client.models.types_sarif_submission_response import (
|
||||
TypesSARIFSubmissionResponse as TypesSARIFSubmissionResponse,
|
||||
)
|
||||
from buttercup.orchestrator.competition_api_client.models.types_sarif_assessment_response import (
|
||||
TypesSarifAssessmentResponse as TypesSarifAssessmentResponse,
|
||||
)
|
||||
from buttercup.orchestrator.competition_api_client.models.types_sarif_assessment_submission import (
|
||||
TypesSarifAssessmentSubmission as TypesSarifAssessmentSubmission,
|
||||
)
|
||||
from buttercup.orchestrator.competition_api_client.models.types_submission_status import (
|
||||
TypesSubmissionStatus as TypesSubmissionStatus,
|
||||
)
|
||||
from buttercup.orchestrator.competition_api_client.models.types_pov_submission import TypesPOVSubmission as TypesPOVSubmission
|
||||
from buttercup.orchestrator.competition_api_client.models.types_pov_submission_response import TypesPOVSubmissionResponse as TypesPOVSubmissionResponse
|
||||
from buttercup.orchestrator.competition_api_client.models.types_patch_submission import TypesPatchSubmission as TypesPatchSubmission
|
||||
from buttercup.orchestrator.competition_api_client.models.types_patch_submission_response import TypesPatchSubmissionResponse as TypesPatchSubmissionResponse
|
||||
from buttercup.orchestrator.competition_api_client.models.types_ping_response import TypesPingResponse as TypesPingResponse
|
||||
from buttercup.orchestrator.competition_api_client.models.types_request_list_response import TypesRequestListResponse as TypesRequestListResponse
|
||||
from buttercup.orchestrator.competition_api_client.models.types_request_submission import TypesRequestSubmission as TypesRequestSubmission
|
||||
from buttercup.orchestrator.competition_api_client.models.types_sarif_submission import TypesSARIFSubmission as TypesSARIFSubmission
|
||||
from buttercup.orchestrator.competition_api_client.models.types_sarif_submission_response import TypesSARIFSubmissionResponse as TypesSARIFSubmissionResponse
|
||||
from buttercup.orchestrator.competition_api_client.models.types_sarif_assessment_response import TypesSarifAssessmentResponse as TypesSarifAssessmentResponse
|
||||
from buttercup.orchestrator.competition_api_client.models.types_sarif_assessment_submission import TypesSarifAssessmentSubmission as TypesSarifAssessmentSubmission
|
||||
from buttercup.orchestrator.competition_api_client.models.types_submission_status import TypesSubmissionStatus as TypesSubmissionStatus
|
||||
|
||||
@@ -9,3 +9,4 @@ from buttercup.orchestrator.competition_api_client.api.ping_api import PingApi
|
||||
from buttercup.orchestrator.competition_api_client.api.pov_api import PovApi
|
||||
from buttercup.orchestrator.competition_api_client.api.request_api import RequestApi
|
||||
from buttercup.orchestrator.competition_api_client.api.submitted_sarif_api import SubmittedSarifApi
|
||||
|
||||
|
||||
+87
-51
@@ -1,14 +1,14 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Example Competition API
|
||||
Example Competition API
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: 1.4.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
The version of the OpenAPI document: 1.4.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
import warnings
|
||||
@@ -18,12 +18,8 @@ from typing_extensions import Annotated
|
||||
|
||||
from pydantic import Field, StrictStr
|
||||
from typing_extensions import Annotated
|
||||
from buttercup.orchestrator.competition_api_client.models.types_sarif_assessment_response import (
|
||||
TypesSarifAssessmentResponse,
|
||||
)
|
||||
from buttercup.orchestrator.competition_api_client.models.types_sarif_assessment_submission import (
|
||||
TypesSarifAssessmentSubmission,
|
||||
)
|
||||
from buttercup.orchestrator.competition_api_client.models.types_sarif_assessment_response import TypesSarifAssessmentResponse
|
||||
from buttercup.orchestrator.competition_api_client.models.types_sarif_assessment_submission import TypesSarifAssessmentSubmission
|
||||
|
||||
from buttercup.orchestrator.competition_api_client.api_client import ApiClient, RequestSerialized
|
||||
from buttercup.orchestrator.competition_api_client.api_response import ApiResponse
|
||||
@@ -42,6 +38,7 @@ class BroadcastSarifAssessmentApi:
|
||||
api_client = ApiClient.get_default()
|
||||
self.api_client = api_client
|
||||
|
||||
|
||||
@validate_call
|
||||
def v1_task_task_id_broadcast_sarif_assessment_broadcast_sarif_id_post(
|
||||
self,
|
||||
@@ -51,7 +48,10 @@ class BroadcastSarifAssessmentApi:
|
||||
_request_timeout: Union[
|
||||
None,
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
|
||||
Tuple[
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Annotated[StrictFloat, Field(gt=0)]
|
||||
]
|
||||
] = None,
|
||||
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
||||
_content_type: Optional[StrictStr] = None,
|
||||
@@ -88,7 +88,7 @@ class BroadcastSarifAssessmentApi:
|
||||
in the spec for a single request.
|
||||
:type _host_index: int, optional
|
||||
:return: Returns the result object.
|
||||
""" # noqa: E501
|
||||
""" # noqa: E501
|
||||
|
||||
_param = self._v1_task_task_id_broadcast_sarif_assessment_broadcast_sarif_id_post_serialize(
|
||||
task_id=task_id,
|
||||
@@ -97,23 +97,27 @@ class BroadcastSarifAssessmentApi:
|
||||
_request_auth=_request_auth,
|
||||
_content_type=_content_type,
|
||||
_headers=_headers,
|
||||
_host_index=_host_index,
|
||||
_host_index=_host_index
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
"200": "TypesSarifAssessmentResponse",
|
||||
"400": "TypesError",
|
||||
"401": "TypesError",
|
||||
"404": "TypesError",
|
||||
"500": "TypesError",
|
||||
'200': "TypesSarifAssessmentResponse",
|
||||
'400': "TypesError",
|
||||
'401': "TypesError",
|
||||
'404': "TypesError",
|
||||
'500': "TypesError",
|
||||
}
|
||||
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
_request_timeout=_request_timeout
|
||||
)
|
||||
response_data.read()
|
||||
return self.api_client.response_deserialize(
|
||||
response_data=response_data,
|
||||
response_types_map=_response_types_map,
|
||||
).data
|
||||
|
||||
|
||||
@validate_call
|
||||
def v1_task_task_id_broadcast_sarif_assessment_broadcast_sarif_id_post_with_http_info(
|
||||
self,
|
||||
@@ -123,7 +127,10 @@ class BroadcastSarifAssessmentApi:
|
||||
_request_timeout: Union[
|
||||
None,
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
|
||||
Tuple[
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Annotated[StrictFloat, Field(gt=0)]
|
||||
]
|
||||
] = None,
|
||||
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
||||
_content_type: Optional[StrictStr] = None,
|
||||
@@ -160,7 +167,7 @@ class BroadcastSarifAssessmentApi:
|
||||
in the spec for a single request.
|
||||
:type _host_index: int, optional
|
||||
:return: Returns the result object.
|
||||
""" # noqa: E501
|
||||
""" # noqa: E501
|
||||
|
||||
_param = self._v1_task_task_id_broadcast_sarif_assessment_broadcast_sarif_id_post_serialize(
|
||||
task_id=task_id,
|
||||
@@ -169,23 +176,27 @@ class BroadcastSarifAssessmentApi:
|
||||
_request_auth=_request_auth,
|
||||
_content_type=_content_type,
|
||||
_headers=_headers,
|
||||
_host_index=_host_index,
|
||||
_host_index=_host_index
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
"200": "TypesSarifAssessmentResponse",
|
||||
"400": "TypesError",
|
||||
"401": "TypesError",
|
||||
"404": "TypesError",
|
||||
"500": "TypesError",
|
||||
'200': "TypesSarifAssessmentResponse",
|
||||
'400': "TypesError",
|
||||
'401': "TypesError",
|
||||
'404': "TypesError",
|
||||
'500': "TypesError",
|
||||
}
|
||||
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
_request_timeout=_request_timeout
|
||||
)
|
||||
response_data.read()
|
||||
return self.api_client.response_deserialize(
|
||||
response_data=response_data,
|
||||
response_types_map=_response_types_map,
|
||||
)
|
||||
|
||||
|
||||
@validate_call
|
||||
def v1_task_task_id_broadcast_sarif_assessment_broadcast_sarif_id_post_without_preload_content(
|
||||
self,
|
||||
@@ -195,7 +206,10 @@ class BroadcastSarifAssessmentApi:
|
||||
_request_timeout: Union[
|
||||
None,
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
|
||||
Tuple[
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Annotated[StrictFloat, Field(gt=0)]
|
||||
]
|
||||
] = None,
|
||||
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
||||
_content_type: Optional[StrictStr] = None,
|
||||
@@ -232,7 +246,7 @@ class BroadcastSarifAssessmentApi:
|
||||
in the spec for a single request.
|
||||
:type _host_index: int, optional
|
||||
:return: Returns the result object.
|
||||
""" # noqa: E501
|
||||
""" # noqa: E501
|
||||
|
||||
_param = self._v1_task_task_id_broadcast_sarif_assessment_broadcast_sarif_id_post_serialize(
|
||||
task_id=task_id,
|
||||
@@ -241,19 +255,23 @@ class BroadcastSarifAssessmentApi:
|
||||
_request_auth=_request_auth,
|
||||
_content_type=_content_type,
|
||||
_headers=_headers,
|
||||
_host_index=_host_index,
|
||||
_host_index=_host_index
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
"200": "TypesSarifAssessmentResponse",
|
||||
"400": "TypesError",
|
||||
"401": "TypesError",
|
||||
"404": "TypesError",
|
||||
"500": "TypesError",
|
||||
'200': "TypesSarifAssessmentResponse",
|
||||
'400': "TypesError",
|
||||
'401': "TypesError",
|
||||
'404': "TypesError",
|
||||
'500': "TypesError",
|
||||
}
|
||||
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
_request_timeout=_request_timeout
|
||||
)
|
||||
return response_data.response
|
||||
|
||||
|
||||
def _v1_task_task_id_broadcast_sarif_assessment_broadcast_sarif_id_post_serialize(
|
||||
self,
|
||||
task_id,
|
||||
@@ -267,20 +285,23 @@ class BroadcastSarifAssessmentApi:
|
||||
|
||||
_host = None
|
||||
|
||||
_collection_formats: Dict[str, str] = {}
|
||||
_collection_formats: Dict[str, str] = {
|
||||
}
|
||||
|
||||
_path_params: Dict[str, str] = {}
|
||||
_query_params: List[Tuple[str, str]] = []
|
||||
_header_params: Dict[str, Optional[str]] = _headers or {}
|
||||
_form_params: List[Tuple[str, str]] = []
|
||||
_files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
|
||||
_files: Dict[
|
||||
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
||||
] = {}
|
||||
_body_params: Optional[bytes] = None
|
||||
|
||||
# process the path parameters
|
||||
if task_id is not None:
|
||||
_path_params["task_id"] = task_id
|
||||
_path_params['task_id'] = task_id
|
||||
if broadcast_sarif_id is not None:
|
||||
_path_params["broadcast_sarif_id"] = broadcast_sarif_id
|
||||
_path_params['broadcast_sarif_id'] = broadcast_sarif_id
|
||||
# process the query parameters
|
||||
# process the header parameters
|
||||
# process the form parameters
|
||||
@@ -288,24 +309,37 @@ class BroadcastSarifAssessmentApi:
|
||||
if payload is not None:
|
||||
_body_params = payload
|
||||
|
||||
|
||||
# set the HTTP header `Accept`
|
||||
if "Accept" not in _header_params:
|
||||
_header_params["Accept"] = self.api_client.select_header_accept(["application/json"])
|
||||
if 'Accept' not in _header_params:
|
||||
_header_params['Accept'] = self.api_client.select_header_accept(
|
||||
[
|
||||
'application/json'
|
||||
]
|
||||
)
|
||||
|
||||
# set the HTTP header `Content-Type`
|
||||
if _content_type:
|
||||
_header_params["Content-Type"] = _content_type
|
||||
_header_params['Content-Type'] = _content_type
|
||||
else:
|
||||
_default_content_type = self.api_client.select_header_content_type(["application/json"])
|
||||
_default_content_type = (
|
||||
self.api_client.select_header_content_type(
|
||||
[
|
||||
'application/json'
|
||||
]
|
||||
)
|
||||
)
|
||||
if _default_content_type is not None:
|
||||
_header_params["Content-Type"] = _default_content_type
|
||||
_header_params['Content-Type'] = _default_content_type
|
||||
|
||||
# authentication setting
|
||||
_auth_settings: List[str] = ["BasicAuth"]
|
||||
_auth_settings: List[str] = [
|
||||
'BasicAuth'
|
||||
]
|
||||
|
||||
return self.api_client.param_serialize(
|
||||
method="POST",
|
||||
resource_path="/v1/task/{task_id}/broadcast-sarif-assessment/{broadcast_sarif_id}/",
|
||||
method='POST',
|
||||
resource_path='/v1/task/{task_id}/broadcast-sarif-assessment/{broadcast_sarif_id}/',
|
||||
path_params=_path_params,
|
||||
query_params=_query_params,
|
||||
header_params=_header_params,
|
||||
@@ -315,5 +349,7 @@ class BroadcastSarifAssessmentApi:
|
||||
auth_settings=_auth_settings,
|
||||
collection_formats=_collection_formats,
|
||||
_host=_host,
|
||||
_request_auth=_request_auth,
|
||||
_request_auth=_request_auth
|
||||
)
|
||||
|
||||
|
||||
|
||||
+310
-164
@@ -1,14 +1,14 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Example Competition API
|
||||
Example Competition API
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: 1.4.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
The version of the OpenAPI document: 1.4.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
import warnings
|
||||
@@ -19,12 +19,8 @@ from typing_extensions import Annotated
|
||||
from pydantic import Field, StrictStr
|
||||
from typing_extensions import Annotated
|
||||
from buttercup.orchestrator.competition_api_client.models.types_bundle_submission import TypesBundleSubmission
|
||||
from buttercup.orchestrator.competition_api_client.models.types_bundle_submission_response import (
|
||||
TypesBundleSubmissionResponse,
|
||||
)
|
||||
from buttercup.orchestrator.competition_api_client.models.types_bundle_submission_response_verbose import (
|
||||
TypesBundleSubmissionResponseVerbose,
|
||||
)
|
||||
from buttercup.orchestrator.competition_api_client.models.types_bundle_submission_response import TypesBundleSubmissionResponse
|
||||
from buttercup.orchestrator.competition_api_client.models.types_bundle_submission_response_verbose import TypesBundleSubmissionResponseVerbose
|
||||
|
||||
from buttercup.orchestrator.competition_api_client.api_client import ApiClient, RequestSerialized
|
||||
from buttercup.orchestrator.competition_api_client.api_response import ApiResponse
|
||||
@@ -43,6 +39,7 @@ class BundleApi:
|
||||
api_client = ApiClient.get_default()
|
||||
self.api_client = api_client
|
||||
|
||||
|
||||
@validate_call
|
||||
def v1_task_task_id_bundle_bundle_id_delete(
|
||||
self,
|
||||
@@ -51,7 +48,10 @@ class BundleApi:
|
||||
_request_timeout: Union[
|
||||
None,
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
|
||||
Tuple[
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Annotated[StrictFloat, Field(gt=0)]
|
||||
]
|
||||
] = None,
|
||||
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
||||
_content_type: Optional[StrictStr] = None,
|
||||
@@ -86,7 +86,7 @@ class BundleApi:
|
||||
in the spec for a single request.
|
||||
:type _host_index: int, optional
|
||||
:return: Returns the result object.
|
||||
""" # noqa: E501
|
||||
""" # noqa: E501
|
||||
|
||||
_param = self._v1_task_task_id_bundle_bundle_id_delete_serialize(
|
||||
task_id=task_id,
|
||||
@@ -94,23 +94,27 @@ class BundleApi:
|
||||
_request_auth=_request_auth,
|
||||
_content_type=_content_type,
|
||||
_headers=_headers,
|
||||
_host_index=_host_index,
|
||||
_host_index=_host_index
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
"204": "str",
|
||||
"400": "TypesError",
|
||||
"401": "TypesError",
|
||||
"404": "TypesError",
|
||||
"500": "TypesError",
|
||||
'204': "str",
|
||||
'400': "TypesError",
|
||||
'401': "TypesError",
|
||||
'404': "TypesError",
|
||||
'500': "TypesError",
|
||||
}
|
||||
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
_request_timeout=_request_timeout
|
||||
)
|
||||
response_data.read()
|
||||
return self.api_client.response_deserialize(
|
||||
response_data=response_data,
|
||||
response_types_map=_response_types_map,
|
||||
).data
|
||||
|
||||
|
||||
@validate_call
|
||||
def v1_task_task_id_bundle_bundle_id_delete_with_http_info(
|
||||
self,
|
||||
@@ -119,7 +123,10 @@ class BundleApi:
|
||||
_request_timeout: Union[
|
||||
None,
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
|
||||
Tuple[
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Annotated[StrictFloat, Field(gt=0)]
|
||||
]
|
||||
] = None,
|
||||
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
||||
_content_type: Optional[StrictStr] = None,
|
||||
@@ -154,7 +161,7 @@ class BundleApi:
|
||||
in the spec for a single request.
|
||||
:type _host_index: int, optional
|
||||
:return: Returns the result object.
|
||||
""" # noqa: E501
|
||||
""" # noqa: E501
|
||||
|
||||
_param = self._v1_task_task_id_bundle_bundle_id_delete_serialize(
|
||||
task_id=task_id,
|
||||
@@ -162,23 +169,27 @@ class BundleApi:
|
||||
_request_auth=_request_auth,
|
||||
_content_type=_content_type,
|
||||
_headers=_headers,
|
||||
_host_index=_host_index,
|
||||
_host_index=_host_index
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
"204": "str",
|
||||
"400": "TypesError",
|
||||
"401": "TypesError",
|
||||
"404": "TypesError",
|
||||
"500": "TypesError",
|
||||
'204': "str",
|
||||
'400': "TypesError",
|
||||
'401': "TypesError",
|
||||
'404': "TypesError",
|
||||
'500': "TypesError",
|
||||
}
|
||||
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
_request_timeout=_request_timeout
|
||||
)
|
||||
response_data.read()
|
||||
return self.api_client.response_deserialize(
|
||||
response_data=response_data,
|
||||
response_types_map=_response_types_map,
|
||||
)
|
||||
|
||||
|
||||
@validate_call
|
||||
def v1_task_task_id_bundle_bundle_id_delete_without_preload_content(
|
||||
self,
|
||||
@@ -187,7 +198,10 @@ class BundleApi:
|
||||
_request_timeout: Union[
|
||||
None,
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
|
||||
Tuple[
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Annotated[StrictFloat, Field(gt=0)]
|
||||
]
|
||||
] = None,
|
||||
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
||||
_content_type: Optional[StrictStr] = None,
|
||||
@@ -222,7 +236,7 @@ class BundleApi:
|
||||
in the spec for a single request.
|
||||
:type _host_index: int, optional
|
||||
:return: Returns the result object.
|
||||
""" # noqa: E501
|
||||
""" # noqa: E501
|
||||
|
||||
_param = self._v1_task_task_id_bundle_bundle_id_delete_serialize(
|
||||
task_id=task_id,
|
||||
@@ -230,19 +244,23 @@ class BundleApi:
|
||||
_request_auth=_request_auth,
|
||||
_content_type=_content_type,
|
||||
_headers=_headers,
|
||||
_host_index=_host_index,
|
||||
_host_index=_host_index
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
"204": "str",
|
||||
"400": "TypesError",
|
||||
"401": "TypesError",
|
||||
"404": "TypesError",
|
||||
"500": "TypesError",
|
||||
'204': "str",
|
||||
'400': "TypesError",
|
||||
'401': "TypesError",
|
||||
'404': "TypesError",
|
||||
'500': "TypesError",
|
||||
}
|
||||
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
_request_timeout=_request_timeout
|
||||
)
|
||||
return response_data.response
|
||||
|
||||
|
||||
def _v1_task_task_id_bundle_bundle_id_delete_serialize(
|
||||
self,
|
||||
task_id,
|
||||
@@ -255,35 +273,46 @@ class BundleApi:
|
||||
|
||||
_host = None
|
||||
|
||||
_collection_formats: Dict[str, str] = {}
|
||||
_collection_formats: Dict[str, str] = {
|
||||
}
|
||||
|
||||
_path_params: Dict[str, str] = {}
|
||||
_query_params: List[Tuple[str, str]] = []
|
||||
_header_params: Dict[str, Optional[str]] = _headers or {}
|
||||
_form_params: List[Tuple[str, str]] = []
|
||||
_files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
|
||||
_files: Dict[
|
||||
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
||||
] = {}
|
||||
_body_params: Optional[bytes] = None
|
||||
|
||||
# process the path parameters
|
||||
if task_id is not None:
|
||||
_path_params["task_id"] = task_id
|
||||
_path_params['task_id'] = task_id
|
||||
if bundle_id is not None:
|
||||
_path_params["bundle_id"] = bundle_id
|
||||
_path_params['bundle_id'] = bundle_id
|
||||
# process the query parameters
|
||||
# process the header parameters
|
||||
# process the form parameters
|
||||
# process the body parameter
|
||||
|
||||
|
||||
# set the HTTP header `Accept`
|
||||
if "Accept" not in _header_params:
|
||||
_header_params["Accept"] = self.api_client.select_header_accept(["application/json"])
|
||||
if 'Accept' not in _header_params:
|
||||
_header_params['Accept'] = self.api_client.select_header_accept(
|
||||
[
|
||||
'application/json'
|
||||
]
|
||||
)
|
||||
|
||||
|
||||
# authentication setting
|
||||
_auth_settings: List[str] = ["BasicAuth"]
|
||||
_auth_settings: List[str] = [
|
||||
'BasicAuth'
|
||||
]
|
||||
|
||||
return self.api_client.param_serialize(
|
||||
method="DELETE",
|
||||
resource_path="/v1/task/{task_id}/bundle/{bundle_id}/",
|
||||
method='DELETE',
|
||||
resource_path='/v1/task/{task_id}/bundle/{bundle_id}/',
|
||||
path_params=_path_params,
|
||||
query_params=_query_params,
|
||||
header_params=_header_params,
|
||||
@@ -293,9 +322,12 @@ class BundleApi:
|
||||
auth_settings=_auth_settings,
|
||||
collection_formats=_collection_formats,
|
||||
_host=_host,
|
||||
_request_auth=_request_auth,
|
||||
_request_auth=_request_auth
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
@validate_call
|
||||
def v1_task_task_id_bundle_bundle_id_get(
|
||||
self,
|
||||
@@ -304,7 +336,10 @@ class BundleApi:
|
||||
_request_timeout: Union[
|
||||
None,
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
|
||||
Tuple[
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Annotated[StrictFloat, Field(gt=0)]
|
||||
]
|
||||
] = None,
|
||||
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
||||
_content_type: Optional[StrictStr] = None,
|
||||
@@ -339,7 +374,7 @@ class BundleApi:
|
||||
in the spec for a single request.
|
||||
:type _host_index: int, optional
|
||||
:return: Returns the result object.
|
||||
""" # noqa: E501
|
||||
""" # noqa: E501
|
||||
|
||||
_param = self._v1_task_task_id_bundle_bundle_id_get_serialize(
|
||||
task_id=task_id,
|
||||
@@ -347,23 +382,27 @@ class BundleApi:
|
||||
_request_auth=_request_auth,
|
||||
_content_type=_content_type,
|
||||
_headers=_headers,
|
||||
_host_index=_host_index,
|
||||
_host_index=_host_index
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
"200": "TypesBundleSubmissionResponseVerbose",
|
||||
"400": "TypesError",
|
||||
"401": "TypesError",
|
||||
"404": "TypesError",
|
||||
"500": "TypesError",
|
||||
'200': "TypesBundleSubmissionResponseVerbose",
|
||||
'400': "TypesError",
|
||||
'401': "TypesError",
|
||||
'404': "TypesError",
|
||||
'500': "TypesError",
|
||||
}
|
||||
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
_request_timeout=_request_timeout
|
||||
)
|
||||
response_data.read()
|
||||
return self.api_client.response_deserialize(
|
||||
response_data=response_data,
|
||||
response_types_map=_response_types_map,
|
||||
).data
|
||||
|
||||
|
||||
@validate_call
|
||||
def v1_task_task_id_bundle_bundle_id_get_with_http_info(
|
||||
self,
|
||||
@@ -372,7 +411,10 @@ class BundleApi:
|
||||
_request_timeout: Union[
|
||||
None,
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
|
||||
Tuple[
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Annotated[StrictFloat, Field(gt=0)]
|
||||
]
|
||||
] = None,
|
||||
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
||||
_content_type: Optional[StrictStr] = None,
|
||||
@@ -407,7 +449,7 @@ class BundleApi:
|
||||
in the spec for a single request.
|
||||
:type _host_index: int, optional
|
||||
:return: Returns the result object.
|
||||
""" # noqa: E501
|
||||
""" # noqa: E501
|
||||
|
||||
_param = self._v1_task_task_id_bundle_bundle_id_get_serialize(
|
||||
task_id=task_id,
|
||||
@@ -415,23 +457,27 @@ class BundleApi:
|
||||
_request_auth=_request_auth,
|
||||
_content_type=_content_type,
|
||||
_headers=_headers,
|
||||
_host_index=_host_index,
|
||||
_host_index=_host_index
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
"200": "TypesBundleSubmissionResponseVerbose",
|
||||
"400": "TypesError",
|
||||
"401": "TypesError",
|
||||
"404": "TypesError",
|
||||
"500": "TypesError",
|
||||
'200': "TypesBundleSubmissionResponseVerbose",
|
||||
'400': "TypesError",
|
||||
'401': "TypesError",
|
||||
'404': "TypesError",
|
||||
'500': "TypesError",
|
||||
}
|
||||
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
_request_timeout=_request_timeout
|
||||
)
|
||||
response_data.read()
|
||||
return self.api_client.response_deserialize(
|
||||
response_data=response_data,
|
||||
response_types_map=_response_types_map,
|
||||
)
|
||||
|
||||
|
||||
@validate_call
|
||||
def v1_task_task_id_bundle_bundle_id_get_without_preload_content(
|
||||
self,
|
||||
@@ -440,7 +486,10 @@ class BundleApi:
|
||||
_request_timeout: Union[
|
||||
None,
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
|
||||
Tuple[
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Annotated[StrictFloat, Field(gt=0)]
|
||||
]
|
||||
] = None,
|
||||
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
||||
_content_type: Optional[StrictStr] = None,
|
||||
@@ -475,7 +524,7 @@ class BundleApi:
|
||||
in the spec for a single request.
|
||||
:type _host_index: int, optional
|
||||
:return: Returns the result object.
|
||||
""" # noqa: E501
|
||||
""" # noqa: E501
|
||||
|
||||
_param = self._v1_task_task_id_bundle_bundle_id_get_serialize(
|
||||
task_id=task_id,
|
||||
@@ -483,19 +532,23 @@ class BundleApi:
|
||||
_request_auth=_request_auth,
|
||||
_content_type=_content_type,
|
||||
_headers=_headers,
|
||||
_host_index=_host_index,
|
||||
_host_index=_host_index
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
"200": "TypesBundleSubmissionResponseVerbose",
|
||||
"400": "TypesError",
|
||||
"401": "TypesError",
|
||||
"404": "TypesError",
|
||||
"500": "TypesError",
|
||||
'200': "TypesBundleSubmissionResponseVerbose",
|
||||
'400': "TypesError",
|
||||
'401': "TypesError",
|
||||
'404': "TypesError",
|
||||
'500': "TypesError",
|
||||
}
|
||||
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
_request_timeout=_request_timeout
|
||||
)
|
||||
return response_data.response
|
||||
|
||||
|
||||
def _v1_task_task_id_bundle_bundle_id_get_serialize(
|
||||
self,
|
||||
task_id,
|
||||
@@ -508,35 +561,46 @@ class BundleApi:
|
||||
|
||||
_host = None
|
||||
|
||||
_collection_formats: Dict[str, str] = {}
|
||||
_collection_formats: Dict[str, str] = {
|
||||
}
|
||||
|
||||
_path_params: Dict[str, str] = {}
|
||||
_query_params: List[Tuple[str, str]] = []
|
||||
_header_params: Dict[str, Optional[str]] = _headers or {}
|
||||
_form_params: List[Tuple[str, str]] = []
|
||||
_files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
|
||||
_files: Dict[
|
||||
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
||||
] = {}
|
||||
_body_params: Optional[bytes] = None
|
||||
|
||||
# process the path parameters
|
||||
if task_id is not None:
|
||||
_path_params["task_id"] = task_id
|
||||
_path_params['task_id'] = task_id
|
||||
if bundle_id is not None:
|
||||
_path_params["bundle_id"] = bundle_id
|
||||
_path_params['bundle_id'] = bundle_id
|
||||
# process the query parameters
|
||||
# process the header parameters
|
||||
# process the form parameters
|
||||
# process the body parameter
|
||||
|
||||
|
||||
# set the HTTP header `Accept`
|
||||
if "Accept" not in _header_params:
|
||||
_header_params["Accept"] = self.api_client.select_header_accept(["application/json"])
|
||||
if 'Accept' not in _header_params:
|
||||
_header_params['Accept'] = self.api_client.select_header_accept(
|
||||
[
|
||||
'application/json'
|
||||
]
|
||||
)
|
||||
|
||||
|
||||
# authentication setting
|
||||
_auth_settings: List[str] = ["BasicAuth"]
|
||||
_auth_settings: List[str] = [
|
||||
'BasicAuth'
|
||||
]
|
||||
|
||||
return self.api_client.param_serialize(
|
||||
method="GET",
|
||||
resource_path="/v1/task/{task_id}/bundle/{bundle_id}/",
|
||||
method='GET',
|
||||
resource_path='/v1/task/{task_id}/bundle/{bundle_id}/',
|
||||
path_params=_path_params,
|
||||
query_params=_query_params,
|
||||
header_params=_header_params,
|
||||
@@ -546,9 +610,12 @@ class BundleApi:
|
||||
auth_settings=_auth_settings,
|
||||
collection_formats=_collection_formats,
|
||||
_host=_host,
|
||||
_request_auth=_request_auth,
|
||||
_request_auth=_request_auth
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
@validate_call
|
||||
def v1_task_task_id_bundle_bundle_id_patch(
|
||||
self,
|
||||
@@ -558,7 +625,10 @@ class BundleApi:
|
||||
_request_timeout: Union[
|
||||
None,
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
|
||||
Tuple[
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Annotated[StrictFloat, Field(gt=0)]
|
||||
]
|
||||
] = None,
|
||||
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
||||
_content_type: Optional[StrictStr] = None,
|
||||
@@ -595,7 +665,7 @@ class BundleApi:
|
||||
in the spec for a single request.
|
||||
:type _host_index: int, optional
|
||||
:return: Returns the result object.
|
||||
""" # noqa: E501
|
||||
""" # noqa: E501
|
||||
|
||||
_param = self._v1_task_task_id_bundle_bundle_id_patch_serialize(
|
||||
task_id=task_id,
|
||||
@@ -604,23 +674,27 @@ class BundleApi:
|
||||
_request_auth=_request_auth,
|
||||
_content_type=_content_type,
|
||||
_headers=_headers,
|
||||
_host_index=_host_index,
|
||||
_host_index=_host_index
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
"200": "TypesBundleSubmissionResponseVerbose",
|
||||
"400": "TypesError",
|
||||
"401": "TypesError",
|
||||
"404": "TypesError",
|
||||
"500": "TypesError",
|
||||
'200': "TypesBundleSubmissionResponseVerbose",
|
||||
'400': "TypesError",
|
||||
'401': "TypesError",
|
||||
'404': "TypesError",
|
||||
'500': "TypesError",
|
||||
}
|
||||
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
_request_timeout=_request_timeout
|
||||
)
|
||||
response_data.read()
|
||||
return self.api_client.response_deserialize(
|
||||
response_data=response_data,
|
||||
response_types_map=_response_types_map,
|
||||
).data
|
||||
|
||||
|
||||
@validate_call
|
||||
def v1_task_task_id_bundle_bundle_id_patch_with_http_info(
|
||||
self,
|
||||
@@ -630,7 +704,10 @@ class BundleApi:
|
||||
_request_timeout: Union[
|
||||
None,
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
|
||||
Tuple[
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Annotated[StrictFloat, Field(gt=0)]
|
||||
]
|
||||
] = None,
|
||||
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
||||
_content_type: Optional[StrictStr] = None,
|
||||
@@ -667,7 +744,7 @@ class BundleApi:
|
||||
in the spec for a single request.
|
||||
:type _host_index: int, optional
|
||||
:return: Returns the result object.
|
||||
""" # noqa: E501
|
||||
""" # noqa: E501
|
||||
|
||||
_param = self._v1_task_task_id_bundle_bundle_id_patch_serialize(
|
||||
task_id=task_id,
|
||||
@@ -676,23 +753,27 @@ class BundleApi:
|
||||
_request_auth=_request_auth,
|
||||
_content_type=_content_type,
|
||||
_headers=_headers,
|
||||
_host_index=_host_index,
|
||||
_host_index=_host_index
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
"200": "TypesBundleSubmissionResponseVerbose",
|
||||
"400": "TypesError",
|
||||
"401": "TypesError",
|
||||
"404": "TypesError",
|
||||
"500": "TypesError",
|
||||
'200': "TypesBundleSubmissionResponseVerbose",
|
||||
'400': "TypesError",
|
||||
'401': "TypesError",
|
||||
'404': "TypesError",
|
||||
'500': "TypesError",
|
||||
}
|
||||
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
_request_timeout=_request_timeout
|
||||
)
|
||||
response_data.read()
|
||||
return self.api_client.response_deserialize(
|
||||
response_data=response_data,
|
||||
response_types_map=_response_types_map,
|
||||
)
|
||||
|
||||
|
||||
@validate_call
|
||||
def v1_task_task_id_bundle_bundle_id_patch_without_preload_content(
|
||||
self,
|
||||
@@ -702,7 +783,10 @@ class BundleApi:
|
||||
_request_timeout: Union[
|
||||
None,
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
|
||||
Tuple[
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Annotated[StrictFloat, Field(gt=0)]
|
||||
]
|
||||
] = None,
|
||||
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
||||
_content_type: Optional[StrictStr] = None,
|
||||
@@ -739,7 +823,7 @@ class BundleApi:
|
||||
in the spec for a single request.
|
||||
:type _host_index: int, optional
|
||||
:return: Returns the result object.
|
||||
""" # noqa: E501
|
||||
""" # noqa: E501
|
||||
|
||||
_param = self._v1_task_task_id_bundle_bundle_id_patch_serialize(
|
||||
task_id=task_id,
|
||||
@@ -748,19 +832,23 @@ class BundleApi:
|
||||
_request_auth=_request_auth,
|
||||
_content_type=_content_type,
|
||||
_headers=_headers,
|
||||
_host_index=_host_index,
|
||||
_host_index=_host_index
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
"200": "TypesBundleSubmissionResponseVerbose",
|
||||
"400": "TypesError",
|
||||
"401": "TypesError",
|
||||
"404": "TypesError",
|
||||
"500": "TypesError",
|
||||
'200': "TypesBundleSubmissionResponseVerbose",
|
||||
'400': "TypesError",
|
||||
'401': "TypesError",
|
||||
'404': "TypesError",
|
||||
'500': "TypesError",
|
||||
}
|
||||
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
_request_timeout=_request_timeout
|
||||
)
|
||||
return response_data.response
|
||||
|
||||
|
||||
def _v1_task_task_id_bundle_bundle_id_patch_serialize(
|
||||
self,
|
||||
task_id,
|
||||
@@ -774,20 +862,23 @@ class BundleApi:
|
||||
|
||||
_host = None
|
||||
|
||||
_collection_formats: Dict[str, str] = {}
|
||||
_collection_formats: Dict[str, str] = {
|
||||
}
|
||||
|
||||
_path_params: Dict[str, str] = {}
|
||||
_query_params: List[Tuple[str, str]] = []
|
||||
_header_params: Dict[str, Optional[str]] = _headers or {}
|
||||
_form_params: List[Tuple[str, str]] = []
|
||||
_files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
|
||||
_files: Dict[
|
||||
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
||||
] = {}
|
||||
_body_params: Optional[bytes] = None
|
||||
|
||||
# process the path parameters
|
||||
if task_id is not None:
|
||||
_path_params["task_id"] = task_id
|
||||
_path_params['task_id'] = task_id
|
||||
if bundle_id is not None:
|
||||
_path_params["bundle_id"] = bundle_id
|
||||
_path_params['bundle_id'] = bundle_id
|
||||
# process the query parameters
|
||||
# process the header parameters
|
||||
# process the form parameters
|
||||
@@ -795,24 +886,37 @@ class BundleApi:
|
||||
if payload is not None:
|
||||
_body_params = payload
|
||||
|
||||
|
||||
# set the HTTP header `Accept`
|
||||
if "Accept" not in _header_params:
|
||||
_header_params["Accept"] = self.api_client.select_header_accept(["application/json"])
|
||||
if 'Accept' not in _header_params:
|
||||
_header_params['Accept'] = self.api_client.select_header_accept(
|
||||
[
|
||||
'application/json'
|
||||
]
|
||||
)
|
||||
|
||||
# set the HTTP header `Content-Type`
|
||||
if _content_type:
|
||||
_header_params["Content-Type"] = _content_type
|
||||
_header_params['Content-Type'] = _content_type
|
||||
else:
|
||||
_default_content_type = self.api_client.select_header_content_type(["application/json"])
|
||||
_default_content_type = (
|
||||
self.api_client.select_header_content_type(
|
||||
[
|
||||
'application/json'
|
||||
]
|
||||
)
|
||||
)
|
||||
if _default_content_type is not None:
|
||||
_header_params["Content-Type"] = _default_content_type
|
||||
_header_params['Content-Type'] = _default_content_type
|
||||
|
||||
# authentication setting
|
||||
_auth_settings: List[str] = ["BasicAuth"]
|
||||
_auth_settings: List[str] = [
|
||||
'BasicAuth'
|
||||
]
|
||||
|
||||
return self.api_client.param_serialize(
|
||||
method="PATCH",
|
||||
resource_path="/v1/task/{task_id}/bundle/{bundle_id}/",
|
||||
method='PATCH',
|
||||
resource_path='/v1/task/{task_id}/bundle/{bundle_id}/',
|
||||
path_params=_path_params,
|
||||
query_params=_query_params,
|
||||
header_params=_header_params,
|
||||
@@ -822,9 +926,12 @@ class BundleApi:
|
||||
auth_settings=_auth_settings,
|
||||
collection_formats=_collection_formats,
|
||||
_host=_host,
|
||||
_request_auth=_request_auth,
|
||||
_request_auth=_request_auth
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
@validate_call
|
||||
def v1_task_task_id_bundle_post(
|
||||
self,
|
||||
@@ -833,7 +940,10 @@ class BundleApi:
|
||||
_request_timeout: Union[
|
||||
None,
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
|
||||
Tuple[
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Annotated[StrictFloat, Field(gt=0)]
|
||||
]
|
||||
] = None,
|
||||
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
||||
_content_type: Optional[StrictStr] = None,
|
||||
@@ -868,7 +978,7 @@ class BundleApi:
|
||||
in the spec for a single request.
|
||||
:type _host_index: int, optional
|
||||
:return: Returns the result object.
|
||||
""" # noqa: E501
|
||||
""" # noqa: E501
|
||||
|
||||
_param = self._v1_task_task_id_bundle_post_serialize(
|
||||
task_id=task_id,
|
||||
@@ -876,23 +986,27 @@ class BundleApi:
|
||||
_request_auth=_request_auth,
|
||||
_content_type=_content_type,
|
||||
_headers=_headers,
|
||||
_host_index=_host_index,
|
||||
_host_index=_host_index
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
"200": "TypesBundleSubmissionResponse",
|
||||
"400": "TypesError",
|
||||
"401": "TypesError",
|
||||
"404": "TypesError",
|
||||
"500": "TypesError",
|
||||
'200': "TypesBundleSubmissionResponse",
|
||||
'400': "TypesError",
|
||||
'401': "TypesError",
|
||||
'404': "TypesError",
|
||||
'500': "TypesError",
|
||||
}
|
||||
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
_request_timeout=_request_timeout
|
||||
)
|
||||
response_data.read()
|
||||
return self.api_client.response_deserialize(
|
||||
response_data=response_data,
|
||||
response_types_map=_response_types_map,
|
||||
).data
|
||||
|
||||
|
||||
@validate_call
|
||||
def v1_task_task_id_bundle_post_with_http_info(
|
||||
self,
|
||||
@@ -901,7 +1015,10 @@ class BundleApi:
|
||||
_request_timeout: Union[
|
||||
None,
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
|
||||
Tuple[
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Annotated[StrictFloat, Field(gt=0)]
|
||||
]
|
||||
] = None,
|
||||
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
||||
_content_type: Optional[StrictStr] = None,
|
||||
@@ -936,7 +1053,7 @@ class BundleApi:
|
||||
in the spec for a single request.
|
||||
:type _host_index: int, optional
|
||||
:return: Returns the result object.
|
||||
""" # noqa: E501
|
||||
""" # noqa: E501
|
||||
|
||||
_param = self._v1_task_task_id_bundle_post_serialize(
|
||||
task_id=task_id,
|
||||
@@ -944,23 +1061,27 @@ class BundleApi:
|
||||
_request_auth=_request_auth,
|
||||
_content_type=_content_type,
|
||||
_headers=_headers,
|
||||
_host_index=_host_index,
|
||||
_host_index=_host_index
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
"200": "TypesBundleSubmissionResponse",
|
||||
"400": "TypesError",
|
||||
"401": "TypesError",
|
||||
"404": "TypesError",
|
||||
"500": "TypesError",
|
||||
'200': "TypesBundleSubmissionResponse",
|
||||
'400': "TypesError",
|
||||
'401': "TypesError",
|
||||
'404': "TypesError",
|
||||
'500': "TypesError",
|
||||
}
|
||||
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
_request_timeout=_request_timeout
|
||||
)
|
||||
response_data.read()
|
||||
return self.api_client.response_deserialize(
|
||||
response_data=response_data,
|
||||
response_types_map=_response_types_map,
|
||||
)
|
||||
|
||||
|
||||
@validate_call
|
||||
def v1_task_task_id_bundle_post_without_preload_content(
|
||||
self,
|
||||
@@ -969,7 +1090,10 @@ class BundleApi:
|
||||
_request_timeout: Union[
|
||||
None,
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
|
||||
Tuple[
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Annotated[StrictFloat, Field(gt=0)]
|
||||
]
|
||||
] = None,
|
||||
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
||||
_content_type: Optional[StrictStr] = None,
|
||||
@@ -1004,7 +1128,7 @@ class BundleApi:
|
||||
in the spec for a single request.
|
||||
:type _host_index: int, optional
|
||||
:return: Returns the result object.
|
||||
""" # noqa: E501
|
||||
""" # noqa: E501
|
||||
|
||||
_param = self._v1_task_task_id_bundle_post_serialize(
|
||||
task_id=task_id,
|
||||
@@ -1012,19 +1136,23 @@ class BundleApi:
|
||||
_request_auth=_request_auth,
|
||||
_content_type=_content_type,
|
||||
_headers=_headers,
|
||||
_host_index=_host_index,
|
||||
_host_index=_host_index
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
"200": "TypesBundleSubmissionResponse",
|
||||
"400": "TypesError",
|
||||
"401": "TypesError",
|
||||
"404": "TypesError",
|
||||
"500": "TypesError",
|
||||
'200': "TypesBundleSubmissionResponse",
|
||||
'400': "TypesError",
|
||||
'401': "TypesError",
|
||||
'404': "TypesError",
|
||||
'500': "TypesError",
|
||||
}
|
||||
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
_request_timeout=_request_timeout
|
||||
)
|
||||
return response_data.response
|
||||
|
||||
|
||||
def _v1_task_task_id_bundle_post_serialize(
|
||||
self,
|
||||
task_id,
|
||||
@@ -1037,18 +1165,21 @@ class BundleApi:
|
||||
|
||||
_host = None
|
||||
|
||||
_collection_formats: Dict[str, str] = {}
|
||||
_collection_formats: Dict[str, str] = {
|
||||
}
|
||||
|
||||
_path_params: Dict[str, str] = {}
|
||||
_query_params: List[Tuple[str, str]] = []
|
||||
_header_params: Dict[str, Optional[str]] = _headers or {}
|
||||
_form_params: List[Tuple[str, str]] = []
|
||||
_files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
|
||||
_files: Dict[
|
||||
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
||||
] = {}
|
||||
_body_params: Optional[bytes] = None
|
||||
|
||||
# process the path parameters
|
||||
if task_id is not None:
|
||||
_path_params["task_id"] = task_id
|
||||
_path_params['task_id'] = task_id
|
||||
# process the query parameters
|
||||
# process the header parameters
|
||||
# process the form parameters
|
||||
@@ -1056,24 +1187,37 @@ class BundleApi:
|
||||
if payload is not None:
|
||||
_body_params = payload
|
||||
|
||||
|
||||
# set the HTTP header `Accept`
|
||||
if "Accept" not in _header_params:
|
||||
_header_params["Accept"] = self.api_client.select_header_accept(["application/json"])
|
||||
if 'Accept' not in _header_params:
|
||||
_header_params['Accept'] = self.api_client.select_header_accept(
|
||||
[
|
||||
'application/json'
|
||||
]
|
||||
)
|
||||
|
||||
# set the HTTP header `Content-Type`
|
||||
if _content_type:
|
||||
_header_params["Content-Type"] = _content_type
|
||||
_header_params['Content-Type'] = _content_type
|
||||
else:
|
||||
_default_content_type = self.api_client.select_header_content_type(["application/json"])
|
||||
_default_content_type = (
|
||||
self.api_client.select_header_content_type(
|
||||
[
|
||||
'application/json'
|
||||
]
|
||||
)
|
||||
)
|
||||
if _default_content_type is not None:
|
||||
_header_params["Content-Type"] = _default_content_type
|
||||
_header_params['Content-Type'] = _default_content_type
|
||||
|
||||
# authentication setting
|
||||
_auth_settings: List[str] = ["BasicAuth"]
|
||||
_auth_settings: List[str] = [
|
||||
'BasicAuth'
|
||||
]
|
||||
|
||||
return self.api_client.param_serialize(
|
||||
method="POST",
|
||||
resource_path="/v1/task/{task_id}/bundle/",
|
||||
method='POST',
|
||||
resource_path='/v1/task/{task_id}/bundle/',
|
||||
path_params=_path_params,
|
||||
query_params=_query_params,
|
||||
header_params=_header_params,
|
||||
@@ -1083,5 +1227,7 @@ class BundleApi:
|
||||
auth_settings=_auth_settings,
|
||||
collection_formats=_collection_formats,
|
||||
_host=_host,
|
||||
_request_auth=_request_auth,
|
||||
_request_auth=_request_auth
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Example Competition API
|
||||
Example Competition API
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: 1.1
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
The version of the OpenAPI document: 1.1
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
import warnings
|
||||
@@ -38,6 +38,7 @@ class FeeformApi:
|
||||
api_client = ApiClient.get_default()
|
||||
self.api_client = api_client
|
||||
|
||||
|
||||
@validate_call
|
||||
def v1_task_task_id_freeform_post(
|
||||
self,
|
||||
@@ -46,7 +47,10 @@ class FeeformApi:
|
||||
_request_timeout: Union[
|
||||
None,
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
|
||||
Tuple[
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Annotated[StrictFloat, Field(gt=0)]
|
||||
]
|
||||
] = None,
|
||||
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
||||
_content_type: Optional[StrictStr] = None,
|
||||
@@ -81,7 +85,7 @@ class FeeformApi:
|
||||
in the spec for a single request.
|
||||
:type _host_index: int, optional
|
||||
:return: Returns the result object.
|
||||
""" # noqa: E501
|
||||
""" # noqa: E501
|
||||
|
||||
_param = self._v1_task_task_id_freeform_post_serialize(
|
||||
task_id=task_id,
|
||||
@@ -89,23 +93,27 @@ class FeeformApi:
|
||||
_request_auth=_request_auth,
|
||||
_content_type=_content_type,
|
||||
_headers=_headers,
|
||||
_host_index=_host_index,
|
||||
_host_index=_host_index
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
"200": "TypesFreeformResponse",
|
||||
"400": "TypesError",
|
||||
"401": "TypesError",
|
||||
"404": "TypesError",
|
||||
"500": "TypesError",
|
||||
'200': "TypesFreeformResponse",
|
||||
'400': "TypesError",
|
||||
'401': "TypesError",
|
||||
'404': "TypesError",
|
||||
'500': "TypesError",
|
||||
}
|
||||
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
_request_timeout=_request_timeout
|
||||
)
|
||||
response_data.read()
|
||||
return self.api_client.response_deserialize(
|
||||
response_data=response_data,
|
||||
response_types_map=_response_types_map,
|
||||
).data
|
||||
|
||||
|
||||
@validate_call
|
||||
def v1_task_task_id_freeform_post_with_http_info(
|
||||
self,
|
||||
@@ -114,7 +122,10 @@ class FeeformApi:
|
||||
_request_timeout: Union[
|
||||
None,
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
|
||||
Tuple[
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Annotated[StrictFloat, Field(gt=0)]
|
||||
]
|
||||
] = None,
|
||||
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
||||
_content_type: Optional[StrictStr] = None,
|
||||
@@ -149,7 +160,7 @@ class FeeformApi:
|
||||
in the spec for a single request.
|
||||
:type _host_index: int, optional
|
||||
:return: Returns the result object.
|
||||
""" # noqa: E501
|
||||
""" # noqa: E501
|
||||
|
||||
_param = self._v1_task_task_id_freeform_post_serialize(
|
||||
task_id=task_id,
|
||||
@@ -157,23 +168,27 @@ class FeeformApi:
|
||||
_request_auth=_request_auth,
|
||||
_content_type=_content_type,
|
||||
_headers=_headers,
|
||||
_host_index=_host_index,
|
||||
_host_index=_host_index
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
"200": "TypesFreeformResponse",
|
||||
"400": "TypesError",
|
||||
"401": "TypesError",
|
||||
"404": "TypesError",
|
||||
"500": "TypesError",
|
||||
'200': "TypesFreeformResponse",
|
||||
'400': "TypesError",
|
||||
'401': "TypesError",
|
||||
'404': "TypesError",
|
||||
'500': "TypesError",
|
||||
}
|
||||
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
_request_timeout=_request_timeout
|
||||
)
|
||||
response_data.read()
|
||||
return self.api_client.response_deserialize(
|
||||
response_data=response_data,
|
||||
response_types_map=_response_types_map,
|
||||
)
|
||||
|
||||
|
||||
@validate_call
|
||||
def v1_task_task_id_freeform_post_without_preload_content(
|
||||
self,
|
||||
@@ -182,7 +197,10 @@ class FeeformApi:
|
||||
_request_timeout: Union[
|
||||
None,
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
|
||||
Tuple[
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Annotated[StrictFloat, Field(gt=0)]
|
||||
]
|
||||
] = None,
|
||||
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
||||
_content_type: Optional[StrictStr] = None,
|
||||
@@ -217,7 +235,7 @@ class FeeformApi:
|
||||
in the spec for a single request.
|
||||
:type _host_index: int, optional
|
||||
:return: Returns the result object.
|
||||
""" # noqa: E501
|
||||
""" # noqa: E501
|
||||
|
||||
_param = self._v1_task_task_id_freeform_post_serialize(
|
||||
task_id=task_id,
|
||||
@@ -225,19 +243,23 @@ class FeeformApi:
|
||||
_request_auth=_request_auth,
|
||||
_content_type=_content_type,
|
||||
_headers=_headers,
|
||||
_host_index=_host_index,
|
||||
_host_index=_host_index
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
"200": "TypesFreeformResponse",
|
||||
"400": "TypesError",
|
||||
"401": "TypesError",
|
||||
"404": "TypesError",
|
||||
"500": "TypesError",
|
||||
'200': "TypesFreeformResponse",
|
||||
'400': "TypesError",
|
||||
'401': "TypesError",
|
||||
'404': "TypesError",
|
||||
'500': "TypesError",
|
||||
}
|
||||
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
_request_timeout=_request_timeout
|
||||
)
|
||||
return response_data.response
|
||||
|
||||
|
||||
def _v1_task_task_id_freeform_post_serialize(
|
||||
self,
|
||||
task_id,
|
||||
@@ -250,18 +272,21 @@ class FeeformApi:
|
||||
|
||||
_host = None
|
||||
|
||||
_collection_formats: Dict[str, str] = {}
|
||||
_collection_formats: Dict[str, str] = {
|
||||
}
|
||||
|
||||
_path_params: Dict[str, str] = {}
|
||||
_query_params: List[Tuple[str, str]] = []
|
||||
_header_params: Dict[str, Optional[str]] = _headers or {}
|
||||
_form_params: List[Tuple[str, str]] = []
|
||||
_files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
|
||||
_files: Dict[
|
||||
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
||||
] = {}
|
||||
_body_params: Optional[bytes] = None
|
||||
|
||||
# process the path parameters
|
||||
if task_id is not None:
|
||||
_path_params["task_id"] = task_id
|
||||
_path_params['task_id'] = task_id
|
||||
# process the query parameters
|
||||
# process the header parameters
|
||||
# process the form parameters
|
||||
@@ -269,24 +294,37 @@ class FeeformApi:
|
||||
if payload is not None:
|
||||
_body_params = payload
|
||||
|
||||
|
||||
# set the HTTP header `Accept`
|
||||
if "Accept" not in _header_params:
|
||||
_header_params["Accept"] = self.api_client.select_header_accept(["application/json"])
|
||||
if 'Accept' not in _header_params:
|
||||
_header_params['Accept'] = self.api_client.select_header_accept(
|
||||
[
|
||||
'application/json'
|
||||
]
|
||||
)
|
||||
|
||||
# set the HTTP header `Content-Type`
|
||||
if _content_type:
|
||||
_header_params["Content-Type"] = _content_type
|
||||
_header_params['Content-Type'] = _content_type
|
||||
else:
|
||||
_default_content_type = self.api_client.select_header_content_type(["application/json"])
|
||||
_default_content_type = (
|
||||
self.api_client.select_header_content_type(
|
||||
[
|
||||
'application/json'
|
||||
]
|
||||
)
|
||||
)
|
||||
if _default_content_type is not None:
|
||||
_header_params["Content-Type"] = _default_content_type
|
||||
_header_params['Content-Type'] = _default_content_type
|
||||
|
||||
# authentication setting
|
||||
_auth_settings: List[str] = ["BasicAuth"]
|
||||
_auth_settings: List[str] = [
|
||||
'BasicAuth'
|
||||
]
|
||||
|
||||
return self.api_client.param_serialize(
|
||||
method="POST",
|
||||
resource_path="/v1/task/{task_id}/freeform/",
|
||||
method='POST',
|
||||
resource_path='/v1/task/{task_id}/freeform/',
|
||||
path_params=_path_params,
|
||||
query_params=_query_params,
|
||||
header_params=_header_params,
|
||||
@@ -296,5 +334,7 @@ class FeeformApi:
|
||||
auth_settings=_auth_settings,
|
||||
collection_formats=_collection_formats,
|
||||
_host=_host,
|
||||
_request_auth=_request_auth,
|
||||
_request_auth=_request_auth
|
||||
)
|
||||
|
||||
|
||||
|
||||
+84
-44
@@ -1,14 +1,14 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Example Competition API
|
||||
Example Competition API
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: 1.4.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
The version of the OpenAPI document: 1.4.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
import warnings
|
||||
@@ -38,6 +38,7 @@ class FreeformApi:
|
||||
api_client = ApiClient.get_default()
|
||||
self.api_client = api_client
|
||||
|
||||
|
||||
@validate_call
|
||||
def v1_task_task_id_freeform_post(
|
||||
self,
|
||||
@@ -46,7 +47,10 @@ class FreeformApi:
|
||||
_request_timeout: Union[
|
||||
None,
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
|
||||
Tuple[
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Annotated[StrictFloat, Field(gt=0)]
|
||||
]
|
||||
] = None,
|
||||
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
||||
_content_type: Optional[StrictStr] = None,
|
||||
@@ -81,7 +85,7 @@ class FreeformApi:
|
||||
in the spec for a single request.
|
||||
:type _host_index: int, optional
|
||||
:return: Returns the result object.
|
||||
""" # noqa: E501
|
||||
""" # noqa: E501
|
||||
|
||||
_param = self._v1_task_task_id_freeform_post_serialize(
|
||||
task_id=task_id,
|
||||
@@ -89,23 +93,27 @@ class FreeformApi:
|
||||
_request_auth=_request_auth,
|
||||
_content_type=_content_type,
|
||||
_headers=_headers,
|
||||
_host_index=_host_index,
|
||||
_host_index=_host_index
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
"200": "TypesFreeformResponse",
|
||||
"400": "TypesError",
|
||||
"401": "TypesError",
|
||||
"404": "TypesError",
|
||||
"500": "TypesError",
|
||||
'200': "TypesFreeformResponse",
|
||||
'400': "TypesError",
|
||||
'401': "TypesError",
|
||||
'404': "TypesError",
|
||||
'500': "TypesError",
|
||||
}
|
||||
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
_request_timeout=_request_timeout
|
||||
)
|
||||
response_data.read()
|
||||
return self.api_client.response_deserialize(
|
||||
response_data=response_data,
|
||||
response_types_map=_response_types_map,
|
||||
).data
|
||||
|
||||
|
||||
@validate_call
|
||||
def v1_task_task_id_freeform_post_with_http_info(
|
||||
self,
|
||||
@@ -114,7 +122,10 @@ class FreeformApi:
|
||||
_request_timeout: Union[
|
||||
None,
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
|
||||
Tuple[
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Annotated[StrictFloat, Field(gt=0)]
|
||||
]
|
||||
] = None,
|
||||
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
||||
_content_type: Optional[StrictStr] = None,
|
||||
@@ -149,7 +160,7 @@ class FreeformApi:
|
||||
in the spec for a single request.
|
||||
:type _host_index: int, optional
|
||||
:return: Returns the result object.
|
||||
""" # noqa: E501
|
||||
""" # noqa: E501
|
||||
|
||||
_param = self._v1_task_task_id_freeform_post_serialize(
|
||||
task_id=task_id,
|
||||
@@ -157,23 +168,27 @@ class FreeformApi:
|
||||
_request_auth=_request_auth,
|
||||
_content_type=_content_type,
|
||||
_headers=_headers,
|
||||
_host_index=_host_index,
|
||||
_host_index=_host_index
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
"200": "TypesFreeformResponse",
|
||||
"400": "TypesError",
|
||||
"401": "TypesError",
|
||||
"404": "TypesError",
|
||||
"500": "TypesError",
|
||||
'200': "TypesFreeformResponse",
|
||||
'400': "TypesError",
|
||||
'401': "TypesError",
|
||||
'404': "TypesError",
|
||||
'500': "TypesError",
|
||||
}
|
||||
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
_request_timeout=_request_timeout
|
||||
)
|
||||
response_data.read()
|
||||
return self.api_client.response_deserialize(
|
||||
response_data=response_data,
|
||||
response_types_map=_response_types_map,
|
||||
)
|
||||
|
||||
|
||||
@validate_call
|
||||
def v1_task_task_id_freeform_post_without_preload_content(
|
||||
self,
|
||||
@@ -182,7 +197,10 @@ class FreeformApi:
|
||||
_request_timeout: Union[
|
||||
None,
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
|
||||
Tuple[
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Annotated[StrictFloat, Field(gt=0)]
|
||||
]
|
||||
] = None,
|
||||
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
||||
_content_type: Optional[StrictStr] = None,
|
||||
@@ -217,7 +235,7 @@ class FreeformApi:
|
||||
in the spec for a single request.
|
||||
:type _host_index: int, optional
|
||||
:return: Returns the result object.
|
||||
""" # noqa: E501
|
||||
""" # noqa: E501
|
||||
|
||||
_param = self._v1_task_task_id_freeform_post_serialize(
|
||||
task_id=task_id,
|
||||
@@ -225,19 +243,23 @@ class FreeformApi:
|
||||
_request_auth=_request_auth,
|
||||
_content_type=_content_type,
|
||||
_headers=_headers,
|
||||
_host_index=_host_index,
|
||||
_host_index=_host_index
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
"200": "TypesFreeformResponse",
|
||||
"400": "TypesError",
|
||||
"401": "TypesError",
|
||||
"404": "TypesError",
|
||||
"500": "TypesError",
|
||||
'200': "TypesFreeformResponse",
|
||||
'400': "TypesError",
|
||||
'401': "TypesError",
|
||||
'404': "TypesError",
|
||||
'500': "TypesError",
|
||||
}
|
||||
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
_request_timeout=_request_timeout
|
||||
)
|
||||
return response_data.response
|
||||
|
||||
|
||||
def _v1_task_task_id_freeform_post_serialize(
|
||||
self,
|
||||
task_id,
|
||||
@@ -250,18 +272,21 @@ class FreeformApi:
|
||||
|
||||
_host = None
|
||||
|
||||
_collection_formats: Dict[str, str] = {}
|
||||
_collection_formats: Dict[str, str] = {
|
||||
}
|
||||
|
||||
_path_params: Dict[str, str] = {}
|
||||
_query_params: List[Tuple[str, str]] = []
|
||||
_header_params: Dict[str, Optional[str]] = _headers or {}
|
||||
_form_params: List[Tuple[str, str]] = []
|
||||
_files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
|
||||
_files: Dict[
|
||||
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
||||
] = {}
|
||||
_body_params: Optional[bytes] = None
|
||||
|
||||
# process the path parameters
|
||||
if task_id is not None:
|
||||
_path_params["task_id"] = task_id
|
||||
_path_params['task_id'] = task_id
|
||||
# process the query parameters
|
||||
# process the header parameters
|
||||
# process the form parameters
|
||||
@@ -269,24 +294,37 @@ class FreeformApi:
|
||||
if payload is not None:
|
||||
_body_params = payload
|
||||
|
||||
|
||||
# set the HTTP header `Accept`
|
||||
if "Accept" not in _header_params:
|
||||
_header_params["Accept"] = self.api_client.select_header_accept(["application/json"])
|
||||
if 'Accept' not in _header_params:
|
||||
_header_params['Accept'] = self.api_client.select_header_accept(
|
||||
[
|
||||
'application/json'
|
||||
]
|
||||
)
|
||||
|
||||
# set the HTTP header `Content-Type`
|
||||
if _content_type:
|
||||
_header_params["Content-Type"] = _content_type
|
||||
_header_params['Content-Type'] = _content_type
|
||||
else:
|
||||
_default_content_type = self.api_client.select_header_content_type(["application/json"])
|
||||
_default_content_type = (
|
||||
self.api_client.select_header_content_type(
|
||||
[
|
||||
'application/json'
|
||||
]
|
||||
)
|
||||
)
|
||||
if _default_content_type is not None:
|
||||
_header_params["Content-Type"] = _default_content_type
|
||||
_header_params['Content-Type'] = _default_content_type
|
||||
|
||||
# authentication setting
|
||||
_auth_settings: List[str] = ["BasicAuth"]
|
||||
_auth_settings: List[str] = [
|
||||
'BasicAuth'
|
||||
]
|
||||
|
||||
return self.api_client.param_serialize(
|
||||
method="POST",
|
||||
resource_path="/v1/task/{task_id}/freeform/",
|
||||
method='POST',
|
||||
resource_path='/v1/task/{task_id}/freeform/',
|
||||
path_params=_path_params,
|
||||
query_params=_query_params,
|
||||
header_params=_header_params,
|
||||
@@ -296,5 +334,7 @@ class FreeformApi:
|
||||
auth_settings=_auth_settings,
|
||||
collection_formats=_collection_formats,
|
||||
_host=_host,
|
||||
_request_auth=_request_auth,
|
||||
_request_auth=_request_auth
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Example Competition API
|
||||
Example Competition API
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: 1.4.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
The version of the OpenAPI document: 1.4.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
import warnings
|
||||
@@ -19,9 +19,7 @@ from typing_extensions import Annotated
|
||||
from pydantic import Field, StrictStr
|
||||
from typing_extensions import Annotated
|
||||
from buttercup.orchestrator.competition_api_client.models.types_patch_submission import TypesPatchSubmission
|
||||
from buttercup.orchestrator.competition_api_client.models.types_patch_submission_response import (
|
||||
TypesPatchSubmissionResponse,
|
||||
)
|
||||
from buttercup.orchestrator.competition_api_client.models.types_patch_submission_response import TypesPatchSubmissionResponse
|
||||
|
||||
from buttercup.orchestrator.competition_api_client.api_client import ApiClient, RequestSerialized
|
||||
from buttercup.orchestrator.competition_api_client.api_response import ApiResponse
|
||||
@@ -40,6 +38,7 @@ class PatchApi:
|
||||
api_client = ApiClient.get_default()
|
||||
self.api_client = api_client
|
||||
|
||||
|
||||
@validate_call
|
||||
def v1_task_task_id_patch_patch_id_get(
|
||||
self,
|
||||
@@ -48,7 +47,10 @@ class PatchApi:
|
||||
_request_timeout: Union[
|
||||
None,
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
|
||||
Tuple[
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Annotated[StrictFloat, Field(gt=0)]
|
||||
]
|
||||
] = None,
|
||||
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
||||
_content_type: Optional[StrictStr] = None,
|
||||
@@ -83,7 +85,7 @@ class PatchApi:
|
||||
in the spec for a single request.
|
||||
:type _host_index: int, optional
|
||||
:return: Returns the result object.
|
||||
""" # noqa: E501
|
||||
""" # noqa: E501
|
||||
|
||||
_param = self._v1_task_task_id_patch_patch_id_get_serialize(
|
||||
task_id=task_id,
|
||||
@@ -91,23 +93,27 @@ class PatchApi:
|
||||
_request_auth=_request_auth,
|
||||
_content_type=_content_type,
|
||||
_headers=_headers,
|
||||
_host_index=_host_index,
|
||||
_host_index=_host_index
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
"200": "TypesPatchSubmissionResponse",
|
||||
"400": "TypesError",
|
||||
"401": "TypesError",
|
||||
"404": "TypesError",
|
||||
"500": "TypesError",
|
||||
'200': "TypesPatchSubmissionResponse",
|
||||
'400': "TypesError",
|
||||
'401': "TypesError",
|
||||
'404': "TypesError",
|
||||
'500': "TypesError",
|
||||
}
|
||||
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
_request_timeout=_request_timeout
|
||||
)
|
||||
response_data.read()
|
||||
return self.api_client.response_deserialize(
|
||||
response_data=response_data,
|
||||
response_types_map=_response_types_map,
|
||||
).data
|
||||
|
||||
|
||||
@validate_call
|
||||
def v1_task_task_id_patch_patch_id_get_with_http_info(
|
||||
self,
|
||||
@@ -116,7 +122,10 @@ class PatchApi:
|
||||
_request_timeout: Union[
|
||||
None,
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
|
||||
Tuple[
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Annotated[StrictFloat, Field(gt=0)]
|
||||
]
|
||||
] = None,
|
||||
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
||||
_content_type: Optional[StrictStr] = None,
|
||||
@@ -151,7 +160,7 @@ class PatchApi:
|
||||
in the spec for a single request.
|
||||
:type _host_index: int, optional
|
||||
:return: Returns the result object.
|
||||
""" # noqa: E501
|
||||
""" # noqa: E501
|
||||
|
||||
_param = self._v1_task_task_id_patch_patch_id_get_serialize(
|
||||
task_id=task_id,
|
||||
@@ -159,23 +168,27 @@ class PatchApi:
|
||||
_request_auth=_request_auth,
|
||||
_content_type=_content_type,
|
||||
_headers=_headers,
|
||||
_host_index=_host_index,
|
||||
_host_index=_host_index
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
"200": "TypesPatchSubmissionResponse",
|
||||
"400": "TypesError",
|
||||
"401": "TypesError",
|
||||
"404": "TypesError",
|
||||
"500": "TypesError",
|
||||
'200': "TypesPatchSubmissionResponse",
|
||||
'400': "TypesError",
|
||||
'401': "TypesError",
|
||||
'404': "TypesError",
|
||||
'500': "TypesError",
|
||||
}
|
||||
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
_request_timeout=_request_timeout
|
||||
)
|
||||
response_data.read()
|
||||
return self.api_client.response_deserialize(
|
||||
response_data=response_data,
|
||||
response_types_map=_response_types_map,
|
||||
)
|
||||
|
||||
|
||||
@validate_call
|
||||
def v1_task_task_id_patch_patch_id_get_without_preload_content(
|
||||
self,
|
||||
@@ -184,7 +197,10 @@ class PatchApi:
|
||||
_request_timeout: Union[
|
||||
None,
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
|
||||
Tuple[
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Annotated[StrictFloat, Field(gt=0)]
|
||||
]
|
||||
] = None,
|
||||
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
||||
_content_type: Optional[StrictStr] = None,
|
||||
@@ -219,7 +235,7 @@ class PatchApi:
|
||||
in the spec for a single request.
|
||||
:type _host_index: int, optional
|
||||
:return: Returns the result object.
|
||||
""" # noqa: E501
|
||||
""" # noqa: E501
|
||||
|
||||
_param = self._v1_task_task_id_patch_patch_id_get_serialize(
|
||||
task_id=task_id,
|
||||
@@ -227,19 +243,23 @@ class PatchApi:
|
||||
_request_auth=_request_auth,
|
||||
_content_type=_content_type,
|
||||
_headers=_headers,
|
||||
_host_index=_host_index,
|
||||
_host_index=_host_index
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
"200": "TypesPatchSubmissionResponse",
|
||||
"400": "TypesError",
|
||||
"401": "TypesError",
|
||||
"404": "TypesError",
|
||||
"500": "TypesError",
|
||||
'200': "TypesPatchSubmissionResponse",
|
||||
'400': "TypesError",
|
||||
'401': "TypesError",
|
||||
'404': "TypesError",
|
||||
'500': "TypesError",
|
||||
}
|
||||
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
_request_timeout=_request_timeout
|
||||
)
|
||||
return response_data.response
|
||||
|
||||
|
||||
def _v1_task_task_id_patch_patch_id_get_serialize(
|
||||
self,
|
||||
task_id,
|
||||
@@ -252,35 +272,46 @@ class PatchApi:
|
||||
|
||||
_host = None
|
||||
|
||||
_collection_formats: Dict[str, str] = {}
|
||||
_collection_formats: Dict[str, str] = {
|
||||
}
|
||||
|
||||
_path_params: Dict[str, str] = {}
|
||||
_query_params: List[Tuple[str, str]] = []
|
||||
_header_params: Dict[str, Optional[str]] = _headers or {}
|
||||
_form_params: List[Tuple[str, str]] = []
|
||||
_files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
|
||||
_files: Dict[
|
||||
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
||||
] = {}
|
||||
_body_params: Optional[bytes] = None
|
||||
|
||||
# process the path parameters
|
||||
if task_id is not None:
|
||||
_path_params["task_id"] = task_id
|
||||
_path_params['task_id'] = task_id
|
||||
if patch_id is not None:
|
||||
_path_params["patch_id"] = patch_id
|
||||
_path_params['patch_id'] = patch_id
|
||||
# process the query parameters
|
||||
# process the header parameters
|
||||
# process the form parameters
|
||||
# process the body parameter
|
||||
|
||||
|
||||
# set the HTTP header `Accept`
|
||||
if "Accept" not in _header_params:
|
||||
_header_params["Accept"] = self.api_client.select_header_accept(["application/json"])
|
||||
if 'Accept' not in _header_params:
|
||||
_header_params['Accept'] = self.api_client.select_header_accept(
|
||||
[
|
||||
'application/json'
|
||||
]
|
||||
)
|
||||
|
||||
|
||||
# authentication setting
|
||||
_auth_settings: List[str] = ["BasicAuth"]
|
||||
_auth_settings: List[str] = [
|
||||
'BasicAuth'
|
||||
]
|
||||
|
||||
return self.api_client.param_serialize(
|
||||
method="GET",
|
||||
resource_path="/v1/task/{task_id}/patch/{patch_id}/",
|
||||
method='GET',
|
||||
resource_path='/v1/task/{task_id}/patch/{patch_id}/',
|
||||
path_params=_path_params,
|
||||
query_params=_query_params,
|
||||
header_params=_header_params,
|
||||
@@ -290,9 +321,12 @@ class PatchApi:
|
||||
auth_settings=_auth_settings,
|
||||
collection_formats=_collection_formats,
|
||||
_host=_host,
|
||||
_request_auth=_request_auth,
|
||||
_request_auth=_request_auth
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
@validate_call
|
||||
def v1_task_task_id_patch_post(
|
||||
self,
|
||||
@@ -301,7 +335,10 @@ class PatchApi:
|
||||
_request_timeout: Union[
|
||||
None,
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
|
||||
Tuple[
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Annotated[StrictFloat, Field(gt=0)]
|
||||
]
|
||||
] = None,
|
||||
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
||||
_content_type: Optional[StrictStr] = None,
|
||||
@@ -336,7 +373,7 @@ class PatchApi:
|
||||
in the spec for a single request.
|
||||
:type _host_index: int, optional
|
||||
:return: Returns the result object.
|
||||
""" # noqa: E501
|
||||
""" # noqa: E501
|
||||
|
||||
_param = self._v1_task_task_id_patch_post_serialize(
|
||||
task_id=task_id,
|
||||
@@ -344,23 +381,27 @@ class PatchApi:
|
||||
_request_auth=_request_auth,
|
||||
_content_type=_content_type,
|
||||
_headers=_headers,
|
||||
_host_index=_host_index,
|
||||
_host_index=_host_index
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
"200": "TypesPatchSubmissionResponse",
|
||||
"400": "TypesError",
|
||||
"401": "TypesError",
|
||||
"404": "TypesError",
|
||||
"500": "TypesError",
|
||||
'200': "TypesPatchSubmissionResponse",
|
||||
'400': "TypesError",
|
||||
'401': "TypesError",
|
||||
'404': "TypesError",
|
||||
'500': "TypesError",
|
||||
}
|
||||
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
_request_timeout=_request_timeout
|
||||
)
|
||||
response_data.read()
|
||||
return self.api_client.response_deserialize(
|
||||
response_data=response_data,
|
||||
response_types_map=_response_types_map,
|
||||
).data
|
||||
|
||||
|
||||
@validate_call
|
||||
def v1_task_task_id_patch_post_with_http_info(
|
||||
self,
|
||||
@@ -369,7 +410,10 @@ class PatchApi:
|
||||
_request_timeout: Union[
|
||||
None,
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
|
||||
Tuple[
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Annotated[StrictFloat, Field(gt=0)]
|
||||
]
|
||||
] = None,
|
||||
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
||||
_content_type: Optional[StrictStr] = None,
|
||||
@@ -404,7 +448,7 @@ class PatchApi:
|
||||
in the spec for a single request.
|
||||
:type _host_index: int, optional
|
||||
:return: Returns the result object.
|
||||
""" # noqa: E501
|
||||
""" # noqa: E501
|
||||
|
||||
_param = self._v1_task_task_id_patch_post_serialize(
|
||||
task_id=task_id,
|
||||
@@ -412,23 +456,27 @@ class PatchApi:
|
||||
_request_auth=_request_auth,
|
||||
_content_type=_content_type,
|
||||
_headers=_headers,
|
||||
_host_index=_host_index,
|
||||
_host_index=_host_index
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
"200": "TypesPatchSubmissionResponse",
|
||||
"400": "TypesError",
|
||||
"401": "TypesError",
|
||||
"404": "TypesError",
|
||||
"500": "TypesError",
|
||||
'200': "TypesPatchSubmissionResponse",
|
||||
'400': "TypesError",
|
||||
'401': "TypesError",
|
||||
'404': "TypesError",
|
||||
'500': "TypesError",
|
||||
}
|
||||
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
_request_timeout=_request_timeout
|
||||
)
|
||||
response_data.read()
|
||||
return self.api_client.response_deserialize(
|
||||
response_data=response_data,
|
||||
response_types_map=_response_types_map,
|
||||
)
|
||||
|
||||
|
||||
@validate_call
|
||||
def v1_task_task_id_patch_post_without_preload_content(
|
||||
self,
|
||||
@@ -437,7 +485,10 @@ class PatchApi:
|
||||
_request_timeout: Union[
|
||||
None,
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
|
||||
Tuple[
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Annotated[StrictFloat, Field(gt=0)]
|
||||
]
|
||||
] = None,
|
||||
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
||||
_content_type: Optional[StrictStr] = None,
|
||||
@@ -472,7 +523,7 @@ class PatchApi:
|
||||
in the spec for a single request.
|
||||
:type _host_index: int, optional
|
||||
:return: Returns the result object.
|
||||
""" # noqa: E501
|
||||
""" # noqa: E501
|
||||
|
||||
_param = self._v1_task_task_id_patch_post_serialize(
|
||||
task_id=task_id,
|
||||
@@ -480,19 +531,23 @@ class PatchApi:
|
||||
_request_auth=_request_auth,
|
||||
_content_type=_content_type,
|
||||
_headers=_headers,
|
||||
_host_index=_host_index,
|
||||
_host_index=_host_index
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
"200": "TypesPatchSubmissionResponse",
|
||||
"400": "TypesError",
|
||||
"401": "TypesError",
|
||||
"404": "TypesError",
|
||||
"500": "TypesError",
|
||||
'200': "TypesPatchSubmissionResponse",
|
||||
'400': "TypesError",
|
||||
'401': "TypesError",
|
||||
'404': "TypesError",
|
||||
'500': "TypesError",
|
||||
}
|
||||
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
_request_timeout=_request_timeout
|
||||
)
|
||||
return response_data.response
|
||||
|
||||
|
||||
def _v1_task_task_id_patch_post_serialize(
|
||||
self,
|
||||
task_id,
|
||||
@@ -505,18 +560,21 @@ class PatchApi:
|
||||
|
||||
_host = None
|
||||
|
||||
_collection_formats: Dict[str, str] = {}
|
||||
_collection_formats: Dict[str, str] = {
|
||||
}
|
||||
|
||||
_path_params: Dict[str, str] = {}
|
||||
_query_params: List[Tuple[str, str]] = []
|
||||
_header_params: Dict[str, Optional[str]] = _headers or {}
|
||||
_form_params: List[Tuple[str, str]] = []
|
||||
_files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
|
||||
_files: Dict[
|
||||
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
||||
] = {}
|
||||
_body_params: Optional[bytes] = None
|
||||
|
||||
# process the path parameters
|
||||
if task_id is not None:
|
||||
_path_params["task_id"] = task_id
|
||||
_path_params['task_id'] = task_id
|
||||
# process the query parameters
|
||||
# process the header parameters
|
||||
# process the form parameters
|
||||
@@ -524,24 +582,37 @@ class PatchApi:
|
||||
if payload is not None:
|
||||
_body_params = payload
|
||||
|
||||
|
||||
# set the HTTP header `Accept`
|
||||
if "Accept" not in _header_params:
|
||||
_header_params["Accept"] = self.api_client.select_header_accept(["application/json"])
|
||||
if 'Accept' not in _header_params:
|
||||
_header_params['Accept'] = self.api_client.select_header_accept(
|
||||
[
|
||||
'application/json'
|
||||
]
|
||||
)
|
||||
|
||||
# set the HTTP header `Content-Type`
|
||||
if _content_type:
|
||||
_header_params["Content-Type"] = _content_type
|
||||
_header_params['Content-Type'] = _content_type
|
||||
else:
|
||||
_default_content_type = self.api_client.select_header_content_type(["application/json"])
|
||||
_default_content_type = (
|
||||
self.api_client.select_header_content_type(
|
||||
[
|
||||
'application/json'
|
||||
]
|
||||
)
|
||||
)
|
||||
if _default_content_type is not None:
|
||||
_header_params["Content-Type"] = _default_content_type
|
||||
_header_params['Content-Type'] = _default_content_type
|
||||
|
||||
# authentication setting
|
||||
_auth_settings: List[str] = ["BasicAuth"]
|
||||
_auth_settings: List[str] = [
|
||||
'BasicAuth'
|
||||
]
|
||||
|
||||
return self.api_client.param_serialize(
|
||||
method="POST",
|
||||
resource_path="/v1/task/{task_id}/patch/",
|
||||
method='POST',
|
||||
resource_path='/v1/task/{task_id}/patch/',
|
||||
path_params=_path_params,
|
||||
query_params=_query_params,
|
||||
header_params=_header_params,
|
||||
@@ -551,5 +622,7 @@ class PatchApi:
|
||||
auth_settings=_auth_settings,
|
||||
collection_formats=_collection_formats,
|
||||
_host=_host,
|
||||
_request_auth=_request_auth,
|
||||
_request_auth=_request_auth
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Example Competition API
|
||||
Example Competition API
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: 1.4.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
The version of the OpenAPI document: 1.4.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
import warnings
|
||||
@@ -35,13 +35,17 @@ class PingApi:
|
||||
api_client = ApiClient.get_default()
|
||||
self.api_client = api_client
|
||||
|
||||
|
||||
@validate_call
|
||||
def v1_ping_get(
|
||||
self,
|
||||
_request_timeout: Union[
|
||||
None,
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
|
||||
Tuple[
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Annotated[StrictFloat, Field(gt=0)]
|
||||
]
|
||||
] = None,
|
||||
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
||||
_content_type: Optional[StrictStr] = None,
|
||||
@@ -72,29 +76,39 @@ class PingApi:
|
||||
in the spec for a single request.
|
||||
:type _host_index: int, optional
|
||||
:return: Returns the result object.
|
||||
""" # noqa: E501
|
||||
""" # noqa: E501
|
||||
|
||||
_param = self._v1_ping_get_serialize(
|
||||
_request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index
|
||||
_request_auth=_request_auth,
|
||||
_content_type=_content_type,
|
||||
_headers=_headers,
|
||||
_host_index=_host_index
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
"200": "TypesPingResponse",
|
||||
'200': "TypesPingResponse",
|
||||
}
|
||||
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
_request_timeout=_request_timeout
|
||||
)
|
||||
response_data.read()
|
||||
return self.api_client.response_deserialize(
|
||||
response_data=response_data,
|
||||
response_types_map=_response_types_map,
|
||||
).data
|
||||
|
||||
|
||||
@validate_call
|
||||
def v1_ping_get_with_http_info(
|
||||
self,
|
||||
_request_timeout: Union[
|
||||
None,
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
|
||||
Tuple[
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Annotated[StrictFloat, Field(gt=0)]
|
||||
]
|
||||
] = None,
|
||||
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
||||
_content_type: Optional[StrictStr] = None,
|
||||
@@ -125,29 +139,39 @@ class PingApi:
|
||||
in the spec for a single request.
|
||||
:type _host_index: int, optional
|
||||
:return: Returns the result object.
|
||||
""" # noqa: E501
|
||||
""" # noqa: E501
|
||||
|
||||
_param = self._v1_ping_get_serialize(
|
||||
_request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index
|
||||
_request_auth=_request_auth,
|
||||
_content_type=_content_type,
|
||||
_headers=_headers,
|
||||
_host_index=_host_index
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
"200": "TypesPingResponse",
|
||||
'200': "TypesPingResponse",
|
||||
}
|
||||
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
_request_timeout=_request_timeout
|
||||
)
|
||||
response_data.read()
|
||||
return self.api_client.response_deserialize(
|
||||
response_data=response_data,
|
||||
response_types_map=_response_types_map,
|
||||
)
|
||||
|
||||
|
||||
@validate_call
|
||||
def v1_ping_get_without_preload_content(
|
||||
self,
|
||||
_request_timeout: Union[
|
||||
None,
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
|
||||
Tuple[
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Annotated[StrictFloat, Field(gt=0)]
|
||||
]
|
||||
] = None,
|
||||
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
||||
_content_type: Optional[StrictStr] = None,
|
||||
@@ -178,18 +202,25 @@ class PingApi:
|
||||
in the spec for a single request.
|
||||
:type _host_index: int, optional
|
||||
:return: Returns the result object.
|
||||
""" # noqa: E501
|
||||
""" # noqa: E501
|
||||
|
||||
_param = self._v1_ping_get_serialize(
|
||||
_request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index
|
||||
_request_auth=_request_auth,
|
||||
_content_type=_content_type,
|
||||
_headers=_headers,
|
||||
_host_index=_host_index
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
"200": "TypesPingResponse",
|
||||
'200': "TypesPingResponse",
|
||||
}
|
||||
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
_request_timeout=_request_timeout
|
||||
)
|
||||
return response_data.response
|
||||
|
||||
|
||||
def _v1_ping_get_serialize(
|
||||
self,
|
||||
_request_auth,
|
||||
@@ -200,13 +231,16 @@ class PingApi:
|
||||
|
||||
_host = None
|
||||
|
||||
_collection_formats: Dict[str, str] = {}
|
||||
_collection_formats: Dict[str, str] = {
|
||||
}
|
||||
|
||||
_path_params: Dict[str, str] = {}
|
||||
_query_params: List[Tuple[str, str]] = []
|
||||
_header_params: Dict[str, Optional[str]] = _headers or {}
|
||||
_form_params: List[Tuple[str, str]] = []
|
||||
_files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
|
||||
_files: Dict[
|
||||
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
||||
] = {}
|
||||
_body_params: Optional[bytes] = None
|
||||
|
||||
# process the path parameters
|
||||
@@ -215,16 +249,24 @@ class PingApi:
|
||||
# process the form parameters
|
||||
# process the body parameter
|
||||
|
||||
|
||||
# set the HTTP header `Accept`
|
||||
if "Accept" not in _header_params:
|
||||
_header_params["Accept"] = self.api_client.select_header_accept(["*/*"])
|
||||
if 'Accept' not in _header_params:
|
||||
_header_params['Accept'] = self.api_client.select_header_accept(
|
||||
[
|
||||
'*/*'
|
||||
]
|
||||
)
|
||||
|
||||
|
||||
# authentication setting
|
||||
_auth_settings: List[str] = ["BasicAuth"]
|
||||
_auth_settings: List[str] = [
|
||||
'BasicAuth'
|
||||
]
|
||||
|
||||
return self.api_client.param_serialize(
|
||||
method="GET",
|
||||
resource_path="/v1/ping/",
|
||||
method='GET',
|
||||
resource_path='/v1/ping/',
|
||||
path_params=_path_params,
|
||||
query_params=_query_params,
|
||||
header_params=_header_params,
|
||||
@@ -234,5 +276,7 @@ class PingApi:
|
||||
auth_settings=_auth_settings,
|
||||
collection_formats=_collection_formats,
|
||||
_host=_host,
|
||||
_request_auth=_request_auth,
|
||||
_request_auth=_request_auth
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Example Competition API
|
||||
Example Competition API
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: 1.4.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
The version of the OpenAPI document: 1.4.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
import warnings
|
||||
@@ -19,9 +19,7 @@ from typing_extensions import Annotated
|
||||
from pydantic import Field, StrictStr
|
||||
from typing_extensions import Annotated
|
||||
from buttercup.orchestrator.competition_api_client.models.types_pov_submission import TypesPOVSubmission
|
||||
from buttercup.orchestrator.competition_api_client.models.types_pov_submission_response import (
|
||||
TypesPOVSubmissionResponse,
|
||||
)
|
||||
from buttercup.orchestrator.competition_api_client.models.types_pov_submission_response import TypesPOVSubmissionResponse
|
||||
|
||||
from buttercup.orchestrator.competition_api_client.api_client import ApiClient, RequestSerialized
|
||||
from buttercup.orchestrator.competition_api_client.api_response import ApiResponse
|
||||
@@ -40,6 +38,7 @@ class PovApi:
|
||||
api_client = ApiClient.get_default()
|
||||
self.api_client = api_client
|
||||
|
||||
|
||||
@validate_call
|
||||
def v1_task_task_id_pov_post(
|
||||
self,
|
||||
@@ -48,7 +47,10 @@ class PovApi:
|
||||
_request_timeout: Union[
|
||||
None,
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
|
||||
Tuple[
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Annotated[StrictFloat, Field(gt=0)]
|
||||
]
|
||||
] = None,
|
||||
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
||||
_content_type: Optional[StrictStr] = None,
|
||||
@@ -83,7 +85,7 @@ class PovApi:
|
||||
in the spec for a single request.
|
||||
:type _host_index: int, optional
|
||||
:return: Returns the result object.
|
||||
""" # noqa: E501
|
||||
""" # noqa: E501
|
||||
|
||||
_param = self._v1_task_task_id_pov_post_serialize(
|
||||
task_id=task_id,
|
||||
@@ -91,23 +93,27 @@ class PovApi:
|
||||
_request_auth=_request_auth,
|
||||
_content_type=_content_type,
|
||||
_headers=_headers,
|
||||
_host_index=_host_index,
|
||||
_host_index=_host_index
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
"200": "TypesPOVSubmissionResponse",
|
||||
"400": "TypesError",
|
||||
"401": "TypesError",
|
||||
"404": "TypesError",
|
||||
"500": "TypesError",
|
||||
'200': "TypesPOVSubmissionResponse",
|
||||
'400': "TypesError",
|
||||
'401': "TypesError",
|
||||
'404': "TypesError",
|
||||
'500': "TypesError",
|
||||
}
|
||||
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
_request_timeout=_request_timeout
|
||||
)
|
||||
response_data.read()
|
||||
return self.api_client.response_deserialize(
|
||||
response_data=response_data,
|
||||
response_types_map=_response_types_map,
|
||||
).data
|
||||
|
||||
|
||||
@validate_call
|
||||
def v1_task_task_id_pov_post_with_http_info(
|
||||
self,
|
||||
@@ -116,7 +122,10 @@ class PovApi:
|
||||
_request_timeout: Union[
|
||||
None,
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
|
||||
Tuple[
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Annotated[StrictFloat, Field(gt=0)]
|
||||
]
|
||||
] = None,
|
||||
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
||||
_content_type: Optional[StrictStr] = None,
|
||||
@@ -151,7 +160,7 @@ class PovApi:
|
||||
in the spec for a single request.
|
||||
:type _host_index: int, optional
|
||||
:return: Returns the result object.
|
||||
""" # noqa: E501
|
||||
""" # noqa: E501
|
||||
|
||||
_param = self._v1_task_task_id_pov_post_serialize(
|
||||
task_id=task_id,
|
||||
@@ -159,23 +168,27 @@ class PovApi:
|
||||
_request_auth=_request_auth,
|
||||
_content_type=_content_type,
|
||||
_headers=_headers,
|
||||
_host_index=_host_index,
|
||||
_host_index=_host_index
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
"200": "TypesPOVSubmissionResponse",
|
||||
"400": "TypesError",
|
||||
"401": "TypesError",
|
||||
"404": "TypesError",
|
||||
"500": "TypesError",
|
||||
'200': "TypesPOVSubmissionResponse",
|
||||
'400': "TypesError",
|
||||
'401': "TypesError",
|
||||
'404': "TypesError",
|
||||
'500': "TypesError",
|
||||
}
|
||||
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
_request_timeout=_request_timeout
|
||||
)
|
||||
response_data.read()
|
||||
return self.api_client.response_deserialize(
|
||||
response_data=response_data,
|
||||
response_types_map=_response_types_map,
|
||||
)
|
||||
|
||||
|
||||
@validate_call
|
||||
def v1_task_task_id_pov_post_without_preload_content(
|
||||
self,
|
||||
@@ -184,7 +197,10 @@ class PovApi:
|
||||
_request_timeout: Union[
|
||||
None,
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
|
||||
Tuple[
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Annotated[StrictFloat, Field(gt=0)]
|
||||
]
|
||||
] = None,
|
||||
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
||||
_content_type: Optional[StrictStr] = None,
|
||||
@@ -219,7 +235,7 @@ class PovApi:
|
||||
in the spec for a single request.
|
||||
:type _host_index: int, optional
|
||||
:return: Returns the result object.
|
||||
""" # noqa: E501
|
||||
""" # noqa: E501
|
||||
|
||||
_param = self._v1_task_task_id_pov_post_serialize(
|
||||
task_id=task_id,
|
||||
@@ -227,19 +243,23 @@ class PovApi:
|
||||
_request_auth=_request_auth,
|
||||
_content_type=_content_type,
|
||||
_headers=_headers,
|
||||
_host_index=_host_index,
|
||||
_host_index=_host_index
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
"200": "TypesPOVSubmissionResponse",
|
||||
"400": "TypesError",
|
||||
"401": "TypesError",
|
||||
"404": "TypesError",
|
||||
"500": "TypesError",
|
||||
'200': "TypesPOVSubmissionResponse",
|
||||
'400': "TypesError",
|
||||
'401': "TypesError",
|
||||
'404': "TypesError",
|
||||
'500': "TypesError",
|
||||
}
|
||||
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
_request_timeout=_request_timeout
|
||||
)
|
||||
return response_data.response
|
||||
|
||||
|
||||
def _v1_task_task_id_pov_post_serialize(
|
||||
self,
|
||||
task_id,
|
||||
@@ -252,18 +272,21 @@ class PovApi:
|
||||
|
||||
_host = None
|
||||
|
||||
_collection_formats: Dict[str, str] = {}
|
||||
_collection_formats: Dict[str, str] = {
|
||||
}
|
||||
|
||||
_path_params: Dict[str, str] = {}
|
||||
_query_params: List[Tuple[str, str]] = []
|
||||
_header_params: Dict[str, Optional[str]] = _headers or {}
|
||||
_form_params: List[Tuple[str, str]] = []
|
||||
_files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
|
||||
_files: Dict[
|
||||
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
||||
] = {}
|
||||
_body_params: Optional[bytes] = None
|
||||
|
||||
# process the path parameters
|
||||
if task_id is not None:
|
||||
_path_params["task_id"] = task_id
|
||||
_path_params['task_id'] = task_id
|
||||
# process the query parameters
|
||||
# process the header parameters
|
||||
# process the form parameters
|
||||
@@ -271,24 +294,37 @@ class PovApi:
|
||||
if payload is not None:
|
||||
_body_params = payload
|
||||
|
||||
|
||||
# set the HTTP header `Accept`
|
||||
if "Accept" not in _header_params:
|
||||
_header_params["Accept"] = self.api_client.select_header_accept(["application/json"])
|
||||
if 'Accept' not in _header_params:
|
||||
_header_params['Accept'] = self.api_client.select_header_accept(
|
||||
[
|
||||
'application/json'
|
||||
]
|
||||
)
|
||||
|
||||
# set the HTTP header `Content-Type`
|
||||
if _content_type:
|
||||
_header_params["Content-Type"] = _content_type
|
||||
_header_params['Content-Type'] = _content_type
|
||||
else:
|
||||
_default_content_type = self.api_client.select_header_content_type(["application/json"])
|
||||
_default_content_type = (
|
||||
self.api_client.select_header_content_type(
|
||||
[
|
||||
'application/json'
|
||||
]
|
||||
)
|
||||
)
|
||||
if _default_content_type is not None:
|
||||
_header_params["Content-Type"] = _default_content_type
|
||||
_header_params['Content-Type'] = _default_content_type
|
||||
|
||||
# authentication setting
|
||||
_auth_settings: List[str] = ["BasicAuth"]
|
||||
_auth_settings: List[str] = [
|
||||
'BasicAuth'
|
||||
]
|
||||
|
||||
return self.api_client.param_serialize(
|
||||
method="POST",
|
||||
resource_path="/v1/task/{task_id}/pov/",
|
||||
method='POST',
|
||||
resource_path='/v1/task/{task_id}/pov/',
|
||||
path_params=_path_params,
|
||||
query_params=_query_params,
|
||||
header_params=_header_params,
|
||||
@@ -298,9 +334,12 @@ class PovApi:
|
||||
auth_settings=_auth_settings,
|
||||
collection_formats=_collection_formats,
|
||||
_host=_host,
|
||||
_request_auth=_request_auth,
|
||||
_request_auth=_request_auth
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
@validate_call
|
||||
def v1_task_task_id_pov_pov_id_get(
|
||||
self,
|
||||
@@ -309,7 +348,10 @@ class PovApi:
|
||||
_request_timeout: Union[
|
||||
None,
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
|
||||
Tuple[
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Annotated[StrictFloat, Field(gt=0)]
|
||||
]
|
||||
] = None,
|
||||
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
||||
_content_type: Optional[StrictStr] = None,
|
||||
@@ -344,7 +386,7 @@ class PovApi:
|
||||
in the spec for a single request.
|
||||
:type _host_index: int, optional
|
||||
:return: Returns the result object.
|
||||
""" # noqa: E501
|
||||
""" # noqa: E501
|
||||
|
||||
_param = self._v1_task_task_id_pov_pov_id_get_serialize(
|
||||
task_id=task_id,
|
||||
@@ -352,23 +394,27 @@ class PovApi:
|
||||
_request_auth=_request_auth,
|
||||
_content_type=_content_type,
|
||||
_headers=_headers,
|
||||
_host_index=_host_index,
|
||||
_host_index=_host_index
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
"200": "TypesPOVSubmissionResponse",
|
||||
"400": "TypesError",
|
||||
"401": "TypesError",
|
||||
"404": "TypesError",
|
||||
"500": "TypesError",
|
||||
'200': "TypesPOVSubmissionResponse",
|
||||
'400': "TypesError",
|
||||
'401': "TypesError",
|
||||
'404': "TypesError",
|
||||
'500': "TypesError",
|
||||
}
|
||||
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
_request_timeout=_request_timeout
|
||||
)
|
||||
response_data.read()
|
||||
return self.api_client.response_deserialize(
|
||||
response_data=response_data,
|
||||
response_types_map=_response_types_map,
|
||||
).data
|
||||
|
||||
|
||||
@validate_call
|
||||
def v1_task_task_id_pov_pov_id_get_with_http_info(
|
||||
self,
|
||||
@@ -377,7 +423,10 @@ class PovApi:
|
||||
_request_timeout: Union[
|
||||
None,
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
|
||||
Tuple[
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Annotated[StrictFloat, Field(gt=0)]
|
||||
]
|
||||
] = None,
|
||||
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
||||
_content_type: Optional[StrictStr] = None,
|
||||
@@ -412,7 +461,7 @@ class PovApi:
|
||||
in the spec for a single request.
|
||||
:type _host_index: int, optional
|
||||
:return: Returns the result object.
|
||||
""" # noqa: E501
|
||||
""" # noqa: E501
|
||||
|
||||
_param = self._v1_task_task_id_pov_pov_id_get_serialize(
|
||||
task_id=task_id,
|
||||
@@ -420,23 +469,27 @@ class PovApi:
|
||||
_request_auth=_request_auth,
|
||||
_content_type=_content_type,
|
||||
_headers=_headers,
|
||||
_host_index=_host_index,
|
||||
_host_index=_host_index
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
"200": "TypesPOVSubmissionResponse",
|
||||
"400": "TypesError",
|
||||
"401": "TypesError",
|
||||
"404": "TypesError",
|
||||
"500": "TypesError",
|
||||
'200': "TypesPOVSubmissionResponse",
|
||||
'400': "TypesError",
|
||||
'401': "TypesError",
|
||||
'404': "TypesError",
|
||||
'500': "TypesError",
|
||||
}
|
||||
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
_request_timeout=_request_timeout
|
||||
)
|
||||
response_data.read()
|
||||
return self.api_client.response_deserialize(
|
||||
response_data=response_data,
|
||||
response_types_map=_response_types_map,
|
||||
)
|
||||
|
||||
|
||||
@validate_call
|
||||
def v1_task_task_id_pov_pov_id_get_without_preload_content(
|
||||
self,
|
||||
@@ -445,7 +498,10 @@ class PovApi:
|
||||
_request_timeout: Union[
|
||||
None,
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
|
||||
Tuple[
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Annotated[StrictFloat, Field(gt=0)]
|
||||
]
|
||||
] = None,
|
||||
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
||||
_content_type: Optional[StrictStr] = None,
|
||||
@@ -480,7 +536,7 @@ class PovApi:
|
||||
in the spec for a single request.
|
||||
:type _host_index: int, optional
|
||||
:return: Returns the result object.
|
||||
""" # noqa: E501
|
||||
""" # noqa: E501
|
||||
|
||||
_param = self._v1_task_task_id_pov_pov_id_get_serialize(
|
||||
task_id=task_id,
|
||||
@@ -488,19 +544,23 @@ class PovApi:
|
||||
_request_auth=_request_auth,
|
||||
_content_type=_content_type,
|
||||
_headers=_headers,
|
||||
_host_index=_host_index,
|
||||
_host_index=_host_index
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
"200": "TypesPOVSubmissionResponse",
|
||||
"400": "TypesError",
|
||||
"401": "TypesError",
|
||||
"404": "TypesError",
|
||||
"500": "TypesError",
|
||||
'200': "TypesPOVSubmissionResponse",
|
||||
'400': "TypesError",
|
||||
'401': "TypesError",
|
||||
'404': "TypesError",
|
||||
'500': "TypesError",
|
||||
}
|
||||
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
_request_timeout=_request_timeout
|
||||
)
|
||||
return response_data.response
|
||||
|
||||
|
||||
def _v1_task_task_id_pov_pov_id_get_serialize(
|
||||
self,
|
||||
task_id,
|
||||
@@ -513,35 +573,46 @@ class PovApi:
|
||||
|
||||
_host = None
|
||||
|
||||
_collection_formats: Dict[str, str] = {}
|
||||
_collection_formats: Dict[str, str] = {
|
||||
}
|
||||
|
||||
_path_params: Dict[str, str] = {}
|
||||
_query_params: List[Tuple[str, str]] = []
|
||||
_header_params: Dict[str, Optional[str]] = _headers or {}
|
||||
_form_params: List[Tuple[str, str]] = []
|
||||
_files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
|
||||
_files: Dict[
|
||||
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
||||
] = {}
|
||||
_body_params: Optional[bytes] = None
|
||||
|
||||
# process the path parameters
|
||||
if task_id is not None:
|
||||
_path_params["task_id"] = task_id
|
||||
_path_params['task_id'] = task_id
|
||||
if pov_id is not None:
|
||||
_path_params["pov_id"] = pov_id
|
||||
_path_params['pov_id'] = pov_id
|
||||
# process the query parameters
|
||||
# process the header parameters
|
||||
# process the form parameters
|
||||
# process the body parameter
|
||||
|
||||
|
||||
# set the HTTP header `Accept`
|
||||
if "Accept" not in _header_params:
|
||||
_header_params["Accept"] = self.api_client.select_header_accept(["application/json"])
|
||||
if 'Accept' not in _header_params:
|
||||
_header_params['Accept'] = self.api_client.select_header_accept(
|
||||
[
|
||||
'application/json'
|
||||
]
|
||||
)
|
||||
|
||||
|
||||
# authentication setting
|
||||
_auth_settings: List[str] = ["BasicAuth"]
|
||||
_auth_settings: List[str] = [
|
||||
'BasicAuth'
|
||||
]
|
||||
|
||||
return self.api_client.param_serialize(
|
||||
method="GET",
|
||||
resource_path="/v1/task/{task_id}/pov/{pov_id}/",
|
||||
method='GET',
|
||||
resource_path='/v1/task/{task_id}/pov/{pov_id}/',
|
||||
path_params=_path_params,
|
||||
query_params=_query_params,
|
||||
header_params=_header_params,
|
||||
@@ -551,5 +622,7 @@ class PovApi:
|
||||
auth_settings=_auth_settings,
|
||||
collection_formats=_collection_formats,
|
||||
_host=_host,
|
||||
_request_auth=_request_auth,
|
||||
_request_auth=_request_auth
|
||||
)
|
||||
|
||||
|
||||
|
||||
+163
-79
@@ -1,14 +1,14 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Example Competition API
|
||||
Example Competition API
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: 1.4.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
The version of the OpenAPI document: 1.4.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
import warnings
|
||||
@@ -39,6 +39,7 @@ class RequestApi:
|
||||
api_client = ApiClient.get_default()
|
||||
self.api_client = api_client
|
||||
|
||||
|
||||
@validate_call
|
||||
def v1_request_challenge_name_post(
|
||||
self,
|
||||
@@ -47,7 +48,10 @@ class RequestApi:
|
||||
_request_timeout: Union[
|
||||
None,
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
|
||||
Tuple[
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Annotated[StrictFloat, Field(gt=0)]
|
||||
]
|
||||
] = None,
|
||||
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
||||
_content_type: Optional[StrictStr] = None,
|
||||
@@ -82,7 +86,7 @@ class RequestApi:
|
||||
in the spec for a single request.
|
||||
:type _host_index: int, optional
|
||||
:return: Returns the result object.
|
||||
""" # noqa: E501
|
||||
""" # noqa: E501
|
||||
|
||||
_param = self._v1_request_challenge_name_post_serialize(
|
||||
challenge_name=challenge_name,
|
||||
@@ -90,23 +94,27 @@ class RequestApi:
|
||||
_request_auth=_request_auth,
|
||||
_content_type=_content_type,
|
||||
_headers=_headers,
|
||||
_host_index=_host_index,
|
||||
_host_index=_host_index
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
"200": "TypesMessage",
|
||||
"400": "TypesError",
|
||||
"401": "TypesError",
|
||||
"404": "TypesError",
|
||||
"500": "TypesError",
|
||||
'200': "TypesMessage",
|
||||
'400': "TypesError",
|
||||
'401': "TypesError",
|
||||
'404': "TypesError",
|
||||
'500': "TypesError",
|
||||
}
|
||||
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
_request_timeout=_request_timeout
|
||||
)
|
||||
response_data.read()
|
||||
return self.api_client.response_deserialize(
|
||||
response_data=response_data,
|
||||
response_types_map=_response_types_map,
|
||||
).data
|
||||
|
||||
|
||||
@validate_call
|
||||
def v1_request_challenge_name_post_with_http_info(
|
||||
self,
|
||||
@@ -115,7 +123,10 @@ class RequestApi:
|
||||
_request_timeout: Union[
|
||||
None,
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
|
||||
Tuple[
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Annotated[StrictFloat, Field(gt=0)]
|
||||
]
|
||||
] = None,
|
||||
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
||||
_content_type: Optional[StrictStr] = None,
|
||||
@@ -150,7 +161,7 @@ class RequestApi:
|
||||
in the spec for a single request.
|
||||
:type _host_index: int, optional
|
||||
:return: Returns the result object.
|
||||
""" # noqa: E501
|
||||
""" # noqa: E501
|
||||
|
||||
_param = self._v1_request_challenge_name_post_serialize(
|
||||
challenge_name=challenge_name,
|
||||
@@ -158,23 +169,27 @@ class RequestApi:
|
||||
_request_auth=_request_auth,
|
||||
_content_type=_content_type,
|
||||
_headers=_headers,
|
||||
_host_index=_host_index,
|
||||
_host_index=_host_index
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
"200": "TypesMessage",
|
||||
"400": "TypesError",
|
||||
"401": "TypesError",
|
||||
"404": "TypesError",
|
||||
"500": "TypesError",
|
||||
'200': "TypesMessage",
|
||||
'400': "TypesError",
|
||||
'401': "TypesError",
|
||||
'404': "TypesError",
|
||||
'500': "TypesError",
|
||||
}
|
||||
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
_request_timeout=_request_timeout
|
||||
)
|
||||
response_data.read()
|
||||
return self.api_client.response_deserialize(
|
||||
response_data=response_data,
|
||||
response_types_map=_response_types_map,
|
||||
)
|
||||
|
||||
|
||||
@validate_call
|
||||
def v1_request_challenge_name_post_without_preload_content(
|
||||
self,
|
||||
@@ -183,7 +198,10 @@ class RequestApi:
|
||||
_request_timeout: Union[
|
||||
None,
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
|
||||
Tuple[
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Annotated[StrictFloat, Field(gt=0)]
|
||||
]
|
||||
] = None,
|
||||
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
||||
_content_type: Optional[StrictStr] = None,
|
||||
@@ -218,7 +236,7 @@ class RequestApi:
|
||||
in the spec for a single request.
|
||||
:type _host_index: int, optional
|
||||
:return: Returns the result object.
|
||||
""" # noqa: E501
|
||||
""" # noqa: E501
|
||||
|
||||
_param = self._v1_request_challenge_name_post_serialize(
|
||||
challenge_name=challenge_name,
|
||||
@@ -226,19 +244,23 @@ class RequestApi:
|
||||
_request_auth=_request_auth,
|
||||
_content_type=_content_type,
|
||||
_headers=_headers,
|
||||
_host_index=_host_index,
|
||||
_host_index=_host_index
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
"200": "TypesMessage",
|
||||
"400": "TypesError",
|
||||
"401": "TypesError",
|
||||
"404": "TypesError",
|
||||
"500": "TypesError",
|
||||
'200': "TypesMessage",
|
||||
'400': "TypesError",
|
||||
'401': "TypesError",
|
||||
'404': "TypesError",
|
||||
'500': "TypesError",
|
||||
}
|
||||
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
_request_timeout=_request_timeout
|
||||
)
|
||||
return response_data.response
|
||||
|
||||
|
||||
def _v1_request_challenge_name_post_serialize(
|
||||
self,
|
||||
challenge_name,
|
||||
@@ -251,18 +273,21 @@ class RequestApi:
|
||||
|
||||
_host = None
|
||||
|
||||
_collection_formats: Dict[str, str] = {}
|
||||
_collection_formats: Dict[str, str] = {
|
||||
}
|
||||
|
||||
_path_params: Dict[str, str] = {}
|
||||
_query_params: List[Tuple[str, str]] = []
|
||||
_header_params: Dict[str, Optional[str]] = _headers or {}
|
||||
_form_params: List[Tuple[str, str]] = []
|
||||
_files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
|
||||
_files: Dict[
|
||||
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
||||
] = {}
|
||||
_body_params: Optional[bytes] = None
|
||||
|
||||
# process the path parameters
|
||||
if challenge_name is not None:
|
||||
_path_params["challenge_name"] = challenge_name
|
||||
_path_params['challenge_name'] = challenge_name
|
||||
# process the query parameters
|
||||
# process the header parameters
|
||||
# process the form parameters
|
||||
@@ -270,24 +295,37 @@ class RequestApi:
|
||||
if payload is not None:
|
||||
_body_params = payload
|
||||
|
||||
|
||||
# set the HTTP header `Accept`
|
||||
if "Accept" not in _header_params:
|
||||
_header_params["Accept"] = self.api_client.select_header_accept(["application/json"])
|
||||
if 'Accept' not in _header_params:
|
||||
_header_params['Accept'] = self.api_client.select_header_accept(
|
||||
[
|
||||
'application/json'
|
||||
]
|
||||
)
|
||||
|
||||
# set the HTTP header `Content-Type`
|
||||
if _content_type:
|
||||
_header_params["Content-Type"] = _content_type
|
||||
_header_params['Content-Type'] = _content_type
|
||||
else:
|
||||
_default_content_type = self.api_client.select_header_content_type(["application/json"])
|
||||
_default_content_type = (
|
||||
self.api_client.select_header_content_type(
|
||||
[
|
||||
'application/json'
|
||||
]
|
||||
)
|
||||
)
|
||||
if _default_content_type is not None:
|
||||
_header_params["Content-Type"] = _default_content_type
|
||||
_header_params['Content-Type'] = _default_content_type
|
||||
|
||||
# authentication setting
|
||||
_auth_settings: List[str] = ["BasicAuth"]
|
||||
_auth_settings: List[str] = [
|
||||
'BasicAuth'
|
||||
]
|
||||
|
||||
return self.api_client.param_serialize(
|
||||
method="POST",
|
||||
resource_path="/v1/request/{challenge_name}",
|
||||
method='POST',
|
||||
resource_path='/v1/request/{challenge_name}',
|
||||
path_params=_path_params,
|
||||
query_params=_query_params,
|
||||
header_params=_header_params,
|
||||
@@ -297,16 +335,22 @@ class RequestApi:
|
||||
auth_settings=_auth_settings,
|
||||
collection_formats=_collection_formats,
|
||||
_host=_host,
|
||||
_request_auth=_request_auth,
|
||||
_request_auth=_request_auth
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
@validate_call
|
||||
def v1_request_list_get(
|
||||
self,
|
||||
_request_timeout: Union[
|
||||
None,
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
|
||||
Tuple[
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Annotated[StrictFloat, Field(gt=0)]
|
||||
]
|
||||
] = None,
|
||||
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
||||
_content_type: Optional[StrictStr] = None,
|
||||
@@ -337,33 +381,43 @@ class RequestApi:
|
||||
in the spec for a single request.
|
||||
:type _host_index: int, optional
|
||||
:return: Returns the result object.
|
||||
""" # noqa: E501
|
||||
""" # noqa: E501
|
||||
|
||||
_param = self._v1_request_list_get_serialize(
|
||||
_request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index
|
||||
_request_auth=_request_auth,
|
||||
_content_type=_content_type,
|
||||
_headers=_headers,
|
||||
_host_index=_host_index
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
"200": "TypesRequestListResponse",
|
||||
"400": "TypesError",
|
||||
"401": "TypesError",
|
||||
"404": "TypesError",
|
||||
"500": "TypesError",
|
||||
'200': "TypesRequestListResponse",
|
||||
'400': "TypesError",
|
||||
'401': "TypesError",
|
||||
'404': "TypesError",
|
||||
'500': "TypesError",
|
||||
}
|
||||
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
_request_timeout=_request_timeout
|
||||
)
|
||||
response_data.read()
|
||||
return self.api_client.response_deserialize(
|
||||
response_data=response_data,
|
||||
response_types_map=_response_types_map,
|
||||
).data
|
||||
|
||||
|
||||
@validate_call
|
||||
def v1_request_list_get_with_http_info(
|
||||
self,
|
||||
_request_timeout: Union[
|
||||
None,
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
|
||||
Tuple[
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Annotated[StrictFloat, Field(gt=0)]
|
||||
]
|
||||
] = None,
|
||||
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
||||
_content_type: Optional[StrictStr] = None,
|
||||
@@ -394,33 +448,43 @@ class RequestApi:
|
||||
in the spec for a single request.
|
||||
:type _host_index: int, optional
|
||||
:return: Returns the result object.
|
||||
""" # noqa: E501
|
||||
""" # noqa: E501
|
||||
|
||||
_param = self._v1_request_list_get_serialize(
|
||||
_request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index
|
||||
_request_auth=_request_auth,
|
||||
_content_type=_content_type,
|
||||
_headers=_headers,
|
||||
_host_index=_host_index
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
"200": "TypesRequestListResponse",
|
||||
"400": "TypesError",
|
||||
"401": "TypesError",
|
||||
"404": "TypesError",
|
||||
"500": "TypesError",
|
||||
'200': "TypesRequestListResponse",
|
||||
'400': "TypesError",
|
||||
'401': "TypesError",
|
||||
'404': "TypesError",
|
||||
'500': "TypesError",
|
||||
}
|
||||
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
_request_timeout=_request_timeout
|
||||
)
|
||||
response_data.read()
|
||||
return self.api_client.response_deserialize(
|
||||
response_data=response_data,
|
||||
response_types_map=_response_types_map,
|
||||
)
|
||||
|
||||
|
||||
@validate_call
|
||||
def v1_request_list_get_without_preload_content(
|
||||
self,
|
||||
_request_timeout: Union[
|
||||
None,
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
|
||||
Tuple[
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Annotated[StrictFloat, Field(gt=0)]
|
||||
]
|
||||
] = None,
|
||||
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
||||
_content_type: Optional[StrictStr] = None,
|
||||
@@ -451,22 +515,29 @@ class RequestApi:
|
||||
in the spec for a single request.
|
||||
:type _host_index: int, optional
|
||||
:return: Returns the result object.
|
||||
""" # noqa: E501
|
||||
""" # noqa: E501
|
||||
|
||||
_param = self._v1_request_list_get_serialize(
|
||||
_request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index
|
||||
_request_auth=_request_auth,
|
||||
_content_type=_content_type,
|
||||
_headers=_headers,
|
||||
_host_index=_host_index
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
"200": "TypesRequestListResponse",
|
||||
"400": "TypesError",
|
||||
"401": "TypesError",
|
||||
"404": "TypesError",
|
||||
"500": "TypesError",
|
||||
'200': "TypesRequestListResponse",
|
||||
'400': "TypesError",
|
||||
'401': "TypesError",
|
||||
'404': "TypesError",
|
||||
'500': "TypesError",
|
||||
}
|
||||
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
_request_timeout=_request_timeout
|
||||
)
|
||||
return response_data.response
|
||||
|
||||
|
||||
def _v1_request_list_get_serialize(
|
||||
self,
|
||||
_request_auth,
|
||||
@@ -477,13 +548,16 @@ class RequestApi:
|
||||
|
||||
_host = None
|
||||
|
||||
_collection_formats: Dict[str, str] = {}
|
||||
_collection_formats: Dict[str, str] = {
|
||||
}
|
||||
|
||||
_path_params: Dict[str, str] = {}
|
||||
_query_params: List[Tuple[str, str]] = []
|
||||
_header_params: Dict[str, Optional[str]] = _headers or {}
|
||||
_form_params: List[Tuple[str, str]] = []
|
||||
_files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
|
||||
_files: Dict[
|
||||
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
||||
] = {}
|
||||
_body_params: Optional[bytes] = None
|
||||
|
||||
# process the path parameters
|
||||
@@ -492,16 +566,24 @@ class RequestApi:
|
||||
# process the form parameters
|
||||
# process the body parameter
|
||||
|
||||
|
||||
# set the HTTP header `Accept`
|
||||
if "Accept" not in _header_params:
|
||||
_header_params["Accept"] = self.api_client.select_header_accept(["application/json"])
|
||||
if 'Accept' not in _header_params:
|
||||
_header_params['Accept'] = self.api_client.select_header_accept(
|
||||
[
|
||||
'application/json'
|
||||
]
|
||||
)
|
||||
|
||||
|
||||
# authentication setting
|
||||
_auth_settings: List[str] = ["BasicAuth"]
|
||||
_auth_settings: List[str] = [
|
||||
'BasicAuth'
|
||||
]
|
||||
|
||||
return self.api_client.param_serialize(
|
||||
method="GET",
|
||||
resource_path="/v1/request/list/",
|
||||
method='GET',
|
||||
resource_path='/v1/request/list/',
|
||||
path_params=_path_params,
|
||||
query_params=_query_params,
|
||||
header_params=_header_params,
|
||||
@@ -511,5 +593,7 @@ class RequestApi:
|
||||
auth_settings=_auth_settings,
|
||||
collection_formats=_collection_formats,
|
||||
_host=_host,
|
||||
_request_auth=_request_auth,
|
||||
_request_auth=_request_auth
|
||||
)
|
||||
|
||||
|
||||
|
||||
+85
-47
@@ -1,14 +1,14 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Example Competition API
|
||||
Example Competition API
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: 1.4.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
The version of the OpenAPI document: 1.4.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
import warnings
|
||||
@@ -19,9 +19,7 @@ from typing_extensions import Annotated
|
||||
from pydantic import Field, StrictStr
|
||||
from typing_extensions import Annotated
|
||||
from buttercup.orchestrator.competition_api_client.models.types_sarif_submission import TypesSARIFSubmission
|
||||
from buttercup.orchestrator.competition_api_client.models.types_sarif_submission_response import (
|
||||
TypesSARIFSubmissionResponse,
|
||||
)
|
||||
from buttercup.orchestrator.competition_api_client.models.types_sarif_submission_response import TypesSARIFSubmissionResponse
|
||||
|
||||
from buttercup.orchestrator.competition_api_client.api_client import ApiClient, RequestSerialized
|
||||
from buttercup.orchestrator.competition_api_client.api_response import ApiResponse
|
||||
@@ -40,6 +38,7 @@ class SubmittedSarifApi:
|
||||
api_client = ApiClient.get_default()
|
||||
self.api_client = api_client
|
||||
|
||||
|
||||
@validate_call
|
||||
def v1_task_task_id_submitted_sarif_post(
|
||||
self,
|
||||
@@ -48,7 +47,10 @@ class SubmittedSarifApi:
|
||||
_request_timeout: Union[
|
||||
None,
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
|
||||
Tuple[
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Annotated[StrictFloat, Field(gt=0)]
|
||||
]
|
||||
] = None,
|
||||
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
||||
_content_type: Optional[StrictStr] = None,
|
||||
@@ -83,7 +85,7 @@ class SubmittedSarifApi:
|
||||
in the spec for a single request.
|
||||
:type _host_index: int, optional
|
||||
:return: Returns the result object.
|
||||
""" # noqa: E501
|
||||
""" # noqa: E501
|
||||
|
||||
_param = self._v1_task_task_id_submitted_sarif_post_serialize(
|
||||
task_id=task_id,
|
||||
@@ -91,23 +93,27 @@ class SubmittedSarifApi:
|
||||
_request_auth=_request_auth,
|
||||
_content_type=_content_type,
|
||||
_headers=_headers,
|
||||
_host_index=_host_index,
|
||||
_host_index=_host_index
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
"200": "TypesSARIFSubmissionResponse",
|
||||
"400": "TypesError",
|
||||
"401": "TypesError",
|
||||
"404": "TypesError",
|
||||
"500": "TypesError",
|
||||
'200': "TypesSARIFSubmissionResponse",
|
||||
'400': "TypesError",
|
||||
'401': "TypesError",
|
||||
'404': "TypesError",
|
||||
'500': "TypesError",
|
||||
}
|
||||
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
_request_timeout=_request_timeout
|
||||
)
|
||||
response_data.read()
|
||||
return self.api_client.response_deserialize(
|
||||
response_data=response_data,
|
||||
response_types_map=_response_types_map,
|
||||
).data
|
||||
|
||||
|
||||
@validate_call
|
||||
def v1_task_task_id_submitted_sarif_post_with_http_info(
|
||||
self,
|
||||
@@ -116,7 +122,10 @@ class SubmittedSarifApi:
|
||||
_request_timeout: Union[
|
||||
None,
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
|
||||
Tuple[
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Annotated[StrictFloat, Field(gt=0)]
|
||||
]
|
||||
] = None,
|
||||
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
||||
_content_type: Optional[StrictStr] = None,
|
||||
@@ -151,7 +160,7 @@ class SubmittedSarifApi:
|
||||
in the spec for a single request.
|
||||
:type _host_index: int, optional
|
||||
:return: Returns the result object.
|
||||
""" # noqa: E501
|
||||
""" # noqa: E501
|
||||
|
||||
_param = self._v1_task_task_id_submitted_sarif_post_serialize(
|
||||
task_id=task_id,
|
||||
@@ -159,23 +168,27 @@ class SubmittedSarifApi:
|
||||
_request_auth=_request_auth,
|
||||
_content_type=_content_type,
|
||||
_headers=_headers,
|
||||
_host_index=_host_index,
|
||||
_host_index=_host_index
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
"200": "TypesSARIFSubmissionResponse",
|
||||
"400": "TypesError",
|
||||
"401": "TypesError",
|
||||
"404": "TypesError",
|
||||
"500": "TypesError",
|
||||
'200': "TypesSARIFSubmissionResponse",
|
||||
'400': "TypesError",
|
||||
'401': "TypesError",
|
||||
'404': "TypesError",
|
||||
'500': "TypesError",
|
||||
}
|
||||
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
_request_timeout=_request_timeout
|
||||
)
|
||||
response_data.read()
|
||||
return self.api_client.response_deserialize(
|
||||
response_data=response_data,
|
||||
response_types_map=_response_types_map,
|
||||
)
|
||||
|
||||
|
||||
@validate_call
|
||||
def v1_task_task_id_submitted_sarif_post_without_preload_content(
|
||||
self,
|
||||
@@ -184,7 +197,10 @@ class SubmittedSarifApi:
|
||||
_request_timeout: Union[
|
||||
None,
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
|
||||
Tuple[
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Annotated[StrictFloat, Field(gt=0)]
|
||||
]
|
||||
] = None,
|
||||
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
||||
_content_type: Optional[StrictStr] = None,
|
||||
@@ -219,7 +235,7 @@ class SubmittedSarifApi:
|
||||
in the spec for a single request.
|
||||
:type _host_index: int, optional
|
||||
:return: Returns the result object.
|
||||
""" # noqa: E501
|
||||
""" # noqa: E501
|
||||
|
||||
_param = self._v1_task_task_id_submitted_sarif_post_serialize(
|
||||
task_id=task_id,
|
||||
@@ -227,19 +243,23 @@ class SubmittedSarifApi:
|
||||
_request_auth=_request_auth,
|
||||
_content_type=_content_type,
|
||||
_headers=_headers,
|
||||
_host_index=_host_index,
|
||||
_host_index=_host_index
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
"200": "TypesSARIFSubmissionResponse",
|
||||
"400": "TypesError",
|
||||
"401": "TypesError",
|
||||
"404": "TypesError",
|
||||
"500": "TypesError",
|
||||
'200': "TypesSARIFSubmissionResponse",
|
||||
'400': "TypesError",
|
||||
'401': "TypesError",
|
||||
'404': "TypesError",
|
||||
'500': "TypesError",
|
||||
}
|
||||
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
_request_timeout=_request_timeout
|
||||
)
|
||||
return response_data.response
|
||||
|
||||
|
||||
def _v1_task_task_id_submitted_sarif_post_serialize(
|
||||
self,
|
||||
task_id,
|
||||
@@ -252,18 +272,21 @@ class SubmittedSarifApi:
|
||||
|
||||
_host = None
|
||||
|
||||
_collection_formats: Dict[str, str] = {}
|
||||
_collection_formats: Dict[str, str] = {
|
||||
}
|
||||
|
||||
_path_params: Dict[str, str] = {}
|
||||
_query_params: List[Tuple[str, str]] = []
|
||||
_header_params: Dict[str, Optional[str]] = _headers or {}
|
||||
_form_params: List[Tuple[str, str]] = []
|
||||
_files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
|
||||
_files: Dict[
|
||||
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
||||
] = {}
|
||||
_body_params: Optional[bytes] = None
|
||||
|
||||
# process the path parameters
|
||||
if task_id is not None:
|
||||
_path_params["task_id"] = task_id
|
||||
_path_params['task_id'] = task_id
|
||||
# process the query parameters
|
||||
# process the header parameters
|
||||
# process the form parameters
|
||||
@@ -271,24 +294,37 @@ class SubmittedSarifApi:
|
||||
if payload is not None:
|
||||
_body_params = payload
|
||||
|
||||
|
||||
# set the HTTP header `Accept`
|
||||
if "Accept" not in _header_params:
|
||||
_header_params["Accept"] = self.api_client.select_header_accept(["application/json"])
|
||||
if 'Accept' not in _header_params:
|
||||
_header_params['Accept'] = self.api_client.select_header_accept(
|
||||
[
|
||||
'application/json'
|
||||
]
|
||||
)
|
||||
|
||||
# set the HTTP header `Content-Type`
|
||||
if _content_type:
|
||||
_header_params["Content-Type"] = _content_type
|
||||
_header_params['Content-Type'] = _content_type
|
||||
else:
|
||||
_default_content_type = self.api_client.select_header_content_type(["application/json"])
|
||||
_default_content_type = (
|
||||
self.api_client.select_header_content_type(
|
||||
[
|
||||
'application/json'
|
||||
]
|
||||
)
|
||||
)
|
||||
if _default_content_type is not None:
|
||||
_header_params["Content-Type"] = _default_content_type
|
||||
_header_params['Content-Type'] = _default_content_type
|
||||
|
||||
# authentication setting
|
||||
_auth_settings: List[str] = ["BasicAuth"]
|
||||
_auth_settings: List[str] = [
|
||||
'BasicAuth'
|
||||
]
|
||||
|
||||
return self.api_client.param_serialize(
|
||||
method="POST",
|
||||
resource_path="/v1/task/{task_id}/submitted-sarif/",
|
||||
method='POST',
|
||||
resource_path='/v1/task/{task_id}/submitted-sarif/',
|
||||
path_params=_path_params,
|
||||
query_params=_query_params,
|
||||
header_params=_header_params,
|
||||
@@ -298,5 +334,7 @@ class SubmittedSarifApi:
|
||||
auth_settings=_auth_settings,
|
||||
collection_formats=_collection_formats,
|
||||
_host=_host,
|
||||
_request_auth=_request_auth,
|
||||
_request_auth=_request_auth
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Example Competition API
|
||||
Example Competition API
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: 1.4.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
The version of the OpenAPI document: 1.4.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
@@ -37,12 +37,11 @@ from buttercup.orchestrator.competition_api_client.exceptions import (
|
||||
UnauthorizedException,
|
||||
ForbiddenException,
|
||||
NotFoundException,
|
||||
ServiceException,
|
||||
ServiceException
|
||||
)
|
||||
|
||||
RequestSerialized = Tuple[str, str, Dict[str, str], Optional[str], List[str]]
|
||||
|
||||
|
||||
class ApiClient:
|
||||
"""Generic API client for OpenAPI client library builds.
|
||||
|
||||
@@ -61,19 +60,25 @@ class ApiClient:
|
||||
|
||||
PRIMITIVE_TYPES = (float, bool, bytes, str, int)
|
||||
NATIVE_TYPES_MAPPING = {
|
||||
"int": int,
|
||||
"long": int, # TODO remove as only py3 is supported?
|
||||
"float": float,
|
||||
"str": str,
|
||||
"bool": bool,
|
||||
"date": datetime.date,
|
||||
"datetime": datetime.datetime,
|
||||
"decimal": decimal.Decimal,
|
||||
"object": object,
|
||||
'int': int,
|
||||
'long': int, # TODO remove as only py3 is supported?
|
||||
'float': float,
|
||||
'str': str,
|
||||
'bool': bool,
|
||||
'date': datetime.date,
|
||||
'datetime': datetime.datetime,
|
||||
'decimal': decimal.Decimal,
|
||||
'object': object,
|
||||
}
|
||||
_pool = None
|
||||
|
||||
def __init__(self, configuration=None, header_name=None, header_value=None, cookie=None) -> None:
|
||||
def __init__(
|
||||
self,
|
||||
configuration=None,
|
||||
header_name=None,
|
||||
header_value=None,
|
||||
cookie=None
|
||||
) -> None:
|
||||
# use default configuration if none is provided
|
||||
if configuration is None:
|
||||
configuration = Configuration.get_default()
|
||||
@@ -85,7 +90,7 @@ class ApiClient:
|
||||
self.default_headers[header_name] = header_value
|
||||
self.cookie = cookie
|
||||
# Set default User-Agent.
|
||||
self.user_agent = "OpenAPI-Generator/1.0.0/python"
|
||||
self.user_agent = 'OpenAPI-Generator/1.0.0/python'
|
||||
self.client_side_validation = configuration.client_side_validation
|
||||
|
||||
def __enter__(self):
|
||||
@@ -97,15 +102,16 @@ class ApiClient:
|
||||
@property
|
||||
def user_agent(self):
|
||||
"""User agent for this API client"""
|
||||
return self.default_headers["User-Agent"]
|
||||
return self.default_headers['User-Agent']
|
||||
|
||||
@user_agent.setter
|
||||
def user_agent(self, value):
|
||||
self.default_headers["User-Agent"] = value
|
||||
self.default_headers['User-Agent'] = value
|
||||
|
||||
def set_default_header(self, header_name, header_value):
|
||||
self.default_headers[header_name] = header_value
|
||||
|
||||
|
||||
_default = None
|
||||
|
||||
@classmethod
|
||||
@@ -141,12 +147,12 @@ class ApiClient:
|
||||
header_params=None,
|
||||
body=None,
|
||||
post_params=None,
|
||||
files=None,
|
||||
auth_settings=None,
|
||||
files=None, auth_settings=None,
|
||||
collection_formats=None,
|
||||
_host=None,
|
||||
_request_auth=None,
|
||||
_request_auth=None
|
||||
) -> RequestSerialized:
|
||||
|
||||
"""Builds the HTTP request params needed by the request.
|
||||
:param method: Method to call.
|
||||
:param resource_path: Path to method endpoint.
|
||||
@@ -175,30 +181,47 @@ class ApiClient:
|
||||
header_params = header_params or {}
|
||||
header_params.update(self.default_headers)
|
||||
if self.cookie:
|
||||
header_params["Cookie"] = self.cookie
|
||||
header_params['Cookie'] = self.cookie
|
||||
if header_params:
|
||||
header_params = self.sanitize_for_serialization(header_params)
|
||||
header_params = dict(self.parameters_to_tuples(header_params, collection_formats))
|
||||
header_params = dict(
|
||||
self.parameters_to_tuples(header_params,collection_formats)
|
||||
)
|
||||
|
||||
# path parameters
|
||||
if path_params:
|
||||
path_params = self.sanitize_for_serialization(path_params)
|
||||
path_params = self.parameters_to_tuples(path_params, collection_formats)
|
||||
path_params = self.parameters_to_tuples(
|
||||
path_params,
|
||||
collection_formats
|
||||
)
|
||||
for k, v in path_params:
|
||||
# specified safe chars, encode everything
|
||||
resource_path = resource_path.replace("{%s}" % k, quote(str(v), safe=config.safe_chars_for_path_param))
|
||||
resource_path = resource_path.replace(
|
||||
'{%s}' % k,
|
||||
quote(str(v), safe=config.safe_chars_for_path_param)
|
||||
)
|
||||
|
||||
# post parameters
|
||||
if post_params or files:
|
||||
post_params = post_params if post_params else []
|
||||
post_params = self.sanitize_for_serialization(post_params)
|
||||
post_params = self.parameters_to_tuples(post_params, collection_formats)
|
||||
post_params = self.parameters_to_tuples(
|
||||
post_params,
|
||||
collection_formats
|
||||
)
|
||||
if files:
|
||||
post_params.extend(self.files_parameters(files))
|
||||
|
||||
# auth setting
|
||||
self.update_params_for_auth(
|
||||
header_params, query_params, auth_settings, resource_path, method, body, request_auth=_request_auth
|
||||
header_params,
|
||||
query_params,
|
||||
auth_settings,
|
||||
resource_path,
|
||||
method,
|
||||
body,
|
||||
request_auth=_request_auth
|
||||
)
|
||||
|
||||
# body
|
||||
@@ -215,13 +238,23 @@ class ApiClient:
|
||||
# query parameters
|
||||
if query_params:
|
||||
query_params = self.sanitize_for_serialization(query_params)
|
||||
url_query = self.parameters_to_url_query(query_params, collection_formats)
|
||||
url_query = self.parameters_to_url_query(
|
||||
query_params,
|
||||
collection_formats
|
||||
)
|
||||
url += "?" + url_query
|
||||
|
||||
return method, url, header_params, body, post_params
|
||||
|
||||
|
||||
def call_api(
|
||||
self, method, url, header_params=None, body=None, post_params=None, _request_timeout=None
|
||||
self,
|
||||
method,
|
||||
url,
|
||||
header_params=None,
|
||||
body=None,
|
||||
post_params=None,
|
||||
_request_timeout=None
|
||||
) -> rest.RESTResponse:
|
||||
"""Makes the HTTP request (synchronous)
|
||||
:param method: Method to call.
|
||||
@@ -238,12 +271,10 @@ class ApiClient:
|
||||
try:
|
||||
# perform request and return response
|
||||
response_data = self.rest_client.request(
|
||||
method,
|
||||
url,
|
||||
method, url,
|
||||
headers=header_params,
|
||||
body=body,
|
||||
post_params=post_params,
|
||||
_request_timeout=_request_timeout,
|
||||
body=body, post_params=post_params,
|
||||
_request_timeout=_request_timeout
|
||||
)
|
||||
|
||||
except ApiException as e:
|
||||
@@ -252,7 +283,9 @@ class ApiClient:
|
||||
return response_data
|
||||
|
||||
def response_deserialize(
|
||||
self, response_data: rest.RESTResponse, response_types_map: Optional[Dict[str, ApiResponseT]] = None
|
||||
self,
|
||||
response_data: rest.RESTResponse,
|
||||
response_types_map: Optional[Dict[str, ApiResponseT]]=None
|
||||
) -> ApiResponse[ApiResponseT]:
|
||||
"""Deserializes response into an object.
|
||||
:param response_data: RESTResponse object to be deserialized.
|
||||
@@ -278,7 +311,7 @@ class ApiClient:
|
||||
return_data = self.__deserialize_file(response_data)
|
||||
elif response_type is not None:
|
||||
match = None
|
||||
content_type = response_data.getheader("content-type")
|
||||
content_type = response_data.getheader('content-type')
|
||||
if content_type is not None:
|
||||
match = re.search(r"charset=([a-zA-Z\-\d]+)[\s;]?", content_type)
|
||||
encoding = match.group(1) if match else "utf-8"
|
||||
@@ -293,10 +326,10 @@ class ApiClient:
|
||||
)
|
||||
|
||||
return ApiResponse(
|
||||
status_code=response_data.status,
|
||||
data=return_data,
|
||||
headers=response_data.getheaders(),
|
||||
raw_data=response_data.data,
|
||||
status_code = response_data.status,
|
||||
data = return_data,
|
||||
headers = response_data.getheaders(),
|
||||
raw_data = response_data.data
|
||||
)
|
||||
|
||||
def sanitize_for_serialization(self, obj):
|
||||
@@ -324,9 +357,13 @@ class ApiClient:
|
||||
elif isinstance(obj, self.PRIMITIVE_TYPES):
|
||||
return obj
|
||||
elif isinstance(obj, list):
|
||||
return [self.sanitize_for_serialization(sub_obj) for sub_obj in obj]
|
||||
return [
|
||||
self.sanitize_for_serialization(sub_obj) for sub_obj in obj
|
||||
]
|
||||
elif isinstance(obj, tuple):
|
||||
return tuple(self.sanitize_for_serialization(sub_obj) for sub_obj in obj)
|
||||
return tuple(
|
||||
self.sanitize_for_serialization(sub_obj) for sub_obj in obj
|
||||
)
|
||||
elif isinstance(obj, (datetime.datetime, datetime.date)):
|
||||
return obj.isoformat()
|
||||
elif isinstance(obj, decimal.Decimal):
|
||||
@@ -340,7 +377,7 @@ class ApiClient:
|
||||
# and attributes which value is not None.
|
||||
# Convert attribute name to json key in
|
||||
# model definition for request.
|
||||
if hasattr(obj, "to_dict") and callable(getattr(obj, "to_dict")):
|
||||
if hasattr(obj, 'to_dict') and callable(getattr(obj, 'to_dict')):
|
||||
obj_dict = obj.to_dict()
|
||||
else:
|
||||
obj_dict = obj.__dict__
|
||||
@@ -349,7 +386,10 @@ class ApiClient:
|
||||
# here we handle instances that can either be a list or something else, and only became a real list by calling to_dict()
|
||||
return self.sanitize_for_serialization(obj_dict)
|
||||
|
||||
return {key: self.sanitize_for_serialization(val) for key, val in obj_dict.items()}
|
||||
return {
|
||||
key: self.sanitize_for_serialization(val)
|
||||
for key, val in obj_dict.items()
|
||||
}
|
||||
|
||||
def deserialize(self, response_text: str, response_type: str, content_type: Optional[str]):
|
||||
"""Deserializes response into an object.
|
||||
@@ -368,15 +408,18 @@ class ApiClient:
|
||||
data = json.loads(response_text)
|
||||
except ValueError:
|
||||
data = response_text
|
||||
elif re.match(r"^application/(json|[\w!#$&.+-^_]+\+json)\s*(;|$)", content_type, re.IGNORECASE):
|
||||
elif re.match(r'^application/(json|[\w!#$&.+-^_]+\+json)\s*(;|$)', content_type, re.IGNORECASE):
|
||||
if response_text == "":
|
||||
data = ""
|
||||
else:
|
||||
data = json.loads(response_text)
|
||||
elif re.match(r"^text\/[a-z.+-]+\s*(;|$)", content_type, re.IGNORECASE):
|
||||
elif re.match(r'^text\/[a-z.+-]+\s*(;|$)', content_type, re.IGNORECASE):
|
||||
data = response_text
|
||||
else:
|
||||
raise ApiException(status=0, reason="Unsupported content type: {0}".format(content_type))
|
||||
raise ApiException(
|
||||
status=0,
|
||||
reason="Unsupported content type: {0}".format(content_type)
|
||||
)
|
||||
|
||||
return self.__deserialize(data, response_type)
|
||||
|
||||
@@ -392,17 +435,19 @@ class ApiClient:
|
||||
return None
|
||||
|
||||
if isinstance(klass, str):
|
||||
if klass.startswith("List["):
|
||||
m = re.match(r"List\[(.*)]", klass)
|
||||
if klass.startswith('List['):
|
||||
m = re.match(r'List\[(.*)]', klass)
|
||||
assert m is not None, "Malformed List type definition"
|
||||
sub_kls = m.group(1)
|
||||
return [self.__deserialize(sub_data, sub_kls) for sub_data in data]
|
||||
return [self.__deserialize(sub_data, sub_kls)
|
||||
for sub_data in data]
|
||||
|
||||
if klass.startswith("Dict["):
|
||||
m = re.match(r"Dict\[([^,]*), (.*)]", klass)
|
||||
if klass.startswith('Dict['):
|
||||
m = re.match(r'Dict\[([^,]*), (.*)]', klass)
|
||||
assert m is not None, "Malformed Dict type definition"
|
||||
sub_kls = m.group(2)
|
||||
return {k: self.__deserialize(v, sub_kls) for k, v in data.items()}
|
||||
return {k: self.__deserialize(v, sub_kls)
|
||||
for k, v in data.items()}
|
||||
|
||||
# convert str to class
|
||||
if klass in self.NATIVE_TYPES_MAPPING:
|
||||
@@ -438,18 +483,19 @@ class ApiClient:
|
||||
for k, v in params.items() if isinstance(params, dict) else params:
|
||||
if k in collection_formats:
|
||||
collection_format = collection_formats[k]
|
||||
if collection_format == "multi":
|
||||
if collection_format == 'multi':
|
||||
new_params.extend((k, value) for value in v)
|
||||
else:
|
||||
if collection_format == "ssv":
|
||||
delimiter = " "
|
||||
elif collection_format == "tsv":
|
||||
delimiter = "\t"
|
||||
elif collection_format == "pipes":
|
||||
delimiter = "|"
|
||||
if collection_format == 'ssv':
|
||||
delimiter = ' '
|
||||
elif collection_format == 'tsv':
|
||||
delimiter = '\t'
|
||||
elif collection_format == 'pipes':
|
||||
delimiter = '|'
|
||||
else: # csv is the default
|
||||
delimiter = ","
|
||||
new_params.append((k, delimiter.join(str(value) for value in v)))
|
||||
delimiter = ','
|
||||
new_params.append(
|
||||
(k, delimiter.join(str(value) for value in v)))
|
||||
else:
|
||||
new_params.append((k, v))
|
||||
return new_params
|
||||
@@ -474,18 +520,20 @@ class ApiClient:
|
||||
|
||||
if k in collection_formats:
|
||||
collection_format = collection_formats[k]
|
||||
if collection_format == "multi":
|
||||
if collection_format == 'multi':
|
||||
new_params.extend((k, quote(str(value))) for value in v)
|
||||
else:
|
||||
if collection_format == "ssv":
|
||||
delimiter = " "
|
||||
elif collection_format == "tsv":
|
||||
delimiter = "\t"
|
||||
elif collection_format == "pipes":
|
||||
delimiter = "|"
|
||||
if collection_format == 'ssv':
|
||||
delimiter = ' '
|
||||
elif collection_format == 'tsv':
|
||||
delimiter = '\t'
|
||||
elif collection_format == 'pipes':
|
||||
delimiter = '|'
|
||||
else: # csv is the default
|
||||
delimiter = ","
|
||||
new_params.append((k, delimiter.join(quote(str(value)) for value in v)))
|
||||
delimiter = ','
|
||||
new_params.append(
|
||||
(k, delimiter.join(quote(str(value)) for value in v))
|
||||
)
|
||||
else:
|
||||
new_params.append((k, quote(str(v))))
|
||||
|
||||
@@ -503,7 +551,7 @@ class ApiClient:
|
||||
params = []
|
||||
for k, v in files.items():
|
||||
if isinstance(v, str):
|
||||
with open(v, "rb") as f:
|
||||
with open(v, 'rb') as f:
|
||||
filename = os.path.basename(f.name)
|
||||
filedata = f.read()
|
||||
elif isinstance(v, bytes):
|
||||
@@ -517,8 +565,13 @@ class ApiClient:
|
||||
continue
|
||||
else:
|
||||
raise ValueError("Unsupported file value")
|
||||
mimetype = mimetypes.guess_type(filename)[0] or "application/octet-stream"
|
||||
params.append(tuple([k, tuple([filename, filedata, mimetype])]))
|
||||
mimetype = (
|
||||
mimetypes.guess_type(filename)[0]
|
||||
or 'application/octet-stream'
|
||||
)
|
||||
params.append(
|
||||
tuple([k, tuple([filename, filedata, mimetype])])
|
||||
)
|
||||
return params
|
||||
|
||||
def select_header_accept(self, accepts: List[str]) -> Optional[str]:
|
||||
@@ -531,7 +584,7 @@ class ApiClient:
|
||||
return None
|
||||
|
||||
for accept in accepts:
|
||||
if re.search("json", accept, re.IGNORECASE):
|
||||
if re.search('json', accept, re.IGNORECASE):
|
||||
return accept
|
||||
|
||||
return accepts[0]
|
||||
@@ -546,13 +599,20 @@ class ApiClient:
|
||||
return None
|
||||
|
||||
for content_type in content_types:
|
||||
if re.search("json", content_type, re.IGNORECASE):
|
||||
if re.search('json', content_type, re.IGNORECASE):
|
||||
return content_type
|
||||
|
||||
return content_types[0]
|
||||
|
||||
def update_params_for_auth(
|
||||
self, headers, queries, auth_settings, resource_path, method, body, request_auth=None
|
||||
self,
|
||||
headers,
|
||||
queries,
|
||||
auth_settings,
|
||||
resource_path,
|
||||
method,
|
||||
body,
|
||||
request_auth=None
|
||||
) -> None:
|
||||
"""Updates header and query params based on authentication setting.
|
||||
|
||||
@@ -570,14 +630,36 @@ class ApiClient:
|
||||
return
|
||||
|
||||
if request_auth:
|
||||
self._apply_auth_params(headers, queries, resource_path, method, body, request_auth)
|
||||
self._apply_auth_params(
|
||||
headers,
|
||||
queries,
|
||||
resource_path,
|
||||
method,
|
||||
body,
|
||||
request_auth
|
||||
)
|
||||
else:
|
||||
for auth in auth_settings:
|
||||
auth_setting = self.configuration.auth_settings().get(auth)
|
||||
if auth_setting:
|
||||
self._apply_auth_params(headers, queries, resource_path, method, body, auth_setting)
|
||||
self._apply_auth_params(
|
||||
headers,
|
||||
queries,
|
||||
resource_path,
|
||||
method,
|
||||
body,
|
||||
auth_setting
|
||||
)
|
||||
|
||||
def _apply_auth_params(self, headers, queries, resource_path, method, body, auth_setting) -> None:
|
||||
def _apply_auth_params(
|
||||
self,
|
||||
headers,
|
||||
queries,
|
||||
resource_path,
|
||||
method,
|
||||
body,
|
||||
auth_setting
|
||||
) -> None:
|
||||
"""Updates the request parameters based on a single auth_setting
|
||||
|
||||
:param headers: Header parameters dict to be updated.
|
||||
@@ -588,15 +670,17 @@ class ApiClient:
|
||||
The object type is the return value of sanitize_for_serialization().
|
||||
:param auth_setting: auth settings for the endpoint
|
||||
"""
|
||||
if auth_setting["in"] == "cookie":
|
||||
headers["Cookie"] = auth_setting["value"]
|
||||
elif auth_setting["in"] == "header":
|
||||
if auth_setting["type"] != "http-signature":
|
||||
headers[auth_setting["key"]] = auth_setting["value"]
|
||||
elif auth_setting["in"] == "query":
|
||||
queries.append((auth_setting["key"], auth_setting["value"]))
|
||||
if auth_setting['in'] == 'cookie':
|
||||
headers['Cookie'] = auth_setting['value']
|
||||
elif auth_setting['in'] == 'header':
|
||||
if auth_setting['type'] != 'http-signature':
|
||||
headers[auth_setting['key']] = auth_setting['value']
|
||||
elif auth_setting['in'] == 'query':
|
||||
queries.append((auth_setting['key'], auth_setting['value']))
|
||||
else:
|
||||
raise ApiValueError("Authentication token must be in `query` or `header`")
|
||||
raise ApiValueError(
|
||||
'Authentication token must be in `query` or `header`'
|
||||
)
|
||||
|
||||
def __deserialize_file(self, response):
|
||||
"""Deserializes body to file
|
||||
@@ -616,7 +700,10 @@ class ApiClient:
|
||||
|
||||
content_disposition = response.getheader("Content-Disposition")
|
||||
if content_disposition:
|
||||
m = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', content_disposition)
|
||||
m = re.search(
|
||||
r'filename=[\'"]?([^\'"\s]+)[\'"]?',
|
||||
content_disposition
|
||||
)
|
||||
assert m is not None, "Unexpected 'content-disposition' header value"
|
||||
filename = m.group(1)
|
||||
path = os.path.join(os.path.dirname(path), filename)
|
||||
@@ -659,7 +746,10 @@ class ApiClient:
|
||||
except ImportError:
|
||||
return string
|
||||
except ValueError:
|
||||
raise rest.ApiException(status=0, reason="Failed to parse `{0}` as date object".format(string))
|
||||
raise rest.ApiException(
|
||||
status=0,
|
||||
reason="Failed to parse `{0}` as date object".format(string)
|
||||
)
|
||||
|
||||
def __deserialize_datetime(self, string):
|
||||
"""Deserializes string to datetime.
|
||||
@@ -674,7 +764,13 @@ class ApiClient:
|
||||
except ImportError:
|
||||
return string
|
||||
except ValueError:
|
||||
raise rest.ApiException(status=0, reason=("Failed to parse `{0}` as datetime object".format(string)))
|
||||
raise rest.ApiException(
|
||||
status=0,
|
||||
reason=(
|
||||
"Failed to parse `{0}` as datetime object"
|
||||
.format(string)
|
||||
)
|
||||
)
|
||||
|
||||
def __deserialize_enum(self, data, klass):
|
||||
"""Deserializes primitive type to enum.
|
||||
@@ -686,7 +782,13 @@ class ApiClient:
|
||||
try:
|
||||
return klass(data)
|
||||
except ValueError:
|
||||
raise rest.ApiException(status=0, reason=("Failed to parse `{0}` as `{1}`".format(data, klass)))
|
||||
raise rest.ApiException(
|
||||
status=0,
|
||||
reason=(
|
||||
"Failed to parse `{0}` as `{1}`"
|
||||
.format(data, klass)
|
||||
)
|
||||
)
|
||||
|
||||
def __deserialize_model(self, data, klass):
|
||||
"""Deserializes list or dict to model.
|
||||
|
||||
@@ -6,7 +6,6 @@ from pydantic import Field, StrictInt, StrictBytes, BaseModel
|
||||
|
||||
T = TypeVar("T")
|
||||
|
||||
|
||||
class ApiResponse(BaseModel, Generic[T]):
|
||||
"""
|
||||
API response object
|
||||
@@ -17,4 +16,6 @@ class ApiResponse(BaseModel, Generic[T]):
|
||||
data: T = Field(description="Deserialized data given the data type")
|
||||
raw_data: StrictBytes = Field(description="Raw data (HTTP response body)")
|
||||
|
||||
model_config = {"arbitrary_types_allowed": True}
|
||||
model_config = {
|
||||
"arbitrary_types_allowed": True
|
||||
}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Example Competition API
|
||||
Example Competition API
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: 1.4.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
The version of the OpenAPI document: 1.4.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
@@ -25,16 +25,9 @@ import urllib3
|
||||
|
||||
|
||||
JSON_SCHEMA_VALIDATION_KEYWORDS = {
|
||||
"multipleOf",
|
||||
"maximum",
|
||||
"exclusiveMaximum",
|
||||
"minimum",
|
||||
"exclusiveMinimum",
|
||||
"maxLength",
|
||||
"minLength",
|
||||
"pattern",
|
||||
"maxItems",
|
||||
"minItems",
|
||||
'multipleOf', 'maximum', 'exclusiveMaximum',
|
||||
'minimum', 'exclusiveMinimum', 'maxLength',
|
||||
'minLength', 'pattern', 'maxItems', 'minItems'
|
||||
}
|
||||
|
||||
ServerVariablesT = Dict[str, str]
|
||||
@@ -141,52 +134,52 @@ class HostSetting(TypedDict):
|
||||
class Configuration:
|
||||
"""This class contains various settings of the API client.
|
||||
|
||||
:param host: Base url.
|
||||
:param ignore_operation_servers
|
||||
Boolean to ignore operation servers for the API client.
|
||||
Config will use `host` as the base url regardless of the operation servers.
|
||||
:param api_key: Dict to store API key(s).
|
||||
Each entry in the dict specifies an API key.
|
||||
The dict key is the name of the security scheme in the OAS specification.
|
||||
The dict value is the API key secret.
|
||||
:param api_key_prefix: Dict to store API prefix (e.g. Bearer).
|
||||
The dict key is the name of the security scheme in the OAS specification.
|
||||
The dict value is an API key prefix when generating the auth data.
|
||||
:param username: Username for HTTP basic authentication.
|
||||
:param password: Password for HTTP basic authentication.
|
||||
:param access_token: Access token.
|
||||
:param server_index: Index to servers configuration.
|
||||
:param server_variables: Mapping with string values to replace variables in
|
||||
templated server configuration. The validation of enums is performed for
|
||||
variables with defined enum values before.
|
||||
:param server_operation_index: Mapping from operation ID to an index to server
|
||||
configuration.
|
||||
:param server_operation_variables: Mapping from operation ID to a mapping with
|
||||
string values to replace variables in templated server configuration.
|
||||
The validation of enums is performed for variables with defined enum
|
||||
values before.
|
||||
:param ssl_ca_cert: str - the path to a file of concatenated CA certificates
|
||||
in PEM format.
|
||||
:param retries: Number of retries for API requests.
|
||||
:param ca_cert_data: verify the peer using concatenated CA certificate data
|
||||
in PEM (str) or DER (bytes) format.
|
||||
:param host: Base url.
|
||||
:param ignore_operation_servers
|
||||
Boolean to ignore operation servers for the API client.
|
||||
Config will use `host` as the base url regardless of the operation servers.
|
||||
:param api_key: Dict to store API key(s).
|
||||
Each entry in the dict specifies an API key.
|
||||
The dict key is the name of the security scheme in the OAS specification.
|
||||
The dict value is the API key secret.
|
||||
:param api_key_prefix: Dict to store API prefix (e.g. Bearer).
|
||||
The dict key is the name of the security scheme in the OAS specification.
|
||||
The dict value is an API key prefix when generating the auth data.
|
||||
:param username: Username for HTTP basic authentication.
|
||||
:param password: Password for HTTP basic authentication.
|
||||
:param access_token: Access token.
|
||||
:param server_index: Index to servers configuration.
|
||||
:param server_variables: Mapping with string values to replace variables in
|
||||
templated server configuration. The validation of enums is performed for
|
||||
variables with defined enum values before.
|
||||
:param server_operation_index: Mapping from operation ID to an index to server
|
||||
configuration.
|
||||
:param server_operation_variables: Mapping from operation ID to a mapping with
|
||||
string values to replace variables in templated server configuration.
|
||||
The validation of enums is performed for variables with defined enum
|
||||
values before.
|
||||
:param ssl_ca_cert: str - the path to a file of concatenated CA certificates
|
||||
in PEM format.
|
||||
:param retries: Number of retries for API requests.
|
||||
:param ca_cert_data: verify the peer using concatenated CA certificate data
|
||||
in PEM (str) or DER (bytes) format.
|
||||
|
||||
:Example:
|
||||
:Example:
|
||||
|
||||
HTTP Basic Authentication Example.
|
||||
Given the following security scheme in the OpenAPI specification:
|
||||
components:
|
||||
securitySchemes:
|
||||
http_basic_auth:
|
||||
type: http
|
||||
scheme: basic
|
||||
HTTP Basic Authentication Example.
|
||||
Given the following security scheme in the OpenAPI specification:
|
||||
components:
|
||||
securitySchemes:
|
||||
http_basic_auth:
|
||||
type: http
|
||||
scheme: basic
|
||||
|
||||
Configure API client with HTTP basic authentication:
|
||||
Configure API client with HTTP basic authentication:
|
||||
|
||||
conf = competition_api_client.Configuration(
|
||||
username='the-user',
|
||||
password='the-password',
|
||||
)
|
||||
conf = competition_api_client.Configuration(
|
||||
username='the-user',
|
||||
password='the-password',
|
||||
)
|
||||
|
||||
"""
|
||||
|
||||
@@ -194,24 +187,25 @@ class Configuration:
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
host: Optional[str] = None,
|
||||
api_key: Optional[Dict[str, str]] = None,
|
||||
api_key_prefix: Optional[Dict[str, str]] = None,
|
||||
username: Optional[str] = None,
|
||||
password: Optional[str] = None,
|
||||
access_token: Optional[str] = None,
|
||||
server_index: Optional[int] = None,
|
||||
server_variables: Optional[ServerVariablesT] = None,
|
||||
server_operation_index: Optional[Dict[int, int]] = None,
|
||||
server_operation_variables: Optional[Dict[int, ServerVariablesT]] = None,
|
||||
ignore_operation_servers: bool = False,
|
||||
ssl_ca_cert: Optional[str] = None,
|
||||
host: Optional[str]=None,
|
||||
api_key: Optional[Dict[str, str]]=None,
|
||||
api_key_prefix: Optional[Dict[str, str]]=None,
|
||||
username: Optional[str]=None,
|
||||
password: Optional[str]=None,
|
||||
access_token: Optional[str]=None,
|
||||
server_index: Optional[int]=None,
|
||||
server_variables: Optional[ServerVariablesT]=None,
|
||||
server_operation_index: Optional[Dict[int, int]]=None,
|
||||
server_operation_variables: Optional[Dict[int, ServerVariablesT]]=None,
|
||||
ignore_operation_servers: bool=False,
|
||||
ssl_ca_cert: Optional[str]=None,
|
||||
retries: Optional[int] = None,
|
||||
ca_cert_data: Optional[Union[str, bytes]] = None,
|
||||
*,
|
||||
debug: Optional[bool] = None,
|
||||
) -> None:
|
||||
"""Constructor"""
|
||||
"""Constructor
|
||||
"""
|
||||
self._base_path = "http://localhost" if host is None else host
|
||||
"""Default Base url
|
||||
"""
|
||||
@@ -257,7 +251,7 @@ class Configuration:
|
||||
"""
|
||||
self.logger["package_logger"] = logging.getLogger("competition_api_client")
|
||||
self.logger["urllib3_logger"] = logging.getLogger("urllib3")
|
||||
self.logger_format = "%(asctime)s %(levelname)s %(message)s"
|
||||
self.logger_format = '%(asctime)s %(levelname)s %(message)s'
|
||||
"""Log format
|
||||
"""
|
||||
self.logger_stream_handler = None
|
||||
@@ -316,7 +310,7 @@ class Configuration:
|
||||
self.proxy_headers = None
|
||||
"""Proxy headers
|
||||
"""
|
||||
self.safe_chars_for_path_param = ""
|
||||
self.safe_chars_for_path_param = ''
|
||||
"""Safe chars for path_param
|
||||
"""
|
||||
self.retries = retries
|
||||
@@ -337,12 +331,12 @@ class Configuration:
|
||||
"""date format
|
||||
"""
|
||||
|
||||
def __deepcopy__(self, memo: Dict[int, Any]) -> Self:
|
||||
def __deepcopy__(self, memo: Dict[int, Any]) -> Self:
|
||||
cls = self.__class__
|
||||
result = cls.__new__(cls)
|
||||
memo[id(self)] = result
|
||||
for k, v in self.__dict__.items():
|
||||
if k not in ("logger", "logger_file_handler"):
|
||||
if k not in ('logger', 'logger_file_handler'):
|
||||
setattr(result, k, copy.deepcopy(v, memo))
|
||||
# shallow copy of loggers
|
||||
result.logger = copy.copy(self.logger)
|
||||
@@ -474,7 +468,7 @@ class Configuration:
|
||||
self.__logger_format = value
|
||||
self.logger_formatter = logging.Formatter(self.__logger_format)
|
||||
|
||||
def get_api_key_with_prefix(self, identifier: str, alias: Optional[str] = None) -> Optional[str]:
|
||||
def get_api_key_with_prefix(self, identifier: str, alias: Optional[str]=None) -> Optional[str]:
|
||||
"""Gets API key (with prefix if set).
|
||||
|
||||
:param identifier: The identifier of apiKey.
|
||||
@@ -504,20 +498,22 @@ class Configuration:
|
||||
password = ""
|
||||
if self.password is not None:
|
||||
password = self.password
|
||||
return urllib3.util.make_headers(basic_auth=username + ":" + password).get("authorization")
|
||||
return urllib3.util.make_headers(
|
||||
basic_auth=username + ':' + password
|
||||
).get('authorization')
|
||||
|
||||
def auth_settings(self) -> AuthSettings:
|
||||
def auth_settings(self)-> AuthSettings:
|
||||
"""Gets Auth Settings dict for api client.
|
||||
|
||||
:return: The Auth Settings information dict.
|
||||
"""
|
||||
auth: AuthSettings = {}
|
||||
if self.username is not None and self.password is not None:
|
||||
auth["BasicAuth"] = {
|
||||
"type": "basic",
|
||||
"in": "header",
|
||||
"key": "Authorization",
|
||||
"value": self.get_basic_auth_token(),
|
||||
auth['BasicAuth'] = {
|
||||
'type': 'basic',
|
||||
'in': 'header',
|
||||
'key': 'Authorization',
|
||||
'value': self.get_basic_auth_token()
|
||||
}
|
||||
return auth
|
||||
|
||||
@@ -526,13 +522,12 @@ class Configuration:
|
||||
|
||||
:return: The report for debugging.
|
||||
"""
|
||||
return (
|
||||
"Python SDK Debug Report:\n"
|
||||
"OS: {env}\n"
|
||||
"Python Version: {pyversion}\n"
|
||||
"Version of the API: 1.4.0\n"
|
||||
"SDK Package Version: 1.0.0".format(env=sys.platform, pyversion=sys.version)
|
||||
)
|
||||
return "Python SDK Debug Report:\n"\
|
||||
"OS: {env}\n"\
|
||||
"Python Version: {pyversion}\n"\
|
||||
"Version of the API: 1.4.0\n"\
|
||||
"SDK Package Version: 1.0.0".\
|
||||
format(env=sys.platform, pyversion=sys.version)
|
||||
|
||||
def get_host_settings(self) -> List[HostSetting]:
|
||||
"""Gets an array of host settings
|
||||
@@ -541,16 +536,16 @@ class Configuration:
|
||||
"""
|
||||
return [
|
||||
{
|
||||
"url": "",
|
||||
"description": "No description provided",
|
||||
'url': "",
|
||||
'description': "No description provided",
|
||||
}
|
||||
]
|
||||
|
||||
def get_host_from_settings(
|
||||
self,
|
||||
index: Optional[int],
|
||||
variables: Optional[ServerVariablesT] = None,
|
||||
servers: Optional[List[HostSetting]] = None,
|
||||
variables: Optional[ServerVariablesT]=None,
|
||||
servers: Optional[List[HostSetting]]=None,
|
||||
) -> str:
|
||||
"""Gets host URL based on the index and variables
|
||||
:param index: array index of the host settings
|
||||
@@ -569,20 +564,22 @@ class Configuration:
|
||||
except IndexError:
|
||||
raise ValueError(
|
||||
"Invalid index {0} when selecting the host settings. "
|
||||
"Must be less than {1}".format(index, len(servers))
|
||||
)
|
||||
"Must be less than {1}".format(index, len(servers)))
|
||||
|
||||
url = server["url"]
|
||||
url = server['url']
|
||||
|
||||
# go through variables and replace placeholders
|
||||
for variable_name, variable in server.get("variables", {}).items():
|
||||
used_value = variables.get(variable_name, variable["default_value"])
|
||||
for variable_name, variable in server.get('variables', {}).items():
|
||||
used_value = variables.get(
|
||||
variable_name, variable['default_value'])
|
||||
|
||||
if "enum_values" in variable and used_value not in variable["enum_values"]:
|
||||
if 'enum_values' in variable \
|
||||
and used_value not in variable['enum_values']:
|
||||
raise ValueError(
|
||||
"The variable `{0}` in the host URL has invalid value "
|
||||
"{1}. Must be {2}.".format(variable_name, variables[variable_name], variable["enum_values"])
|
||||
)
|
||||
"{1}. Must be {2}.".format(
|
||||
variable_name, variables[variable_name],
|
||||
variable['enum_values']))
|
||||
|
||||
url = url.replace("{" + variable_name + "}", used_value)
|
||||
|
||||
|
||||
@@ -1,27 +1,27 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Example Competition API
|
||||
Example Competition API
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: 1.4.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
The version of the OpenAPI document: 1.4.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
from typing import Any, Optional
|
||||
from typing_extensions import Self
|
||||
|
||||
|
||||
class OpenApiException(Exception):
|
||||
"""The base exception class for all OpenAPIExceptions"""
|
||||
|
||||
|
||||
class ApiTypeError(OpenApiException, TypeError):
|
||||
def __init__(self, msg, path_to_item=None, valid_classes=None, key_type=None) -> None:
|
||||
"""Raises an exception for TypeErrors
|
||||
def __init__(self, msg, path_to_item=None, valid_classes=None,
|
||||
key_type=None) -> None:
|
||||
""" Raises an exception for TypeErrors
|
||||
|
||||
Args:
|
||||
msg (str): the exception message
|
||||
@@ -104,9 +104,9 @@ class ApiKeyError(OpenApiException, KeyError):
|
||||
class ApiException(OpenApiException):
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
status=None,
|
||||
reason=None,
|
||||
self,
|
||||
status=None,
|
||||
reason=None,
|
||||
http_resp=None,
|
||||
*,
|
||||
body: Optional[str] = None,
|
||||
@@ -125,17 +125,17 @@ class ApiException(OpenApiException):
|
||||
self.reason = http_resp.reason
|
||||
if self.body is None:
|
||||
try:
|
||||
self.body = http_resp.data.decode("utf-8")
|
||||
self.body = http_resp.data.decode('utf-8')
|
||||
except Exception:
|
||||
pass
|
||||
self.headers = http_resp.getheaders()
|
||||
|
||||
@classmethod
|
||||
def from_response(
|
||||
cls,
|
||||
*,
|
||||
http_resp,
|
||||
body: Optional[str],
|
||||
cls,
|
||||
*,
|
||||
http_resp,
|
||||
body: Optional[str],
|
||||
data: Optional[Any],
|
||||
) -> Self:
|
||||
if http_resp.status == 400:
|
||||
@@ -163,9 +163,11 @@ class ApiException(OpenApiException):
|
||||
|
||||
def __str__(self):
|
||||
"""Custom error messages for exception"""
|
||||
error_message = "({0})\n" "Reason: {1}\n".format(self.status, self.reason)
|
||||
error_message = "({0})\n"\
|
||||
"Reason: {1}\n".format(self.status, self.reason)
|
||||
if self.headers:
|
||||
error_message += "HTTP response headers: {0}\n".format(self.headers)
|
||||
error_message += "HTTP response headers: {0}\n".format(
|
||||
self.headers)
|
||||
|
||||
if self.data or self.body:
|
||||
error_message += "HTTP response body: {0}\n".format(self.data or self.body)
|
||||
@@ -195,13 +197,11 @@ class ServiceException(ApiException):
|
||||
|
||||
class ConflictException(ApiException):
|
||||
"""Exception for HTTP 409 Conflict."""
|
||||
|
||||
pass
|
||||
|
||||
|
||||
class UnprocessableEntityException(ApiException):
|
||||
"""Exception for HTTP 422 Unprocessable Entity."""
|
||||
|
||||
pass
|
||||
|
||||
|
||||
|
||||
@@ -2,14 +2,14 @@
|
||||
|
||||
# flake8: noqa
|
||||
"""
|
||||
Example Competition API
|
||||
Example Competition API
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: 1.4.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
The version of the OpenAPI document: 1.4.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
@@ -17,36 +17,22 @@ Do not edit the class manually.
|
||||
from buttercup.orchestrator.competition_api_client.models.types_architecture import TypesArchitecture
|
||||
from buttercup.orchestrator.competition_api_client.models.types_assessment import TypesAssessment
|
||||
from buttercup.orchestrator.competition_api_client.models.types_bundle_submission import TypesBundleSubmission
|
||||
from buttercup.orchestrator.competition_api_client.models.types_bundle_submission_response import (
|
||||
TypesBundleSubmissionResponse,
|
||||
)
|
||||
from buttercup.orchestrator.competition_api_client.models.types_bundle_submission_response_verbose import (
|
||||
TypesBundleSubmissionResponseVerbose,
|
||||
)
|
||||
from buttercup.orchestrator.competition_api_client.models.types_bundle_submission_response import TypesBundleSubmissionResponse
|
||||
from buttercup.orchestrator.competition_api_client.models.types_bundle_submission_response_verbose import TypesBundleSubmissionResponseVerbose
|
||||
from buttercup.orchestrator.competition_api_client.models.types_error import TypesError
|
||||
from buttercup.orchestrator.competition_api_client.models.types_freeform_response import TypesFreeformResponse
|
||||
from buttercup.orchestrator.competition_api_client.models.types_freeform_submission import TypesFreeformSubmission
|
||||
from buttercup.orchestrator.competition_api_client.models.types_fuzzing_engine import TypesFuzzingEngine
|
||||
from buttercup.orchestrator.competition_api_client.models.types_message import TypesMessage
|
||||
from buttercup.orchestrator.competition_api_client.models.types_pov_submission import TypesPOVSubmission
|
||||
from buttercup.orchestrator.competition_api_client.models.types_pov_submission_response import (
|
||||
TypesPOVSubmissionResponse,
|
||||
)
|
||||
from buttercup.orchestrator.competition_api_client.models.types_pov_submission_response import TypesPOVSubmissionResponse
|
||||
from buttercup.orchestrator.competition_api_client.models.types_patch_submission import TypesPatchSubmission
|
||||
from buttercup.orchestrator.competition_api_client.models.types_patch_submission_response import (
|
||||
TypesPatchSubmissionResponse,
|
||||
)
|
||||
from buttercup.orchestrator.competition_api_client.models.types_patch_submission_response import TypesPatchSubmissionResponse
|
||||
from buttercup.orchestrator.competition_api_client.models.types_ping_response import TypesPingResponse
|
||||
from buttercup.orchestrator.competition_api_client.models.types_request_list_response import TypesRequestListResponse
|
||||
from buttercup.orchestrator.competition_api_client.models.types_request_submission import TypesRequestSubmission
|
||||
from buttercup.orchestrator.competition_api_client.models.types_sarif_submission import TypesSARIFSubmission
|
||||
from buttercup.orchestrator.competition_api_client.models.types_sarif_submission_response import (
|
||||
TypesSARIFSubmissionResponse,
|
||||
)
|
||||
from buttercup.orchestrator.competition_api_client.models.types_sarif_assessment_response import (
|
||||
TypesSarifAssessmentResponse,
|
||||
)
|
||||
from buttercup.orchestrator.competition_api_client.models.types_sarif_assessment_submission import (
|
||||
TypesSarifAssessmentSubmission,
|
||||
)
|
||||
from buttercup.orchestrator.competition_api_client.models.types_sarif_submission_response import TypesSARIFSubmissionResponse
|
||||
from buttercup.orchestrator.competition_api_client.models.types_sarif_assessment_response import TypesSarifAssessmentResponse
|
||||
from buttercup.orchestrator.competition_api_client.models.types_sarif_assessment_submission import TypesSarifAssessmentSubmission
|
||||
from buttercup.orchestrator.competition_api_client.models.types_submission_status import TypesSubmissionStatus
|
||||
|
||||
+9
-7
@@ -1,14 +1,14 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Example Competition API
|
||||
Example Competition API
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: 1.4.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
The version of the OpenAPI document: 1.4.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
@@ -26,10 +26,12 @@ class TypesArchitecture(str, Enum):
|
||||
"""
|
||||
allowed enum values
|
||||
"""
|
||||
ArchitectureX8664 = "x86_64"
|
||||
ArchitectureAArch64 = "aarch64"
|
||||
ArchitectureX8664 = 'x86_64'
|
||||
ArchitectureAArch64 = 'aarch64'
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Self:
|
||||
"""Create an instance of TypesArchitecture from a JSON string"""
|
||||
return cls(json.loads(json_str))
|
||||
|
||||
|
||||
|
||||
+9
-7
@@ -1,14 +1,14 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Example Competition API
|
||||
Example Competition API
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: 1.4.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
The version of the OpenAPI document: 1.4.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
@@ -26,10 +26,12 @@ class TypesAssessment(str, Enum):
|
||||
"""
|
||||
allowed enum values
|
||||
"""
|
||||
AssessmentCorrect = "correct"
|
||||
AssessmentIncorrect = "incorrect"
|
||||
AssessmentCorrect = 'correct'
|
||||
AssessmentIncorrect = 'incorrect'
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Self:
|
||||
"""Create an instance of TypesAssessment from a JSON string"""
|
||||
return cls(json.loads(json_str))
|
||||
|
||||
|
||||
|
||||
+21
-31
@@ -1,14 +1,14 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Example Competition API
|
||||
Example Competition API
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: 1.4.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
The version of the OpenAPI document: 1.4.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
@@ -22,29 +22,17 @@ from typing import Any, ClassVar, Dict, List, Optional
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
|
||||
class TypesBundleSubmission(BaseModel):
|
||||
"""
|
||||
TypesBundleSubmission
|
||||
""" # noqa: E501
|
||||
|
||||
""" # noqa: E501
|
||||
broadcast_sarif_id: Optional[StrictStr] = None
|
||||
description: Optional[StrictStr] = Field(
|
||||
default=None,
|
||||
description="optional plaintext description of the components of the bundle, such as would be found in a pull request description or bug report",
|
||||
)
|
||||
description: Optional[StrictStr] = Field(default=None, description="optional plaintext description of the components of the bundle, such as would be found in a pull request description or bug report")
|
||||
freeform_id: Optional[StrictStr] = None
|
||||
patch_id: Optional[StrictStr] = None
|
||||
pov_id: Optional[StrictStr] = None
|
||||
submitted_sarif_id: Optional[StrictStr] = None
|
||||
__properties: ClassVar[List[str]] = [
|
||||
"broadcast_sarif_id",
|
||||
"description",
|
||||
"freeform_id",
|
||||
"patch_id",
|
||||
"pov_id",
|
||||
"submitted_sarif_id",
|
||||
]
|
||||
__properties: ClassVar[List[str]] = ["broadcast_sarif_id", "description", "freeform_id", "patch_id", "pov_id", "submitted_sarif_id"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
@@ -52,6 +40,7 @@ class TypesBundleSubmission(BaseModel):
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
@@ -76,7 +65,8 @@ class TypesBundleSubmission(BaseModel):
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([])
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
@@ -94,14 +84,14 @@ class TypesBundleSubmission(BaseModel):
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate(
|
||||
{
|
||||
"broadcast_sarif_id": obj.get("broadcast_sarif_id"),
|
||||
"description": obj.get("description"),
|
||||
"freeform_id": obj.get("freeform_id"),
|
||||
"patch_id": obj.get("patch_id"),
|
||||
"pov_id": obj.get("pov_id"),
|
||||
"submitted_sarif_id": obj.get("submitted_sarif_id"),
|
||||
}
|
||||
)
|
||||
_obj = cls.model_validate({
|
||||
"broadcast_sarif_id": obj.get("broadcast_sarif_id"),
|
||||
"description": obj.get("description"),
|
||||
"freeform_id": obj.get("freeform_id"),
|
||||
"patch_id": obj.get("patch_id"),
|
||||
"pov_id": obj.get("pov_id"),
|
||||
"submitted_sarif_id": obj.get("submitted_sarif_id")
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
|
||||
+16
-13
@@ -1,14 +1,14 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Example Competition API
|
||||
Example Competition API
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: 1.4.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
The version of the OpenAPI document: 1.4.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
@@ -23,16 +23,12 @@ from buttercup.orchestrator.competition_api_client.models.types_submission_statu
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
|
||||
class TypesBundleSubmissionResponse(BaseModel):
|
||||
"""
|
||||
TypesBundleSubmissionResponse
|
||||
""" # noqa: E501
|
||||
|
||||
""" # noqa: E501
|
||||
bundle_id: StrictStr
|
||||
status: TypesSubmissionStatus = Field(
|
||||
description="Schema-compliant submissions will only ever receive the statuses accepted or deadline_exceeded"
|
||||
)
|
||||
status: TypesSubmissionStatus = Field(description="Schema-compliant submissions will only ever receive the statuses accepted or deadline_exceeded")
|
||||
__properties: ClassVar[List[str]] = ["bundle_id", "status"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
@@ -41,6 +37,7 @@ class TypesBundleSubmissionResponse(BaseModel):
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
@@ -65,7 +62,8 @@ class TypesBundleSubmissionResponse(BaseModel):
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([])
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
@@ -83,5 +81,10 @@ class TypesBundleSubmissionResponse(BaseModel):
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({"bundle_id": obj.get("bundle_id"), "status": obj.get("status")})
|
||||
_obj = cls.model_validate({
|
||||
"bundle_id": obj.get("bundle_id"),
|
||||
"status": obj.get("status")
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
|
||||
+23
-34
@@ -1,14 +1,14 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Example Competition API
|
||||
Example Competition API
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: 1.4.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
The version of the OpenAPI document: 1.4.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
@@ -23,32 +23,19 @@ from buttercup.orchestrator.competition_api_client.models.types_submission_statu
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
|
||||
class TypesBundleSubmissionResponseVerbose(BaseModel):
|
||||
"""
|
||||
TypesBundleSubmissionResponseVerbose
|
||||
""" # noqa: E501
|
||||
|
||||
""" # noqa: E501
|
||||
broadcast_sarif_id: Optional[StrictStr] = None
|
||||
bundle_id: StrictStr
|
||||
description: Optional[StrictStr] = None
|
||||
freeform_id: Optional[StrictStr] = None
|
||||
patch_id: Optional[StrictStr] = None
|
||||
pov_id: Optional[StrictStr] = None
|
||||
status: TypesSubmissionStatus = Field(
|
||||
description="Schema-compliant submissions will only ever receive the statuses accepted or deadline_exceeded"
|
||||
)
|
||||
status: TypesSubmissionStatus = Field(description="Schema-compliant submissions will only ever receive the statuses accepted or deadline_exceeded")
|
||||
submitted_sarif_id: Optional[StrictStr] = None
|
||||
__properties: ClassVar[List[str]] = [
|
||||
"broadcast_sarif_id",
|
||||
"bundle_id",
|
||||
"description",
|
||||
"freeform_id",
|
||||
"patch_id",
|
||||
"pov_id",
|
||||
"status",
|
||||
"submitted_sarif_id",
|
||||
]
|
||||
__properties: ClassVar[List[str]] = ["broadcast_sarif_id", "bundle_id", "description", "freeform_id", "patch_id", "pov_id", "status", "submitted_sarif_id"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
@@ -56,6 +43,7 @@ class TypesBundleSubmissionResponseVerbose(BaseModel):
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
@@ -80,7 +68,8 @@ class TypesBundleSubmissionResponseVerbose(BaseModel):
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([])
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
@@ -98,16 +87,16 @@ class TypesBundleSubmissionResponseVerbose(BaseModel):
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate(
|
||||
{
|
||||
"broadcast_sarif_id": obj.get("broadcast_sarif_id"),
|
||||
"bundle_id": obj.get("bundle_id"),
|
||||
"description": obj.get("description"),
|
||||
"freeform_id": obj.get("freeform_id"),
|
||||
"patch_id": obj.get("patch_id"),
|
||||
"pov_id": obj.get("pov_id"),
|
||||
"status": obj.get("status"),
|
||||
"submitted_sarif_id": obj.get("submitted_sarif_id"),
|
||||
}
|
||||
)
|
||||
_obj = cls.model_validate({
|
||||
"broadcast_sarif_id": obj.get("broadcast_sarif_id"),
|
||||
"bundle_id": obj.get("bundle_id"),
|
||||
"description": obj.get("description"),
|
||||
"freeform_id": obj.get("freeform_id"),
|
||||
"patch_id": obj.get("patch_id"),
|
||||
"pov_id": obj.get("pov_id"),
|
||||
"status": obj.get("status"),
|
||||
"submitted_sarif_id": obj.get("submitted_sarif_id")
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
|
||||
+15
-10
@@ -1,14 +1,14 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Example Competition API
|
||||
Example Competition API
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: 1.4.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
The version of the OpenAPI document: 1.4.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
@@ -22,12 +22,10 @@ from typing import Any, ClassVar, Dict, List, Optional
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
|
||||
class TypesError(BaseModel):
|
||||
"""
|
||||
TypesError
|
||||
""" # noqa: E501
|
||||
|
||||
""" # noqa: E501
|
||||
fields: Optional[Dict[str, StrictStr]] = None
|
||||
message: StrictStr
|
||||
__properties: ClassVar[List[str]] = ["fields", "message"]
|
||||
@@ -38,6 +36,7 @@ class TypesError(BaseModel):
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
@@ -62,7 +61,8 @@ class TypesError(BaseModel):
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([])
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
@@ -80,5 +80,10 @@ class TypesError(BaseModel):
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({"fields": obj.get("fields"), "message": obj.get("message")})
|
||||
_obj = cls.model_validate({
|
||||
"fields": obj.get("fields"),
|
||||
"message": obj.get("message")
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
|
||||
+16
-13
@@ -1,14 +1,14 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Example Competition API
|
||||
Example Competition API
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: 1.4.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
The version of the OpenAPI document: 1.4.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
@@ -23,16 +23,12 @@ from buttercup.orchestrator.competition_api_client.models.types_submission_statu
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
|
||||
class TypesFreeformResponse(BaseModel):
|
||||
"""
|
||||
TypesFreeformResponse
|
||||
""" # noqa: E501
|
||||
|
||||
""" # noqa: E501
|
||||
freeform_id: StrictStr
|
||||
status: TypesSubmissionStatus = Field(
|
||||
description="Schema-compliant submissions will only ever receive the statuses accepted or deadline_exceeded"
|
||||
)
|
||||
status: TypesSubmissionStatus = Field(description="Schema-compliant submissions will only ever receive the statuses accepted or deadline_exceeded")
|
||||
__properties: ClassVar[List[str]] = ["freeform_id", "status"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
@@ -41,6 +37,7 @@ class TypesFreeformResponse(BaseModel):
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
@@ -65,7 +62,8 @@ class TypesFreeformResponse(BaseModel):
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([])
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
@@ -83,5 +81,10 @@ class TypesFreeformResponse(BaseModel):
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({"freeform_id": obj.get("freeform_id"), "status": obj.get("status")})
|
||||
_obj = cls.model_validate({
|
||||
"freeform_id": obj.get("freeform_id"),
|
||||
"status": obj.get("status")
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
|
||||
+14
-10
@@ -1,14 +1,14 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Example Competition API
|
||||
Example Competition API
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: 1.4.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
The version of the OpenAPI document: 1.4.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
@@ -22,12 +22,10 @@ from typing import Any, ClassVar, Dict, List
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
|
||||
class TypesFreeformSubmission(BaseModel):
|
||||
"""
|
||||
TypesFreeformSubmission
|
||||
""" # noqa: E501
|
||||
|
||||
""" # noqa: E501
|
||||
submission: StrictStr = Field(description="Base64 encoded arbitrary data 2MiB max size before Base64 encoding")
|
||||
__properties: ClassVar[List[str]] = ["submission"]
|
||||
|
||||
@@ -37,6 +35,7 @@ class TypesFreeformSubmission(BaseModel):
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
@@ -61,7 +60,8 @@ class TypesFreeformSubmission(BaseModel):
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([])
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
@@ -79,5 +79,9 @@ class TypesFreeformSubmission(BaseModel):
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({"submission": obj.get("submission")})
|
||||
_obj = cls.model_validate({
|
||||
"submission": obj.get("submission")
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
|
||||
+8
-6
@@ -1,14 +1,14 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Example Competition API
|
||||
Example Competition API
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: 1.4.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
The version of the OpenAPI document: 1.4.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
@@ -26,9 +26,11 @@ class TypesFuzzingEngine(str, Enum):
|
||||
"""
|
||||
allowed enum values
|
||||
"""
|
||||
FuzzingEngineLibFuzzer = "libfuzzer"
|
||||
FuzzingEngineLibFuzzer = 'libfuzzer'
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Self:
|
||||
"""Create an instance of TypesFuzzingEngine from a JSON string"""
|
||||
return cls(json.loads(json_str))
|
||||
|
||||
|
||||
|
||||
+14
-10
@@ -1,14 +1,14 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Example Competition API
|
||||
Example Competition API
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: 1.4.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
The version of the OpenAPI document: 1.4.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
@@ -22,12 +22,10 @@ from typing import Any, ClassVar, Dict, List, Optional
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
|
||||
class TypesMessage(BaseModel):
|
||||
"""
|
||||
TypesMessage
|
||||
""" # noqa: E501
|
||||
|
||||
""" # noqa: E501
|
||||
message: Optional[StrictStr] = None
|
||||
__properties: ClassVar[List[str]] = ["message"]
|
||||
|
||||
@@ -37,6 +35,7 @@ class TypesMessage(BaseModel):
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
@@ -61,7 +60,8 @@ class TypesMessage(BaseModel):
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([])
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
@@ -79,5 +79,9 @@ class TypesMessage(BaseModel):
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({"message": obj.get("message")})
|
||||
_obj = cls.model_validate({
|
||||
"message": obj.get("message")
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
|
||||
+15
-13
@@ -1,14 +1,14 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Example Competition API
|
||||
Example Competition API
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: 1.4.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
The version of the OpenAPI document: 1.4.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
@@ -22,15 +22,11 @@ from typing import Any, ClassVar, Dict, List
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
|
||||
class TypesPatchSubmission(BaseModel):
|
||||
"""
|
||||
TypesPatchSubmission
|
||||
""" # noqa: E501
|
||||
|
||||
patch: StrictStr = Field(
|
||||
description="Base64 encoded patch in unified diff format 100KiB max size before Base64 encoding"
|
||||
)
|
||||
""" # noqa: E501
|
||||
patch: StrictStr = Field(description="Base64 encoded patch in unified diff format 100KiB max size before Base64 encoding")
|
||||
__properties: ClassVar[List[str]] = ["patch"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
@@ -39,6 +35,7 @@ class TypesPatchSubmission(BaseModel):
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
@@ -63,7 +60,8 @@ class TypesPatchSubmission(BaseModel):
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([])
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
@@ -81,5 +79,9 @@ class TypesPatchSubmission(BaseModel):
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({"patch": obj.get("patch")})
|
||||
_obj = cls.model_validate({
|
||||
"patch": obj.get("patch")
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
|
||||
+17
-19
@@ -1,14 +1,14 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Example Competition API
|
||||
Example Competition API
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: 1.4.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
The version of the OpenAPI document: 1.4.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
@@ -23,15 +23,11 @@ from buttercup.orchestrator.competition_api_client.models.types_submission_statu
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
|
||||
class TypesPatchSubmissionResponse(BaseModel):
|
||||
"""
|
||||
TypesPatchSubmissionResponse
|
||||
""" # noqa: E501
|
||||
|
||||
functionality_tests_passing: Optional[StrictBool] = Field(
|
||||
default=None, description="null indicates the tests have not been run"
|
||||
)
|
||||
""" # noqa: E501
|
||||
functionality_tests_passing: Optional[StrictBool] = Field(default=None, description="null indicates the tests have not been run")
|
||||
patch_id: StrictStr
|
||||
status: TypesSubmissionStatus
|
||||
__properties: ClassVar[List[str]] = ["functionality_tests_passing", "patch_id", "status"]
|
||||
@@ -42,6 +38,7 @@ class TypesPatchSubmissionResponse(BaseModel):
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
@@ -66,7 +63,8 @@ class TypesPatchSubmissionResponse(BaseModel):
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([])
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
@@ -84,11 +82,11 @@ class TypesPatchSubmissionResponse(BaseModel):
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate(
|
||||
{
|
||||
"functionality_tests_passing": obj.get("functionality_tests_passing"),
|
||||
"patch_id": obj.get("patch_id"),
|
||||
"status": obj.get("status"),
|
||||
}
|
||||
)
|
||||
_obj = cls.model_validate({
|
||||
"functionality_tests_passing": obj.get("functionality_tests_passing"),
|
||||
"patch_id": obj.get("patch_id"),
|
||||
"status": obj.get("status")
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
|
||||
+14
-10
@@ -1,14 +1,14 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Example Competition API
|
||||
Example Competition API
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: 1.4.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
The version of the OpenAPI document: 1.4.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
@@ -22,12 +22,10 @@ from typing import Any, ClassVar, Dict, List
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
|
||||
class TypesPingResponse(BaseModel):
|
||||
"""
|
||||
TypesPingResponse
|
||||
""" # noqa: E501
|
||||
|
||||
""" # noqa: E501
|
||||
status: StrictStr
|
||||
__properties: ClassVar[List[str]] = ["status"]
|
||||
|
||||
@@ -37,6 +35,7 @@ class TypesPingResponse(BaseModel):
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
@@ -61,7 +60,8 @@ class TypesPingResponse(BaseModel):
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([])
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
@@ -79,5 +79,9 @@ class TypesPingResponse(BaseModel):
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({"status": obj.get("status")})
|
||||
_obj = cls.model_validate({
|
||||
"status": obj.get("status")
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
|
||||
+20
-24
@@ -1,14 +1,14 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Example Competition API
|
||||
Example Competition API
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: 1.4.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
The version of the OpenAPI document: 1.4.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
@@ -25,20 +25,14 @@ from buttercup.orchestrator.competition_api_client.models.types_fuzzing_engine i
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
|
||||
class TypesPOVSubmission(BaseModel):
|
||||
"""
|
||||
TypesPOVSubmission
|
||||
""" # noqa: E501
|
||||
|
||||
""" # noqa: E501
|
||||
architecture: TypesArchitecture
|
||||
engine: TypesFuzzingEngine
|
||||
fuzzer_name: Annotated[str, Field(strict=True, max_length=4096)] = Field(
|
||||
description="Fuzz Tooling fuzzer that exercises this vuln 4KiB max size"
|
||||
)
|
||||
sanitizer: Annotated[str, Field(strict=True, max_length=4096)] = Field(
|
||||
description="Fuzz Tooling Sanitizer that exercises this vuln 4KiB max size"
|
||||
)
|
||||
fuzzer_name: Annotated[str, Field(strict=True, max_length=4096)] = Field(description="Fuzz Tooling fuzzer that exercises this vuln 4KiB max size")
|
||||
sanitizer: Annotated[str, Field(strict=True, max_length=4096)] = Field(description="Fuzz Tooling Sanitizer that exercises this vuln 4KiB max size")
|
||||
testcase: StrictStr = Field(description="Base64 encoded vuln trigger 2MiB max size before Base64 encoding")
|
||||
__properties: ClassVar[List[str]] = ["architecture", "engine", "fuzzer_name", "sanitizer", "testcase"]
|
||||
|
||||
@@ -48,6 +42,7 @@ class TypesPOVSubmission(BaseModel):
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
@@ -72,7 +67,8 @@ class TypesPOVSubmission(BaseModel):
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([])
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
@@ -90,13 +86,13 @@ class TypesPOVSubmission(BaseModel):
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate(
|
||||
{
|
||||
"architecture": obj.get("architecture"),
|
||||
"engine": obj.get("engine"),
|
||||
"fuzzer_name": obj.get("fuzzer_name"),
|
||||
"sanitizer": obj.get("sanitizer"),
|
||||
"testcase": obj.get("testcase"),
|
||||
}
|
||||
)
|
||||
_obj = cls.model_validate({
|
||||
"architecture": obj.get("architecture"),
|
||||
"engine": obj.get("engine"),
|
||||
"fuzzer_name": obj.get("fuzzer_name"),
|
||||
"sanitizer": obj.get("sanitizer"),
|
||||
"testcase": obj.get("testcase")
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
|
||||
+15
-10
@@ -1,14 +1,14 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Example Competition API
|
||||
Example Competition API
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: 1.4.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
The version of the OpenAPI document: 1.4.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
@@ -23,12 +23,10 @@ from buttercup.orchestrator.competition_api_client.models.types_submission_statu
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
|
||||
class TypesPOVSubmissionResponse(BaseModel):
|
||||
"""
|
||||
TypesPOVSubmissionResponse
|
||||
""" # noqa: E501
|
||||
|
||||
""" # noqa: E501
|
||||
pov_id: StrictStr
|
||||
status: TypesSubmissionStatus
|
||||
__properties: ClassVar[List[str]] = ["pov_id", "status"]
|
||||
@@ -39,6 +37,7 @@ class TypesPOVSubmissionResponse(BaseModel):
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
@@ -63,7 +62,8 @@ class TypesPOVSubmissionResponse(BaseModel):
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([])
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
@@ -81,5 +81,10 @@ class TypesPOVSubmissionResponse(BaseModel):
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({"pov_id": obj.get("pov_id"), "status": obj.get("status")})
|
||||
_obj = cls.model_validate({
|
||||
"pov_id": obj.get("pov_id"),
|
||||
"status": obj.get("status")
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
|
||||
+14
-10
@@ -1,14 +1,14 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Example Competition API
|
||||
Example Competition API
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: 1.4.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
The version of the OpenAPI document: 1.4.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
@@ -22,12 +22,10 @@ from typing import Any, ClassVar, Dict, List
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
|
||||
class TypesRequestListResponse(BaseModel):
|
||||
"""
|
||||
TypesRequestListResponse
|
||||
""" # noqa: E501
|
||||
|
||||
""" # noqa: E501
|
||||
challenges: List[StrictStr] = Field(description="List of challenges that competitors may task themselves with")
|
||||
__properties: ClassVar[List[str]] = ["challenges"]
|
||||
|
||||
@@ -37,6 +35,7 @@ class TypesRequestListResponse(BaseModel):
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
@@ -61,7 +60,8 @@ class TypesRequestListResponse(BaseModel):
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([])
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
@@ -79,5 +79,9 @@ class TypesRequestListResponse(BaseModel):
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({"challenges": obj.get("challenges")})
|
||||
_obj = cls.model_validate({
|
||||
"challenges": obj.get("challenges")
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
|
||||
+15
-13
@@ -1,14 +1,14 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Example Competition API
|
||||
Example Competition API
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: 1.4.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
The version of the OpenAPI document: 1.4.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
@@ -22,15 +22,11 @@ from typing import Any, ClassVar, Dict, List, Optional
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
|
||||
class TypesRequestSubmission(BaseModel):
|
||||
"""
|
||||
TypesRequestSubmission
|
||||
""" # noqa: E501
|
||||
|
||||
duration_secs: Optional[StrictInt] = Field(
|
||||
default=None, description="Time in seconds until a task should expire. If not provided, defaults to 3600."
|
||||
)
|
||||
""" # noqa: E501
|
||||
duration_secs: Optional[StrictInt] = Field(default=None, description="Time in seconds until a task should expire. If not provided, defaults to 3600.")
|
||||
__properties: ClassVar[List[str]] = ["duration_secs"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
@@ -39,6 +35,7 @@ class TypesRequestSubmission(BaseModel):
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
@@ -63,7 +60,8 @@ class TypesRequestSubmission(BaseModel):
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([])
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
@@ -81,5 +79,9 @@ class TypesRequestSubmission(BaseModel):
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({"duration_secs": obj.get("duration_secs")})
|
||||
_obj = cls.model_validate({
|
||||
"duration_secs": obj.get("duration_secs")
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
|
||||
+14
-10
@@ -1,14 +1,14 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Example Competition API
|
||||
Example Competition API
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: 1.4.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
The version of the OpenAPI document: 1.4.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
@@ -23,12 +23,10 @@ from buttercup.orchestrator.competition_api_client.models.types_submission_statu
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
|
||||
class TypesSarifAssessmentResponse(BaseModel):
|
||||
"""
|
||||
TypesSarifAssessmentResponse
|
||||
""" # noqa: E501
|
||||
|
||||
""" # noqa: E501
|
||||
status: TypesSubmissionStatus
|
||||
__properties: ClassVar[List[str]] = ["status"]
|
||||
|
||||
@@ -38,6 +36,7 @@ class TypesSarifAssessmentResponse(BaseModel):
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
@@ -62,7 +61,8 @@ class TypesSarifAssessmentResponse(BaseModel):
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([])
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
@@ -80,5 +80,9 @@ class TypesSarifAssessmentResponse(BaseModel):
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({"status": obj.get("status")})
|
||||
_obj = cls.model_validate({
|
||||
"status": obj.get("status")
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
|
||||
+16
-13
@@ -1,14 +1,14 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Example Competition API
|
||||
Example Competition API
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: 1.4.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
The version of the OpenAPI document: 1.4.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
@@ -24,16 +24,12 @@ from buttercup.orchestrator.competition_api_client.models.types_assessment impor
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
|
||||
class TypesSarifAssessmentSubmission(BaseModel):
|
||||
"""
|
||||
TypesSarifAssessmentSubmission
|
||||
""" # noqa: E501
|
||||
|
||||
""" # noqa: E501
|
||||
assessment: TypesAssessment
|
||||
description: Annotated[str, Field(strict=True, max_length=131072)] = Field(
|
||||
description="Plain text reasoning for the assessment. Must be nonempty. 128KiB max size"
|
||||
)
|
||||
description: Annotated[str, Field(strict=True, max_length=131072)] = Field(description="Plain text reasoning for the assessment. Must be nonempty. 128KiB max size")
|
||||
__properties: ClassVar[List[str]] = ["assessment", "description"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
@@ -42,6 +38,7 @@ class TypesSarifAssessmentSubmission(BaseModel):
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
@@ -66,7 +63,8 @@ class TypesSarifAssessmentSubmission(BaseModel):
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([])
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
@@ -84,5 +82,10 @@ class TypesSarifAssessmentSubmission(BaseModel):
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({"assessment": obj.get("assessment"), "description": obj.get("description")})
|
||||
_obj = cls.model_validate({
|
||||
"assessment": obj.get("assessment"),
|
||||
"description": obj.get("description")
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
|
||||
+14
-10
@@ -1,14 +1,14 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Example Competition API
|
||||
Example Competition API
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: 1.4.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
The version of the OpenAPI document: 1.4.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
@@ -22,12 +22,10 @@ from typing import Any, ClassVar, Dict, List
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
|
||||
class TypesSARIFSubmission(BaseModel):
|
||||
"""
|
||||
TypesSARIFSubmission
|
||||
""" # noqa: E501
|
||||
|
||||
""" # noqa: E501
|
||||
sarif: Dict[str, Any] = Field(description="SARIF object compliant with the provided schema")
|
||||
__properties: ClassVar[List[str]] = ["sarif"]
|
||||
|
||||
@@ -37,6 +35,7 @@ class TypesSARIFSubmission(BaseModel):
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
@@ -61,7 +60,8 @@ class TypesSARIFSubmission(BaseModel):
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([])
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
@@ -79,5 +79,9 @@ class TypesSARIFSubmission(BaseModel):
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({"sarif": obj.get("sarif")})
|
||||
_obj = cls.model_validate({
|
||||
"sarif": obj.get("sarif")
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
|
||||
+16
-13
@@ -1,14 +1,14 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Example Competition API
|
||||
Example Competition API
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: 1.4.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
The version of the OpenAPI document: 1.4.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
@@ -23,15 +23,11 @@ from buttercup.orchestrator.competition_api_client.models.types_submission_statu
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
|
||||
class TypesSARIFSubmissionResponse(BaseModel):
|
||||
"""
|
||||
TypesSARIFSubmissionResponse
|
||||
""" # noqa: E501
|
||||
|
||||
status: TypesSubmissionStatus = Field(
|
||||
description="Schema-compliant submissions will only ever receive the statuses accepted or deadline_exceeded"
|
||||
)
|
||||
""" # noqa: E501
|
||||
status: TypesSubmissionStatus = Field(description="Schema-compliant submissions will only ever receive the statuses accepted or deadline_exceeded")
|
||||
submitted_sarif_id: StrictStr
|
||||
__properties: ClassVar[List[str]] = ["status", "submitted_sarif_id"]
|
||||
|
||||
@@ -41,6 +37,7 @@ class TypesSARIFSubmissionResponse(BaseModel):
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
@@ -65,7 +62,8 @@ class TypesSARIFSubmissionResponse(BaseModel):
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([])
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
@@ -83,5 +81,10 @@ class TypesSARIFSubmissionResponse(BaseModel):
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({"status": obj.get("status"), "submitted_sarif_id": obj.get("submitted_sarif_id")})
|
||||
_obj = cls.model_validate({
|
||||
"status": obj.get("status"),
|
||||
"submitted_sarif_id": obj.get("submitted_sarif_id")
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
|
||||
+13
-11
@@ -1,14 +1,14 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Example Competition API
|
||||
Example Competition API
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: 1.4.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
The version of the OpenAPI document: 1.4.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
@@ -26,14 +26,16 @@ class TypesSubmissionStatus(str, Enum):
|
||||
"""
|
||||
allowed enum values
|
||||
"""
|
||||
SubmissionStatusAccepted = "accepted"
|
||||
SubmissionStatusPassed = "passed"
|
||||
SubmissionStatusFailed = "failed"
|
||||
SubmissionStatusDeadlineExceeded = "deadline_exceeded"
|
||||
SubmissionStatusErrored = "errored"
|
||||
SubmissionStatusInconclusive = "inconclusive"
|
||||
SubmissionStatusAccepted = 'accepted'
|
||||
SubmissionStatusPassed = 'passed'
|
||||
SubmissionStatusFailed = 'failed'
|
||||
SubmissionStatusDeadlineExceeded = 'deadline_exceeded'
|
||||
SubmissionStatusErrored = 'errored'
|
||||
SubmissionStatusInconclusive = 'inconclusive'
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Self:
|
||||
"""Create an instance of TypesSubmissionStatus from a JSON string"""
|
||||
return cls(json.loads(json_str))
|
||||
|
||||
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Example Competition API
|
||||
Example Competition API
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: 1.4.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
The version of the OpenAPI document: 1.4.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
@@ -79,19 +79,22 @@ class RESTClientObject:
|
||||
"ca_cert_data": configuration.ca_cert_data,
|
||||
}
|
||||
if configuration.assert_hostname is not None:
|
||||
pool_args["assert_hostname"] = configuration.assert_hostname
|
||||
pool_args['assert_hostname'] = (
|
||||
configuration.assert_hostname
|
||||
)
|
||||
|
||||
if configuration.retries is not None:
|
||||
pool_args["retries"] = configuration.retries
|
||||
pool_args['retries'] = configuration.retries
|
||||
|
||||
if configuration.tls_server_name:
|
||||
pool_args["server_hostname"] = configuration.tls_server_name
|
||||
pool_args['server_hostname'] = configuration.tls_server_name
|
||||
|
||||
|
||||
if configuration.socket_options is not None:
|
||||
pool_args["socket_options"] = configuration.socket_options
|
||||
pool_args['socket_options'] = configuration.socket_options
|
||||
|
||||
if configuration.connection_pool_maxsize is not None:
|
||||
pool_args["maxsize"] = configuration.connection_pool_maxsize
|
||||
pool_args['maxsize'] = configuration.connection_pool_maxsize
|
||||
|
||||
# https pool manager
|
||||
self.pool_manager: urllib3.PoolManager
|
||||
@@ -99,7 +102,6 @@ class RESTClientObject:
|
||||
if configuration.proxy:
|
||||
if is_socks_proxy_url(configuration.proxy):
|
||||
from urllib3.contrib.socks import SOCKSProxyManager
|
||||
|
||||
pool_args["proxy_url"] = configuration.proxy
|
||||
pool_args["headers"] = configuration.proxy_headers
|
||||
self.pool_manager = SOCKSProxyManager(**pool_args)
|
||||
@@ -110,7 +112,15 @@ class RESTClientObject:
|
||||
else:
|
||||
self.pool_manager = urllib3.PoolManager(**pool_args)
|
||||
|
||||
def request(self, method, url, headers=None, body=None, post_params=None, _request_timeout=None):
|
||||
def request(
|
||||
self,
|
||||
method,
|
||||
url,
|
||||
headers=None,
|
||||
body=None,
|
||||
post_params=None,
|
||||
_request_timeout=None
|
||||
):
|
||||
"""Perform requests.
|
||||
|
||||
:param method: http request method
|
||||
@@ -126,10 +136,20 @@ class RESTClientObject:
|
||||
(connection, read) timeouts.
|
||||
"""
|
||||
method = method.upper()
|
||||
assert method in ["GET", "HEAD", "DELETE", "POST", "PUT", "PATCH", "OPTIONS"]
|
||||
assert method in [
|
||||
'GET',
|
||||
'HEAD',
|
||||
'DELETE',
|
||||
'POST',
|
||||
'PUT',
|
||||
'PATCH',
|
||||
'OPTIONS'
|
||||
]
|
||||
|
||||
if post_params and body:
|
||||
raise ApiValueError("body parameter cannot be used with post_params parameter.")
|
||||
raise ApiValueError(
|
||||
"body parameter cannot be used with post_params parameter."
|
||||
)
|
||||
|
||||
post_params = post_params or {}
|
||||
headers = headers or {}
|
||||
@@ -138,23 +158,37 @@ class RESTClientObject:
|
||||
if _request_timeout:
|
||||
if isinstance(_request_timeout, (int, float)):
|
||||
timeout = urllib3.Timeout(total=_request_timeout)
|
||||
elif isinstance(_request_timeout, tuple) and len(_request_timeout) == 2:
|
||||
timeout = urllib3.Timeout(connect=_request_timeout[0], read=_request_timeout[1])
|
||||
elif (
|
||||
isinstance(_request_timeout, tuple)
|
||||
and len(_request_timeout) == 2
|
||||
):
|
||||
timeout = urllib3.Timeout(
|
||||
connect=_request_timeout[0],
|
||||
read=_request_timeout[1]
|
||||
)
|
||||
|
||||
try:
|
||||
# For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE`
|
||||
if method in ["POST", "PUT", "PATCH", "OPTIONS", "DELETE"]:
|
||||
if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']:
|
||||
|
||||
# no content type provided or payload is json
|
||||
content_type = headers.get("Content-Type")
|
||||
if not content_type or re.search("json", content_type, re.IGNORECASE):
|
||||
content_type = headers.get('Content-Type')
|
||||
if (
|
||||
not content_type
|
||||
or re.search('json', content_type, re.IGNORECASE)
|
||||
):
|
||||
request_body = None
|
||||
if body is not None:
|
||||
request_body = json.dumps(body)
|
||||
r = self.pool_manager.request(
|
||||
method, url, body=request_body, timeout=timeout, headers=headers, preload_content=False
|
||||
method,
|
||||
url,
|
||||
body=request_body,
|
||||
timeout=timeout,
|
||||
headers=headers,
|
||||
preload_content=False
|
||||
)
|
||||
elif content_type == "application/x-www-form-urlencoded":
|
||||
elif content_type == 'application/x-www-form-urlencoded':
|
||||
r = self.pool_manager.request(
|
||||
method,
|
||||
url,
|
||||
@@ -162,15 +196,15 @@ class RESTClientObject:
|
||||
encode_multipart=False,
|
||||
timeout=timeout,
|
||||
headers=headers,
|
||||
preload_content=False,
|
||||
preload_content=False
|
||||
)
|
||||
elif content_type == "multipart/form-data":
|
||||
elif content_type == 'multipart/form-data':
|
||||
# must del headers['Content-Type'], or the correct
|
||||
# Content-Type which generated by urllib3 will be
|
||||
# overwritten.
|
||||
del headers["Content-Type"]
|
||||
del headers['Content-Type']
|
||||
# Ensures that dict objects are serialized
|
||||
post_params = [(a, json.dumps(b)) if isinstance(b, dict) else (a, b) for a, b in post_params]
|
||||
post_params = [(a, json.dumps(b)) if isinstance(b, dict) else (a,b) for a, b in post_params]
|
||||
r = self.pool_manager.request(
|
||||
method,
|
||||
url,
|
||||
@@ -178,20 +212,29 @@ class RESTClientObject:
|
||||
encode_multipart=True,
|
||||
timeout=timeout,
|
||||
headers=headers,
|
||||
preload_content=False,
|
||||
preload_content=False
|
||||
)
|
||||
# Pass a `string` parameter directly in the body to support
|
||||
# other content types than JSON when `body` argument is
|
||||
# provided in serialized form.
|
||||
elif isinstance(body, str) or isinstance(body, bytes):
|
||||
r = self.pool_manager.request(
|
||||
method, url, body=body, timeout=timeout, headers=headers, preload_content=False
|
||||
method,
|
||||
url,
|
||||
body=body,
|
||||
timeout=timeout,
|
||||
headers=headers,
|
||||
preload_content=False
|
||||
)
|
||||
elif headers["Content-Type"].startswith("text/") and isinstance(body, bool):
|
||||
elif headers['Content-Type'].startswith('text/') and isinstance(body, bool):
|
||||
request_body = "true" if body else "false"
|
||||
r = self.pool_manager.request(
|
||||
method, url, body=request_body, preload_content=False, timeout=timeout, headers=headers
|
||||
)
|
||||
method,
|
||||
url,
|
||||
body=request_body,
|
||||
preload_content=False,
|
||||
timeout=timeout,
|
||||
headers=headers)
|
||||
else:
|
||||
# Cannot generate the request from given parameters
|
||||
msg = """Cannot prepare a request message for provided
|
||||
@@ -201,7 +244,12 @@ class RESTClientObject:
|
||||
# For `GET`, `HEAD`
|
||||
else:
|
||||
r = self.pool_manager.request(
|
||||
method, url, fields={}, timeout=timeout, headers=headers, preload_content=False
|
||||
method,
|
||||
url,
|
||||
fields={},
|
||||
timeout=timeout,
|
||||
headers=headers,
|
||||
preload_content=False
|
||||
)
|
||||
except urllib3.exceptions.SSLError as e:
|
||||
msg = "\n".join([type(e).__name__, str(e)])
|
||||
|
||||
@@ -1,19 +1,18 @@
|
||||
import requests
|
||||
import requests.adapters
|
||||
from pydantic_settings import get_subcommand
|
||||
from redis import Redis
|
||||
from requests_file import FileAdapter
|
||||
|
||||
from buttercup.common.datastructures.msg_pb2 import SourceDetail, Task
|
||||
from buttercup.common.logger import setup_package_logger
|
||||
from buttercup.orchestrator.downloader.downloader import Downloader
|
||||
from buttercup.orchestrator.downloader.config import (
|
||||
DownloaderProcessCommand,
|
||||
DownloaderServeCommand,
|
||||
DownloaderSettings,
|
||||
DownloaderServeCommand,
|
||||
DownloaderProcessCommand,
|
||||
TaskType,
|
||||
)
|
||||
from buttercup.orchestrator.downloader.downloader import Downloader
|
||||
from buttercup.common.logger import setup_package_logger
|
||||
from pydantic_settings import get_subcommand
|
||||
from buttercup.common.datastructures.msg_pb2 import Task, SourceDetail
|
||||
from buttercup.orchestrator.utils import response_stream_to_file
|
||||
from redis import Redis
|
||||
import requests.adapters
|
||||
from requests_file import FileAdapter
|
||||
import requests
|
||||
|
||||
|
||||
def prepare_task(command: DownloaderProcessCommand, session: requests.Session) -> Task:
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
from pydantic_settings import BaseSettings, CliPositionalArg, CliSubCommand
|
||||
from pydantic import BaseModel
|
||||
from typing import Annotated
|
||||
from pydantic import Field
|
||||
from pathlib import Path
|
||||
from enum import Enum
|
||||
import time
|
||||
import uuid
|
||||
from enum import Enum
|
||||
from pathlib import Path
|
||||
from typing import Annotated
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
from pydantic_settings import BaseSettings, CliPositionalArg, CliSubCommand
|
||||
|
||||
|
||||
class DownloaderServeCommand(BaseModel):
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
import logging
|
||||
import tarfile
|
||||
import tempfile
|
||||
import uuid
|
||||
from dataclasses import dataclass, field
|
||||
from pathlib import Path
|
||||
|
||||
import requests
|
||||
from redis import Redis
|
||||
import tarfile
|
||||
from dataclasses import dataclass, field
|
||||
import uuid
|
||||
import tempfile
|
||||
from pathlib import Path
|
||||
from typing import Optional
|
||||
from requests.adapters import HTTPAdapter
|
||||
from urllib3.util.retry import Retry
|
||||
|
||||
import buttercup.common.node_local as node_local
|
||||
from buttercup.common.datastructures.msg_pb2 import SourceDetail, Task, TaskDownload, TaskReady
|
||||
from buttercup.common.queues import GroupNames, QueueFactory, QueueNames, ReliableQueue
|
||||
from buttercup.common.queues import QueueFactory, ReliableQueue, QueueNames, GroupNames
|
||||
from buttercup.common.datastructures.msg_pb2 import Task, SourceDetail, TaskDownload, TaskReady
|
||||
from buttercup.orchestrator.utils import response_stream_to_file
|
||||
from buttercup.common.task_meta import TaskMeta
|
||||
from redis import Redis
|
||||
from buttercup.common.task_registry import TaskRegistry
|
||||
from buttercup.common.utils import serve_loop
|
||||
from buttercup.orchestrator.utils import response_stream_to_file
|
||||
import buttercup.common.node_local as node_local
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -61,7 +61,7 @@ class Downloader:
|
||||
"""Creates and returns the directory path for a task"""
|
||||
return self.download_dir / task_id
|
||||
|
||||
def download_source(self, task_id: str, tmp_task_dir: Path, source: SourceDetail) -> Path | None:
|
||||
def download_source(self, task_id: str, tmp_task_dir: Path, source: SourceDetail) -> Optional[Path]:
|
||||
"""Downloads a source file and verifies its SHA256"""
|
||||
try:
|
||||
filepath = tmp_task_dir / str(uuid.uuid4())
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user