Expand description
Repository identity and the local map of resolved Cloud vaults.
The identity Cloud sees is stable_identity(project_identity(root))
salted by the org (identity_digest). It is the same for every checkout
of a repository on every machine (.lean-ctx-id > git origin >
manifests) and never contains a path, user name or credential.
Structs§
- Vault
Map <data_dir>/cloud/projects.json: stable identity → resolved vault.- Vault
Record - A vault as Cloud resolved it, plus the local checkouts seen for it.
Functions§
- connected_
map - The vault map of the store as the connected Cloud and account see it
(
VaultMap::for_scope): no records of another Cloud or account (rc3-81 S1, rc4-2). Not connected: the map as it is on disk. - connected_
scope - The scope (
vault_scope) the store is connected to:Nonewhen it is not connected; an unreadable instance record gives a scope no stamped map matches (fail closed). - for_
connected connected_mapfor amapalready loaded from the store.- identity_
digest hex(HMAC-SHA256(org_salt, stable_identity)).- in_
scope mapasscopesees it (VaultMap::for_scope);None(not connected) leaves it as it is.- link_
made_ id - Whether a
.lean-ctx-idvalue has the shapecloud linkwrites: 32 lowercase hex characters (16 random bytes). - map_in
- The vault map as the Cloud and account at
scope(vault_scope) see it,Nonewhen it belongs to another one (an enrollment elsewhere since the caller’s session was loaded). A sender then sends nothing and keeps its queue for the scope it was queued in (rc3-81, bd 39791 M1/M2). - normalize_
git_ url github.com/acme/paymentsfor every spelling of the same remote: scheme, credentials,.gitsuffix, scp syntax and host case removed.- project_
identity - The machine-independent identity of the project at
root, if it has one. - resolve_
request - The resolve request for the project at
root. - restore_
root - Put the records of the checkout
rootback as they were insnapshot(the map before a change that was refused), under one hold of the map’s lock, and only while the map on disk and the snapshot belong toscope, the Cloud and account the snapshot was taken for (rc3-81, bd 39540 S-a, bd 39791 S1): records of other checkouts and an enrollment elsewhere since then are left as they are. Returns whether it was put back. - update_
map - Load, change and save
projects.jsonatdata_dirunder its state lock (rc3-81 S2), so a sync that resolves a checkout and an enrollment that switches the Cloud never write over each other. The file is written only whenchangechanged the map; the lock is held for local file work only. - vault_
scope - The scope a vault id is valid in (rc3-81, rc4-2, rc4-6): the Cloud at
originand the account (org)org_idon it, as one string soprojects.jsonkeeps its shape (theoriginfield):<origin>#org=<org_id>, the origin normalized likestored_origin. An emptyorg_idgives the origin alone.