package conex

  1. Overview
  2. Docs

Module Conex_resource.AuthorSource

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

Sourcetype 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.

pp_r is a pretty printer.

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

r idx name typ dgst is a constructor.

Sourceval r_equal : r -> r -> bool

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

Accounts

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

Variant of accounts

Sourceval compare_account : account -> account -> int

compare_account a b compares accounts a and b.

pp_account a is a pretty printer.

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

wire_account id a is the wire representation of a.

Sourcetype 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.

Sourceval 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.

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

of_wire w converts w to an author or error.

Sourceval 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.

Sourceval wire : t -> Wire.t

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

Sourceval 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).

Sourceval next_id : t -> Conex_utils.Uint.t

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

Sourceval queue : t -> r -> t

queue t r adds r to t.queued.

Sourceval approve : t -> r -> t

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

Sourceval equal : t -> t -> bool

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

Sourceval reset : t -> t

reset t drops t.queued.

Sourceval prep_sig : t -> t * bool

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

Sourceval 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.