package conex

  1. Overview
  2. Docs

An author contains a list of approved resources (name, typ, digest). It also contains a list of key and signature pairs, and a list of accounts. Keys have to be approved by a quorum of janitors, but the resource list is modified only by the author themselves.

Resources

type r = private {
  1. index : Conex_utils.Uint.t;
  2. rname : string;
  3. rtyp : typ;
  4. digest : Digest.t;
}

The type of a resource in the approved list: a counter (the index), a name, a typ, and its digest.

val pp_r : r Conex_utils.fmt

pp_r is a pretty printer.

val r : Conex_utils.Uint.t -> string -> typ -> Digest.t -> r

r idx name typ dgst is a constructor.

val r_equal : r -> r -> bool

r_equal r r' is true is the name, type, and digest of r and r' are equal.

Accounts

type account = [
  1. | `Email of identifier
  2. | `GitHub of identifier
  3. | `Other of identifier * string
]

Variant of accounts

val compare_account : account -> account -> int

compare_account a b compares accounts a and b.

val pp_account : account Conex_utils.fmt

pp_account a is a pretty printer.

val wire_account : identifier -> account -> Wire.t

wire_account id a is the wire representation of a.

type t = private {
  1. created : Conex_utils.Uint.t;
  2. counter : Conex_utils.Uint.t;
  3. wraps : Conex_utils.Uint.t;
  4. name : identifier;
  5. resources : r list;
  6. accounts : account list;
  7. keys : (Key.t * Signature.t) list;
  8. queued : r list;
}

The record of an author: name, key/signature pairs, created, counter, approved and queued resource lists.

pp is a pretty printer.

val t : ?counter:Conex_utils.Uint.t -> ?wraps:Conex_utils.Uint.t -> ?accounts:account list -> ?keys:(Key.t * Signature.t) list -> ?resources:r list -> ?queued:r list -> Conex_utils.Uint.t -> identifier -> t

t ~counter ~wraps ~accounts ~keys ~resources ~queued created name is a constructor.

val of_wire : Wire.t -> (t, string) result

of_wire w converts w to an author or error.

val wire_raw : t -> Wire.t

wire_raw t is the raw wire representation of t, including only header and resource list. This is used for signing.

val wire : t -> Wire.t

wire t is the raw wire representation of t, as written to disk.

val contains : ?queued:bool -> t -> r -> bool

contains ~queued author resource is true if resource is in author.resources (or author.queued if queued is true (default: false).

val next_id : t -> Conex_utils.Uint.t

next_id t is the next free identitifer of the resource list index.

val queue : t -> r -> t

queue t r adds r to t.queued.

val approve : t -> r -> t

approve t r adds r to t.resources, and removes r from t.queued.

val equal : t -> t -> bool

equal t t' is true if name, keys, accounts, resource lists, and queued are equal.

val reset : t -> t

reset t drops t.queued.

val prep_sig : t -> t * bool

prep_sig t increments t.counter. Returns the carry bit as second component.

val replace_sig : t -> (Key.t * Signature.t) -> t

replace_sig t (k, s) adds k,s to t.keys, filtering existing pairs where the same public key is used.