View Source Baobab.Entry.Validator (Baobab v0.30.0)

Validation of Baobab.Entry structs

Summary

Functions

Validate a Baobab.Entry struct relative to the provided clump_id

Validate the backlink field of a Baobab.Entry relative to the provided clump

Validate a Baobab.Entry without full certificate pool verification.

Validate the lipmaalink field of a Baobab.Entry relative to the provided clump_id

Validate the payload_hash field of a Baobab.Entry

Validate the sig field of a Baobab.Entry

Functions

Link to this function

validate(clump_id, entry)

View Source
@spec validate(String.t(), %Baobab.Entry{
  author: term(),
  backlink: term(),
  lipmaalink: term(),
  log_id: term(),
  payload: term(),
  payload_hash: term(),
  seqnum: term(),
  sig: term(),
  size: term(),
  tag: term()
}) ::
  %Baobab.Entry{
    author: term(),
    backlink: term(),
    lipmaalink: term(),
    log_id: term(),
    payload: term(),
    payload_hash: term(),
    seqnum: term(),
    sig: term(),
    size: term(),
    tag: term()
  }
  | {:error, String.t()}

Validate a Baobab.Entry struct relative to the provided clump_id

Includes validation of its available certificate pool

Link to this function

validate_backlink(clump_id, entry)

View Source
@spec validate_backlink(String.t(), %Baobab.Entry{
  author: term(),
  backlink: term(),
  lipmaalink: term(),
  log_id: term(),
  payload: term(),
  payload_hash: term(),
  seqnum: term(),
  sig: term(),
  size: term(),
  tag: term()
}) :: :ok | {:error, String.t()}

Validate the backlink field of a Baobab.Entry relative to the provided clump

Link to this function

validate_entry(clump_id, entry)

View Source
@spec validate_entry(String.t(), %Baobab.Entry{
  author: term(),
  backlink: term(),
  lipmaalink: term(),
  log_id: term(),
  payload: term(),
  payload_hash: term(),
  seqnum: term(),
  sig: term(),
  size: term(),
  tag: term()
}) :: :ok | {:error, String.t()}

Validate a Baobab.Entry without full certificate pool verification.

Confirms:

  • Signature
  • Payload hash
  • Backlink
  • Lipmaalink

Relative to the provided clump_id

Link to this function

validate_lipmaalink(clump_id, entry, missing_ok \\ false)

View Source
@spec validate_lipmaalink(
  String.t(),
  %Baobab.Entry{
    author: term(),
    backlink: term(),
    lipmaalink: term(),
    log_id: term(),
    payload: term(),
    payload_hash: term(),
    seqnum: term(),
    sig: term(),
    size: term(),
    tag: term()
  },
  boolean()
) :: :ok | {:error, String.t()}

Validate the lipmaalink field of a Baobab.Entry relative to the provided clump_id

Link to this function

validate_payload_hash(entry)

View Source
@spec validate_payload_hash(%Baobab.Entry{
  author: term(),
  backlink: term(),
  lipmaalink: term(),
  log_id: term(),
  payload: term(),
  payload_hash: term(),
  seqnum: term(),
  sig: term(),
  size: term(),
  tag: term()
}) :: :ok | {:error, String.t()}

Validate the payload_hash field of a Baobab.Entry

@spec validate_sig(%Baobab.Entry{
  author: term(),
  backlink: term(),
  lipmaalink: term(),
  log_id: term(),
  payload: term(),
  payload_hash: term(),
  seqnum: term(),
  sig: term(),
  size: term(),
  tag: term()
}) :: :ok | {:error, String.t()}

Validate the sig field of a Baobab.Entry