mainframe.models.scan_cache

Bounded wire format for the optional durable scanner cache.

Attributes

Classes

CacheContext

!!! abstract "Usage Documentation"

CacheKey

!!! abstract "Usage Documentation"

CacheValue

!!! abstract "Usage Documentation"

CacheLookup

!!! abstract "Usage Documentation"

CacheReply

!!! abstract "Usage Documentation"

CacheLease

!!! abstract "Usage Documentation"

CacheWrite

!!! abstract "Usage Documentation"

CacheWriteReply

!!! abstract "Usage Documentation"

Module Contents

mainframe.models.scan_cache.MAX_RESULT_BYTES = 16384[source]
mainframe.models.scan_cache.Digest[source]
class mainframe.models.scan_cache.CacheContext(/, **data: Any)[source]

Bases: pydantic.BaseModel

!!! abstract “Usage Documentation”

[Models](../concepts/models.md)

A base class for creating Pydantic models.

__class_vars__[source]

The names of the class variables defined on the model.

__private_attributes__[source]

Metadata about the private attributes of the model.

__signature__[source]

The synthesized __init__ [Signature][inspect.Signature] of the model.

__pydantic_complete__[source]

Whether model building is completed, or if there are still undefined fields.

__pydantic_core_schema__[source]

The core schema of the model.

__pydantic_custom_init__[source]

Whether the model has a custom __init__ function.

__pydantic_decorators__[source]

Metadata containing the decorators defined on the model. This replaces Model.__validators__ and Model.__root_validators__ from Pydantic V1.

__pydantic_generic_metadata__[source]

A dictionary containing metadata about generic Pydantic models. The origin and args items map to the [__origin__][genericalias.__origin__] and [__args__][genericalias.__args__] attributes of [generic aliases][types-genericalias], and the parameter item maps to the __parameter__ attribute of generic classes.

__pydantic_parent_namespace__[source]

Parent namespace of the model, used for automatic rebuilding of models.

__pydantic_post_init__[source]

The name of the post-init method for the model, if defined.

__pydantic_root_model__[source]

Whether the model is a [RootModel][pydantic.root_model.RootModel].

__pydantic_serializer__[source]

The pydantic-core SchemaSerializer used to dump instances of the model.

__pydantic_validator__[source]

The pydantic-core SchemaValidator used to validate instances of the model.

__pydantic_fields__[source]

A dictionary of field names and their corresponding [FieldInfo][pydantic.fields.FieldInfo] objects.

__pydantic_computed_fields__[source]

A dictionary of computed field names and their corresponding [ComputedFieldInfo][pydantic.fields.ComputedFieldInfo] objects.

__pydantic_extra__[source]

A dictionary containing extra values, if [extra][pydantic.config.ConfigDict.extra] is set to ‘allow’.

__pydantic_fields_set__[source]

The names of fields explicitly set during instantiation.

__pydantic_private__[source]

Values of private attributes set on the model instance.

model_config[source]

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

scanner: Literal['yara', 'opengrep'][source]
rules_commit: Annotated[str, Field(min_length=1, max_length=64)][source]
rules_digest: Digest[source]
engine_digest: Digest[source]
namespace() bytes[source]
class mainframe.models.scan_cache.CacheKey(/, **data: Any)[source]

Bases: pydantic.BaseModel

!!! abstract “Usage Documentation”

[Models](../concepts/models.md)

A base class for creating Pydantic models.

__class_vars__[source]

The names of the class variables defined on the model.

__private_attributes__[source]

Metadata about the private attributes of the model.

__signature__[source]

The synthesized __init__ [Signature][inspect.Signature] of the model.

__pydantic_complete__[source]

Whether model building is completed, or if there are still undefined fields.

__pydantic_core_schema__[source]

The core schema of the model.

__pydantic_custom_init__[source]

Whether the model has a custom __init__ function.

__pydantic_decorators__[source]

Metadata containing the decorators defined on the model. This replaces Model.__validators__ and Model.__root_validators__ from Pydantic V1.

__pydantic_generic_metadata__[source]

A dictionary containing metadata about generic Pydantic models. The origin and args items map to the [__origin__][genericalias.__origin__] and [__args__][genericalias.__args__] attributes of [generic aliases][types-genericalias], and the parameter item maps to the __parameter__ attribute of generic classes.

__pydantic_parent_namespace__[source]

Parent namespace of the model, used for automatic rebuilding of models.

__pydantic_post_init__[source]

The name of the post-init method for the model, if defined.

__pydantic_root_model__[source]

Whether the model is a [RootModel][pydantic.root_model.RootModel].

__pydantic_serializer__[source]

The pydantic-core SchemaSerializer used to dump instances of the model.

__pydantic_validator__[source]

The pydantic-core SchemaValidator used to validate instances of the model.

__pydantic_fields__[source]

A dictionary of field names and their corresponding [FieldInfo][pydantic.fields.FieldInfo] objects.

__pydantic_computed_fields__[source]

A dictionary of computed field names and their corresponding [ComputedFieldInfo][pydantic.fields.ComputedFieldInfo] objects.

__pydantic_extra__[source]

A dictionary containing extra values, if [extra][pydantic.config.ConfigDict.extra] is set to ‘allow’.

__pydantic_fields_set__[source]

The names of fields explicitly set during instantiation.

__pydantic_private__[source]

Values of private attributes set on the model instance.

model_config[source]

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

file_digest: Digest[source]
language: Annotated[str, Field(max_length=32)] = ''[source]
class mainframe.models.scan_cache.CacheValue(/, **data: Any)[source]

Bases: CacheKey

!!! abstract “Usage Documentation”

[Models](../concepts/models.md)

A base class for creating Pydantic models.

__class_vars__[source]

The names of the class variables defined on the model.

__private_attributes__[source]

Metadata about the private attributes of the model.

__signature__[source]

The synthesized __init__ [Signature][inspect.Signature] of the model.

__pydantic_complete__[source]

Whether model building is completed, or if there are still undefined fields.

__pydantic_core_schema__[source]

The core schema of the model.

__pydantic_custom_init__[source]

Whether the model has a custom __init__ function.

__pydantic_decorators__[source]

Metadata containing the decorators defined on the model. This replaces Model.__validators__ and Model.__root_validators__ from Pydantic V1.

__pydantic_generic_metadata__[source]

A dictionary containing metadata about generic Pydantic models. The origin and args items map to the [__origin__][genericalias.__origin__] and [__args__][genericalias.__args__] attributes of [generic aliases][types-genericalias], and the parameter item maps to the __parameter__ attribute of generic classes.

__pydantic_parent_namespace__[source]

Parent namespace of the model, used for automatic rebuilding of models.

__pydantic_post_init__[source]

The name of the post-init method for the model, if defined.

__pydantic_root_model__[source]

Whether the model is a [RootModel][pydantic.root_model.RootModel].

__pydantic_serializer__[source]

The pydantic-core SchemaSerializer used to dump instances of the model.

__pydantic_validator__[source]

The pydantic-core SchemaValidator used to validate instances of the model.

__pydantic_fields__[source]

A dictionary of field names and their corresponding [FieldInfo][pydantic.fields.FieldInfo] objects.

__pydantic_computed_fields__[source]

A dictionary of computed field names and their corresponding [ComputedFieldInfo][pydantic.fields.ComputedFieldInfo] objects.

__pydantic_extra__[source]

A dictionary containing extra values, if [extra][pydantic.config.ConfigDict.extra] is set to ‘allow’.

__pydantic_fields_set__[source]

The names of fields explicitly set during instantiation.

__pydantic_private__[source]

Values of private attributes set on the model instance.

result: Annotated[str, Field(max_length=16384)][source]
validate_result() Self[source]
class mainframe.models.scan_cache.CacheLookup(/, **data: Any)[source]

Bases: pydantic.BaseModel

!!! abstract “Usage Documentation”

[Models](../concepts/models.md)

A base class for creating Pydantic models.

__class_vars__[source]

The names of the class variables defined on the model.

__private_attributes__[source]

Metadata about the private attributes of the model.

__signature__[source]

The synthesized __init__ [Signature][inspect.Signature] of the model.

__pydantic_complete__[source]

Whether model building is completed, or if there are still undefined fields.

__pydantic_core_schema__[source]

The core schema of the model.

__pydantic_custom_init__[source]

Whether the model has a custom __init__ function.

__pydantic_decorators__[source]

Metadata containing the decorators defined on the model. This replaces Model.__validators__ and Model.__root_validators__ from Pydantic V1.

__pydantic_generic_metadata__[source]

A dictionary containing metadata about generic Pydantic models. The origin and args items map to the [__origin__][genericalias.__origin__] and [__args__][genericalias.__args__] attributes of [generic aliases][types-genericalias], and the parameter item maps to the __parameter__ attribute of generic classes.

__pydantic_parent_namespace__[source]

Parent namespace of the model, used for automatic rebuilding of models.

__pydantic_post_init__[source]

The name of the post-init method for the model, if defined.

__pydantic_root_model__[source]

Whether the model is a [RootModel][pydantic.root_model.RootModel].

__pydantic_serializer__[source]

The pydantic-core SchemaSerializer used to dump instances of the model.

__pydantic_validator__[source]

The pydantic-core SchemaValidator used to validate instances of the model.

__pydantic_fields__[source]

A dictionary of field names and their corresponding [FieldInfo][pydantic.fields.FieldInfo] objects.

__pydantic_computed_fields__[source]

A dictionary of computed field names and their corresponding [ComputedFieldInfo][pydantic.fields.ComputedFieldInfo] objects.

__pydantic_extra__[source]

A dictionary containing extra values, if [extra][pydantic.config.ConfigDict.extra] is set to ‘allow’.

__pydantic_fields_set__[source]

The names of fields explicitly set during instantiation.

__pydantic_private__[source]

Values of private attributes set on the model instance.

context: CacheContext[source]
keys: Annotated[list[CacheKey], Field(min_length=1, max_length=128)][source]
class mainframe.models.scan_cache.CacheReply(/, **data: Any)[source]

Bases: pydantic.BaseModel

!!! abstract “Usage Documentation”

[Models](../concepts/models.md)

A base class for creating Pydantic models.

__class_vars__[source]

The names of the class variables defined on the model.

__private_attributes__[source]

Metadata about the private attributes of the model.

__signature__[source]

The synthesized __init__ [Signature][inspect.Signature] of the model.

__pydantic_complete__[source]

Whether model building is completed, or if there are still undefined fields.

__pydantic_core_schema__[source]

The core schema of the model.

__pydantic_custom_init__[source]

Whether the model has a custom __init__ function.

__pydantic_decorators__[source]

Metadata containing the decorators defined on the model. This replaces Model.__validators__ and Model.__root_validators__ from Pydantic V1.

__pydantic_generic_metadata__[source]

A dictionary containing metadata about generic Pydantic models. The origin and args items map to the [__origin__][genericalias.__origin__] and [__args__][genericalias.__args__] attributes of [generic aliases][types-genericalias], and the parameter item maps to the __parameter__ attribute of generic classes.

__pydantic_parent_namespace__[source]

Parent namespace of the model, used for automatic rebuilding of models.

__pydantic_post_init__[source]

The name of the post-init method for the model, if defined.

__pydantic_root_model__[source]

Whether the model is a [RootModel][pydantic.root_model.RootModel].

__pydantic_serializer__[source]

The pydantic-core SchemaSerializer used to dump instances of the model.

__pydantic_validator__[source]

The pydantic-core SchemaValidator used to validate instances of the model.

__pydantic_fields__[source]

A dictionary of field names and their corresponding [FieldInfo][pydantic.fields.FieldInfo] objects.

__pydantic_computed_fields__[source]

A dictionary of computed field names and their corresponding [ComputedFieldInfo][pydantic.fields.ComputedFieldInfo] objects.

__pydantic_extra__[source]

A dictionary containing extra values, if [extra][pydantic.config.ConfigDict.extra] is set to ‘allow’.

__pydantic_fields_set__[source]

The names of fields explicitly set during instantiation.

__pydantic_private__[source]

Values of private attributes set on the model instance.

revoked: bool = False[source]
entries: list[CacheValue] = None[source]
class mainframe.models.scan_cache.CacheLease(/, **data: Any)[source]

Bases: pydantic.BaseModel

!!! abstract “Usage Documentation”

[Models](../concepts/models.md)

A base class for creating Pydantic models.

__class_vars__[source]

The names of the class variables defined on the model.

__private_attributes__[source]

Metadata about the private attributes of the model.

__signature__[source]

The synthesized __init__ [Signature][inspect.Signature] of the model.

__pydantic_complete__[source]

Whether model building is completed, or if there are still undefined fields.

__pydantic_core_schema__[source]

The core schema of the model.

__pydantic_custom_init__[source]

Whether the model has a custom __init__ function.

__pydantic_decorators__[source]

Metadata containing the decorators defined on the model. This replaces Model.__validators__ and Model.__root_validators__ from Pydantic V1.

__pydantic_generic_metadata__[source]

A dictionary containing metadata about generic Pydantic models. The origin and args items map to the [__origin__][genericalias.__origin__] and [__args__][genericalias.__args__] attributes of [generic aliases][types-genericalias], and the parameter item maps to the __parameter__ attribute of generic classes.

__pydantic_parent_namespace__[source]

Parent namespace of the model, used for automatic rebuilding of models.

__pydantic_post_init__[source]

The name of the post-init method for the model, if defined.

__pydantic_root_model__[source]

Whether the model is a [RootModel][pydantic.root_model.RootModel].

__pydantic_serializer__[source]

The pydantic-core SchemaSerializer used to dump instances of the model.

__pydantic_validator__[source]

The pydantic-core SchemaValidator used to validate instances of the model.

__pydantic_fields__[source]

A dictionary of field names and their corresponding [FieldInfo][pydantic.fields.FieldInfo] objects.

__pydantic_computed_fields__[source]

A dictionary of computed field names and their corresponding [ComputedFieldInfo][pydantic.fields.ComputedFieldInfo] objects.

__pydantic_extra__[source]

A dictionary containing extra values, if [extra][pydantic.config.ConfigDict.extra] is set to ‘allow’.

__pydantic_fields_set__[source]

The names of fields explicitly set during instantiation.

__pydantic_private__[source]

Values of private attributes set on the model instance.

name: Annotated[str, Field(min_length=1, max_length=256)][source]
version: Annotated[str, Field(min_length=1, max_length=256)][source]
assignment_id: uuid.UUID[source]
attempt: Annotated[int, Field(ge=1)][source]
class mainframe.models.scan_cache.CacheWrite(/, **data: Any)[source]

Bases: pydantic.BaseModel

!!! abstract “Usage Documentation”

[Models](../concepts/models.md)

A base class for creating Pydantic models.

__class_vars__[source]

The names of the class variables defined on the model.

__private_attributes__[source]

Metadata about the private attributes of the model.

__signature__[source]

The synthesized __init__ [Signature][inspect.Signature] of the model.

__pydantic_complete__[source]

Whether model building is completed, or if there are still undefined fields.

__pydantic_core_schema__[source]

The core schema of the model.

__pydantic_custom_init__[source]

Whether the model has a custom __init__ function.

__pydantic_decorators__[source]

Metadata containing the decorators defined on the model. This replaces Model.__validators__ and Model.__root_validators__ from Pydantic V1.

__pydantic_generic_metadata__[source]

A dictionary containing metadata about generic Pydantic models. The origin and args items map to the [__origin__][genericalias.__origin__] and [__args__][genericalias.__args__] attributes of [generic aliases][types-genericalias], and the parameter item maps to the __parameter__ attribute of generic classes.

__pydantic_parent_namespace__[source]

Parent namespace of the model, used for automatic rebuilding of models.

__pydantic_post_init__[source]

The name of the post-init method for the model, if defined.

__pydantic_root_model__[source]

Whether the model is a [RootModel][pydantic.root_model.RootModel].

__pydantic_serializer__[source]

The pydantic-core SchemaSerializer used to dump instances of the model.

__pydantic_validator__[source]

The pydantic-core SchemaValidator used to validate instances of the model.

__pydantic_fields__[source]

A dictionary of field names and their corresponding [FieldInfo][pydantic.fields.FieldInfo] objects.

__pydantic_computed_fields__[source]

A dictionary of computed field names and their corresponding [ComputedFieldInfo][pydantic.fields.ComputedFieldInfo] objects.

__pydantic_extra__[source]

A dictionary containing extra values, if [extra][pydantic.config.ConfigDict.extra] is set to ‘allow’.

__pydantic_fields_set__[source]

The names of fields explicitly set during instantiation.

__pydantic_private__[source]

Values of private attributes set on the model instance.

context: CacheContext[source]
lease: CacheLease[source]
entries: Annotated[list[CacheValue], Field(max_length=128)][source]
revoke: bool = False[source]
quarantine: Annotated[list[CacheKey], Field(max_length=128)] = None[source]
validate_batch() Self[source]
class mainframe.models.scan_cache.CacheWriteReply(/, **data: Any)[source]

Bases: pydantic.BaseModel

!!! abstract “Usage Documentation”

[Models](../concepts/models.md)

A base class for creating Pydantic models.

__class_vars__[source]

The names of the class variables defined on the model.

__private_attributes__[source]

Metadata about the private attributes of the model.

__signature__[source]

The synthesized __init__ [Signature][inspect.Signature] of the model.

__pydantic_complete__[source]

Whether model building is completed, or if there are still undefined fields.

__pydantic_core_schema__[source]

The core schema of the model.

__pydantic_custom_init__[source]

Whether the model has a custom __init__ function.

__pydantic_decorators__[source]

Metadata containing the decorators defined on the model. This replaces Model.__validators__ and Model.__root_validators__ from Pydantic V1.

__pydantic_generic_metadata__[source]

A dictionary containing metadata about generic Pydantic models. The origin and args items map to the [__origin__][genericalias.__origin__] and [__args__][genericalias.__args__] attributes of [generic aliases][types-genericalias], and the parameter item maps to the __parameter__ attribute of generic classes.

__pydantic_parent_namespace__[source]

Parent namespace of the model, used for automatic rebuilding of models.

__pydantic_post_init__[source]

The name of the post-init method for the model, if defined.

__pydantic_root_model__[source]

Whether the model is a [RootModel][pydantic.root_model.RootModel].

__pydantic_serializer__[source]

The pydantic-core SchemaSerializer used to dump instances of the model.

__pydantic_validator__[source]

The pydantic-core SchemaValidator used to validate instances of the model.

__pydantic_fields__[source]

A dictionary of field names and their corresponding [FieldInfo][pydantic.fields.FieldInfo] objects.

__pydantic_computed_fields__[source]

A dictionary of computed field names and their corresponding [ComputedFieldInfo][pydantic.fields.ComputedFieldInfo] objects.

__pydantic_extra__[source]

A dictionary containing extra values, if [extra][pydantic.config.ConfigDict.extra] is set to ‘allow’.

__pydantic_fields_set__[source]

The names of fields explicitly set during instantiation.

__pydantic_private__[source]

Values of private attributes set on the model instance.

quarantined: int = 0[source]
inserted: int = 0[source]
skipped: int = 0[source]