licence_audit/json_report

Types

blocking is absent when the gate has not evaluated this occurrence. Unavailable details are not a fetched advisory with unknown severity.

pub type AdvisoryResult {
  Available(
    advisory: osv.Vulnerability,
    decision: exception.Decision,
    blocking: option.Option(Bool),
  )
  Unreviewed(advisory: osv.Vulnerability, failure: error.Error)
  Unavailable(advisory_id: String, failure: error.Error)
}

Constructors

pub type CheckKind {
  Licences
  Vulnerabilities
}

Constructors

  • Licences
  • Vulnerabilities
pub type Command {
  Report
  Check
  Vulns
}

Constructors

  • Report
  • Check
  • Vulns

Absent results mean the check did not start, not a complete empty scan. The caller supplies the final exit outcome independently of gate findings.

pub type Document {
  Document(
    command: Command,
    checks_requested: List(CheckKind),
    licences: option.Option(LicenceResult),
    vulnerabilities: option.Option(VulnerabilityResult),
    exceptions: List(exception.Exception),
    today: String,
    gate_verdict: GateVerdict,
    complete: Bool,
    outcome: error.Error,
  )
}

Constructors

A failed gate can also be incomplete. Completeness is stored separately.

pub type GateVerdict {
  NotEnforced
  Passed
  Failed
  Undetermined
}

Constructors

  • NotEnforced
  • Passed
  • Failed
  • Undetermined

Supply counts from the full in-scope report, not a filtered display tree.

pub type LicenceResult {
  LicenceResult(
    rows: List(report.Row),
    counts: report.Counts,
    skipped_sources: List(SkippedSource),
    coverage: exception.Coverage,
    complete: Bool,
  )
}

Constructors

pub type SkippedSource {
  SkippedSource(package: String, source: String)
}

Constructors

  • SkippedSource(package: String, source: String)
pub type VulnerabilityResult {
  VulnerabilityResult(
    rows: List(VulnerabilityRow),
    queried_packages: Int,
    skipped_sources: List(SkippedSource),
    coverage: exception.Coverage,
    complete: Bool,
  )
}

Constructors

pub type VulnerabilityRow {
  VulnerabilityRow(
    package: String,
    version: String,
    purl: String,
    result: AdvisoryResult,
  )
}

Constructors

  • VulnerabilityRow(
      package: String,
      version: String,
      purl: String,
      result: AdvisoryResult,
    )

Values

pub fn to_string(document: Document) -> String

Encode one schema-1 document without printing, logging, or performing I/O.

✨ Search Document