package conex

  1. Overview
  2. Docs

Module Conex_resourceSource

Persistent data: on wire and record types

Every resource in conex is a piece of data (or metadata), and has its own purpose. Resources stored on disk consists of a common header: a name, a type, a counter, an epoch, and a creation timestamp. There are broadly three kinds of resources: those containing identities (Team and Author), those regulating access to packages (Authorisation), and those with the digests of the opam repository data (Releases and Release).

Names and identifiers

Sourcetype name = string

The name of resources, used e.g. for package names.

pp_name name is a pretty printer for name.

Sourceval name_equal : name -> name -> bool

name_equal a b is the result of a case insensitive comparison of a and b.

Sourcetype identifier = string

The type of identifiers.

pp_id id is a pretty printer for identifier.

Sourceval id_equal : identifier -> identifier -> bool

id_equal a b is the result of a case insensitive comparison of a and b.

Sourcetype timestamp = string

The type for a timestamp, always a RFC3339 string in UTC (no timezone information).

Sourceval pp_timestamp : timestamp Conex_utils.fmt

Wire format

Sourcemodule Wire : sig ... end

The wire encoding is abstract here, one suitable decoding and encoding engine is Conex_opam_encoding. The wire encoding is used for digest computations, and persistent storage on disk.

Resource types

Sourcetype typ = [
  1. | `Root
  2. | `Targets
]

The sum type of all possible resources.

Sourceval typ_to_string : typ -> string

resource_to_string res is the string representation of res.

Sourceval string_to_typ : string -> typ option

string_to_resource str is either Some resource or None.

pp_resource pp is a pretty printer for resource.

Sourceval typ_equal : typ -> typ -> bool

resource_equal a b is true if they are the same, otherwise false.

Sourceval typ_of_wire : Wire.s -> (typ, string) result
Sourcetype err = [
  1. | `Parse of string
  2. | `Unknown_alg of string
  3. | `Malformed
]
Sourcemodule Header : sig ... end

Common header on disk

Digests

Sourcemodule Digest : sig ... end
Sourcemodule Digest_map : sig ... end

Asymmetric key types

Sourcemodule Key : sig ... end

Cryptographic signatures

Sourcemodule Signature : sig ... end
Sourceval to_be_signed : Wire.t -> timestamp -> identifier -> Signature.alg -> Wire.t

to_be_signed data timestamp id algorithm prepares the representation used by signing and verification

Sourcemodule Expression : sig ... end

Root

The root contains the (offline) root keys, also defines snapshot, timestamp, and maintainers. Furthermore, it contains configuration information such as where keys are located in this repository and where the data is stored.

Sourcemodule Root : sig ... end
Sourcemodule Delegation : sig ... end
Sourcemodule Target : sig ... end
Sourcemodule Targets : sig ... end
OCaml

Innovation. Community. Security.