mainframe.models.orm ==================== .. py:module:: mainframe.models.orm Attributes ---------- .. autoapisummary:: mainframe.models.orm.package_rules Classes ------- .. autoapisummary:: mainframe.models.orm.Base mainframe.models.orm.Status mainframe.models.orm.Scan mainframe.models.orm.DownloadURL mainframe.models.orm.Rule Module Contents --------------- .. py:class:: Base Bases: :py:obj:`sqlalchemy.orm.MappedAsDataclass`, :py:obj:`sqlalchemy.orm.DeclarativeBase` Mixin class to indicate when mapping this class, also convert it to be a dataclass. .. seealso:: :ref:`orm_declarative_native_dataclasses` - complete background on SQLAlchemy native dataclass mapping .. versionadded:: 2.0 .. py:class:: Status(*args, **kwds) Bases: :py:obj:`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 .. py:attribute:: QUEUED :value: 'queued' .. py:attribute:: PENDING :value: 'pending' .. py:attribute:: FINISHED :value: 'finished' .. py:attribute:: FAILED :value: 'failed' .. py:data:: package_rules .. py:class:: Scan Bases: :py:obj:`Base` The scans. .. py:attribute:: __tablename__ :type: str :value: 'scans' .. py:attribute:: __table_args__ .. py:attribute:: scan_id :type: sqlalchemy.orm.Mapped[uuid.UUID] .. py:attribute:: name :type: sqlalchemy.orm.Mapped[str] .. py:attribute:: version :type: sqlalchemy.orm.Mapped[str] .. py:attribute:: status :type: sqlalchemy.orm.Mapped[Status] .. py:attribute:: score :type: sqlalchemy.orm.Mapped[Optional[int]] .. py:attribute:: inspector_url :type: sqlalchemy.orm.Mapped[Optional[str]] .. py:attribute:: rules :type: sqlalchemy.orm.Mapped[list[Rule]] .. py:attribute:: download_urls :type: sqlalchemy.orm.Mapped[list[DownloadURL]] .. py:attribute:: queued_at :type: sqlalchemy.orm.Mapped[Optional[datetime.datetime]] .. py:attribute:: queued_by :type: sqlalchemy.orm.Mapped[str] .. py:attribute:: pending_at :type: sqlalchemy.orm.Mapped[Optional[datetime.datetime]] .. py:attribute:: pending_by :type: sqlalchemy.orm.Mapped[Optional[str]] .. py:attribute:: finished_at :type: sqlalchemy.orm.Mapped[Optional[datetime.datetime]] .. py:attribute:: finished_by :type: sqlalchemy.orm.Mapped[Optional[str]] .. py:attribute:: reported_at :type: sqlalchemy.orm.Mapped[Optional[datetime.datetime]] .. py:attribute:: reported_by :type: sqlalchemy.orm.Mapped[Optional[str]] .. py:attribute:: fail_reason :type: sqlalchemy.orm.Mapped[Optional[str]] .. py:attribute:: commit_hash :type: sqlalchemy.orm.Mapped[Optional[str]] .. py:class:: DownloadURL Bases: :py:obj:`Base` Download URLs .. py:attribute:: __tablename__ :type: str :value: 'download_urls' .. py:attribute:: id :type: sqlalchemy.orm.Mapped[uuid.UUID] .. py:attribute:: scan_id :type: sqlalchemy.orm.Mapped[str] .. py:attribute:: url :type: sqlalchemy.orm.Mapped[str] .. py:class:: Rule Bases: :py:obj:`Base` YARA rules .. py:attribute:: __tablename__ :type: str :value: 'rules' .. py:attribute:: id :type: sqlalchemy.orm.Mapped[uuid.UUID] .. py:attribute:: name :type: sqlalchemy.orm.Mapped[str]