mate_common.models.challenge_broker module¶
Request and response models for the CHESS challenge broker’s APIs.
See doc/hacking.rst#History.
- class mate_common.models.challenge_broker.Blob(*, id: str, name: str, created_at: str)¶
Bases:
mate_common.models.challenge_broker._BrokerBase
Represents a reference for a zipped blob.
- Parameters
id (str) –
name (str) –
created_at (str) –
- Return type
None
- created_at: str¶
- id_: str¶
- name: str¶
- class mate_common.models.challenge_broker.Challenge(*, id: str, name: str, created_at: str)¶
Bases:
mate_common.models.challenge_broker._BrokerBase
Represents a brokered challenge.
- Parameters
id (str) –
name (str) –
created_at (str) –
- Return type
None
- created_at: str¶
- id_: str¶
- name: str¶
- class mate_common.models.challenge_broker.ChallengeMetadata(*, chess_challenge_metadata: str, poller: Dict[str, str], targets: List[mate_common.models.challenge_broker.ChallengeMetadataTarget])¶
Bases:
mate_common.models.challenge_broker._BrokerBase
Represents CHESS system metadata for a particular challenge.
CHESS system metadata is associated with particular targets for each challenge within the challenge broker.
See: https://chessconfluence.apogee-research.com/download/attachments/31195299/schema-0-5-0.json
- Parameters
chess_challenge_metadata (str) –
poller (Dict[str, str]) –
targets (List[mate_common.models.challenge_broker.ChallengeMetadataTarget]) –
- Return type
None
- poller: Dict[str, str]¶
- targets: List[mate_common.models.challenge_broker.ChallengeMetadataTarget]¶
- version: str¶
- class mate_common.models.challenge_broker.ChallengeMetadataPathType(value)¶
Bases:
str
,enum.Enum
Represents the type of a “typed” path, i.e.
ChallengeMetadataTypedPath.type_
.- C = 'C'¶
- CXX = 'C++'¶
- ELF = 'ELF'¶
- ES5 = 'ES5'¶
- JavaScript = 'JavaScript'¶
- class mate_common.models.challenge_broker.ChallengeMetadataTarget(*, name: str, role: mate_common.models.challenge_broker.ChallengeMetadataTargetRole, compose_service: str, main_source: mate_common.models.challenge_broker.ChallengeMetadataTypedPath, runtime: mate_common.models.challenge_broker.ChallengeMetadataTypedPath)¶
Bases:
mate_common.models.challenge_broker._BrokerBase
Represents an individual analysis target for a particular challenge.
This “target” does not correspond to the
Target
model, either conceptually or in structure: aChallengeMetadataTarget
represents an individual program (either source of binary) that can be analyzed, while aTarget
represents a variant of a particular challenge that may have multiple ``ChallengeMetadataTarget``s within it.- Parameters
name (str) –
role (mate_common.models.challenge_broker.ChallengeMetadataTargetRole) –
compose_service (str) –
main_source (mate_common.models.challenge_broker.ChallengeMetadataTypedPath) –
runtime (mate_common.models.challenge_broker.ChallengeMetadataTypedPath) –
- Return type
None
- compose_service: str¶
- name: str¶
- class mate_common.models.challenge_broker.ChallengeMetadataTargetRole(value)¶
Bases:
str
,enum.Enum
Valid CHESS metadata target roles.
- Client = 'client'¶
- Server = 'server'¶
- class mate_common.models.challenge_broker.ChallengeMetadataTypedPath(*, path: str, container_path: str, type: mate_common.models.challenge_broker.ChallengeMetadataPathType)¶
Bases:
mate_common.models.challenge_broker._BrokerBase
Represents a “typed” path for an individual target in the CHESS challenge metadata.
The “type” of a path indicates its expected contents, e.g. “ELF” for an ELF executable and “C” for source code written in C.
- Parameters
path (str) –
container_path (str) –
type (mate_common.models.challenge_broker.ChallengeMetadataPathType) –
- Return type
None
- container_path: str¶
- path: str¶
- class mate_common.models.challenge_broker.RequestedTarget(*, id: str, created_at: str, challenge_id: str, parent_id: str = None, blob_id: str, created_by: str = None, description: str = None, source_assisted: bool, build_log: str, status: str, metadata_: mate_common.models.challenge_broker.ChallengeMetadata)¶
Bases:
mate_common.models.challenge_broker._BrokerBase
Represents a “requested” target, i.e. one that’s been
POST``ed to the challenge broker and may or may not be in a ready state for consumption as a ``Target
.- Parameters
id (str) –
created_at (str) –
challenge_id (str) –
parent_id (Optional[str]) –
blob_id (str) –
created_by (Optional[str]) –
description (Optional[str]) –
source_assisted (bool) –
build_log (str) –
status (str) –
metadata_ (mate_common.models.challenge_broker.ChallengeMetadata) –
- Return type
None
- blob_id: str¶
- build_log: str¶
- challenge_id: str¶
- created_at: str¶
- created_by: Optional[str]¶
- description: Optional[str]¶
- id_: str¶
- parent_id: Optional[str]¶
- source_assisted: bool¶
- status: str¶
- class mate_common.models.challenge_broker.Target(*, id: str, created_at: str, challenge_id: str, parent_id: str = None, blob_id: str, created_by: str = None, description: str = None, source_assisted: bool, images: List[str], challenge_name: str, metadata_: mate_common.models.challenge_broker.ChallengeMetadata)¶
Bases:
mate_common.models.challenge_broker._BrokerBase
Represents an analyzable target.
- Parameters
id (str) –
created_at (str) –
challenge_id (str) –
parent_id (Optional[str]) –
blob_id (str) –
created_by (Optional[str]) –
description (Optional[str]) –
source_assisted (bool) –
images (List[str]) –
challenge_name (str) –
metadata_ (mate_common.models.challenge_broker.ChallengeMetadata) –
- Return type
None
- blob_id: str¶
- challenge_id: str¶
- challenge_name: str¶
- property compilation_image: Optional[str]¶
Returns the name of a Docker image suitable for compiling this target, if available.
- created_at: str¶
- created_by: Optional[str]¶
- description: Optional[str]¶
- id_: str¶
- images: List[str]¶
- parent_id: Optional[str]¶
- source_assisted: bool¶