VulnCheck.Workspace.RebarLock (VulnCheck v1.0.1)

Copy Markdown View Source

Parser for rebar3 rebar.lock files (both the legacy bare list format and the versioned {"1.2.0", [...]}. format with pkg_hash / pkg_hash_ext checksum sections).

rebar3 only locks the default profile, so every locked package belongs to the production closure.

Summary

Functions

Parses rebar.lock content into name => Package.

Reads and parses a rebar.lock file.

Reads and parses a rebar.lock file, also returning unsupported-entry warnings.

Like parse/2, also returning warnings for unsupported lock entries.

Functions

parse(content, opts \\ [])

@spec parse(String.t(), keyword()) ::
  {:ok, %{required(String.t()) => VulnCheck.Types.Package.t()}}
  | {:error, String.t()}

Parses rebar.lock content into name => Package.

parse_file(path)

@spec parse_file(Path.t()) ::
  {:ok, %{required(String.t()) => VulnCheck.Types.Package.t()}}
  | {:error, String.t()}

Reads and parses a rebar.lock file.

parse_file_with_warnings(path)

@spec parse_file_with_warnings(Path.t()) ::
  {:ok, %{required(String.t()) => VulnCheck.Types.Package.t()}, [String.t()]}
  | {:error, String.t()}

Reads and parses a rebar.lock file, also returning unsupported-entry warnings.

parse_with_warnings(content, opts \\ [])

@spec parse_with_warnings(String.t(), keyword()) ::
  {:ok, %{required(String.t()) => VulnCheck.Types.Package.t()}, [String.t()]}
  | {:error, String.t()}

Like parse/2, also returning warnings for unsupported lock entries.