mainframe.models.orm

Attributes

Classes

Base

Mixin class to indicate when mapping this class, also convert it to be

Status

Package status.

Scan

The scans.

DownloadURL

Download URLs

Rule

YARA rules

Module Contents

class mainframe.models.orm.Base[source]

Bases: sqlalchemy.orm.MappedAsDataclass, sqlalchemy.orm.DeclarativeBase

Mixin class to indicate when mapping this class, also convert it to be a dataclass.

See also

orm_declarative_native_dataclasses - complete background on SQLAlchemy native dataclass mapping

Added in version 2.0.

class mainframe.models.orm.Status(*args, **kwds)[source]

Bases: enum.Enum

Package status.

QUEUED - Waiting to be sent to a worker PENDING - Waiting for a response from a worker FINISHED - Verdict received from worker FAILED - Something went wrong with the client when scanning this package

QUEUED = 'queued'[source]
PENDING = 'pending'[source]
FINISHED = 'finished'[source]
FAILED = 'failed'[source]
mainframe.models.orm.package_rules[source]
class mainframe.models.orm.Scan[source]

Bases: Base

The scans.

__tablename__: str = 'scans'[source]
__table_args__[source]
scan_id: sqlalchemy.orm.Mapped[uuid.UUID][source]
name: sqlalchemy.orm.Mapped[str][source]
version: sqlalchemy.orm.Mapped[str][source]
status: sqlalchemy.orm.Mapped[Status][source]
score: sqlalchemy.orm.Mapped[int | None][source]
inspector_url: sqlalchemy.orm.Mapped[str | None][source]
rules: sqlalchemy.orm.Mapped[list[Rule]][source]
download_urls: sqlalchemy.orm.Mapped[list[DownloadURL]][source]
queued_at: sqlalchemy.orm.Mapped[datetime.datetime | None][source]
queued_by: sqlalchemy.orm.Mapped[str][source]
pending_at: sqlalchemy.orm.Mapped[datetime.datetime | None][source]
pending_by: sqlalchemy.orm.Mapped[str | None][source]
finished_at: sqlalchemy.orm.Mapped[datetime.datetime | None][source]
finished_by: sqlalchemy.orm.Mapped[str | None][source]
reported_at: sqlalchemy.orm.Mapped[datetime.datetime | None][source]
reported_by: sqlalchemy.orm.Mapped[str | None][source]
fail_reason: sqlalchemy.orm.Mapped[str | None][source]
commit_hash: sqlalchemy.orm.Mapped[str | None][source]
class mainframe.models.orm.DownloadURL[source]

Bases: Base

Download URLs

__tablename__: str = 'download_urls'[source]
id: sqlalchemy.orm.Mapped[uuid.UUID][source]
scan_id: sqlalchemy.orm.Mapped[str][source]
url: sqlalchemy.orm.Mapped[str][source]
class mainframe.models.orm.Rule[source]

Bases: Base

YARA rules

__tablename__: str = 'rules'[source]
id: sqlalchemy.orm.Mapped[uuid.UUID][source]
name: sqlalchemy.orm.Mapped[str][source]