Skip to main content

Module validate

Module validate 

Source
Expand description

The rules both halves apply to a request, so neither can drift from the other.

Enums§

ValidationError
Why a request was rejected.

Constants§

MAX_FILE_PATH_BYTES
The longest file_path either side accepts, in bytes: PATH_MAX, for the same two reasons.
MAX_PROJECT_KEY_BYTES
The longest project_key either side accepts, in bytes: PATH_MAX, so a key derived from a checkout’s path always fits, while every push and pull’s audit leaf, which names its project, stays small.

Functions§

validate_base_sha256
Enforces that a base_sha256 is what crate::content_sha256 writes: 64 hex digits. Either case is accepted, as the server compares them without regard to case.
validate_file_path
Enforces that a file_path is safe to join onto a memory directory on any machine that later pulls it.
validate_project_key
Enforces that a project_key is present and no longer than MAX_PROJECT_KEY_BYTES.