Skip to main content

Module lock

Module lock 

Source
Expand description

Lock file: a record of what a TEI resolved to and what the artifacts were.

Experimental until 0.9. The JSON layout is versioned by schemaVersion (currently LOCK_SCHEMA_VERSION); the Rust types may change in a minor release.

The format is documented in docs/lock-file.md and described by docs/schemas/lock-v1.schema.json. This module does no I/O and reads no clock: callers supply every value, including fetchedAt.

What a lock proves. It records the integrity outcome of checksums over decoded artifact bytes at fetchedAt. That is not publisher authenticity, and a lock file is not signed: whoever can edit it can change it.

No secrets. LockFile::validate rejects a server URL that carries userinfo, a query or a fragment. Nothing else in the format holds credentials.

Structs§

ChangedArtifact
An entry present in both locks whose content differs.
FieldChange
A change to one scalar of the lock header or of an entry.
LockDiff
Differences between two locks. fetchedAt is ignored.
LockFile
A lock file, schemaVersion 1.
LockedArtifact
One format of one artifact revision.
LockedChecksum
A declared checksum as recorded in a lock.

Enums§

LockedIntegrity
How an artifact’s declared checksums fared when the lock was written.

Constants§

LOCK_SCHEMA_VERSION
The only lock layout this crate reads and writes.
MAX_ALGORITHM_LEN
Longest accepted checksum algorithm name.
MAX_MEDIA_TYPE_LEN
Longest accepted mediaType.
MAX_TEI_LEN
Longest accepted tei.
MAX_TYPE_LEN
Longest accepted artifact type.
MAX_VERSION_LEN
Longest accepted apiVersion.

Functions§

diff
Compare two locks. Neither is modified; entries are matched by artifact UUID and media type, so a new revision shows as a change, not as a removal plus an addition.