Skip to main content

euv_cli/update_server/
const.rs

1/// Hyperlane route template serving protocol/ABI-negotiated signed release manifests.
2pub const UPDATE_ROUTE_MANIFEST: &str = "/v1/projects/{project}/channels/{channel}/manifest";
3
4/// Hyperlane route template serving immutable content-addressed SHA-256 blobs with Range support.
5pub const UPDATE_ROUTE_BLOB: &str = "/v1/blobs/{sha256}";
6
7/// Hyperlane route template streaming minimal `release.activated` SSE notifications with `Last-Event-ID` replay.
8pub const UPDATE_ROUTE_EVENTS: &str = "/v1/projects/{project}/channels/{channel}/events";
9
10/// Hyperlane route serving JSON health and store status diagnostics.
11pub const UPDATE_ROUTE_HEALTHZ: &str = "/healthz";
12
13/// Default local filesystem store root directory used across CLI and `UpdateServerConfig`.
14pub const DEFAULT_UPDATE_STORE_PATH: &str = ".euv-updates";
15
16/// Default project OTA configuration filename written by `euv update init`.
17pub const DEFAULT_OTA_CONFIG_FILE: &str = "euv-ota.json";
18
19/// Default logical project identifier for OTA operations.
20pub const DEFAULT_OTA_PROJECT_NAME: &str = "euv-showcase";
21
22/// Default production release channel name.
23pub const DEFAULT_OTA_PROD_CHANNEL: &str = "prod";
24
25/// Default development release channel name.
26pub const DEFAULT_OTA_DEV_CHANNEL: &str = "dev";
27
28/// Default environment variable name holding the offline HMAC-SHA256 signing secret.
29pub const DEFAULT_OTA_SIGNING_KEY_ENV: &str = "EUV_UPDATE_SIGNING_KEY";
30
31/// Default number of most recent releases retained per channel during `euv update gc`.
32pub const DEFAULT_OTA_GC_KEEP_RELEASES: usize = 5;
33
34/// Default staleness threshold in seconds before an abandoned `writer.lock` is reclaimed.
35pub const DEFAULT_WRITER_LOCK_STALE_SECS: u64 = 120;
36
37/// Bit length of generated HMAC-SHA256 signing secrets.
38pub const OTA_KEYGEN_BIT_LENGTH: usize = 256;
39
40/// Current schema version for `euv-ota.json` project configuration files.
41pub const OTA_CONFIG_SCHEMA_V1: u32 = 1;
42
43/// Default bind host for `euv update serve`.
44pub const DEFAULT_UPDATE_SERVER_HOST: &str = "127.0.0.1";
45
46/// Default bind port for `euv update serve`.
47pub const DEFAULT_UPDATE_SERVER_PORT: u16 = 8787;
48
49/// Default SSE heartbeat interval in milliseconds for `euv update serve`.
50pub const DEFAULT_UPDATE_HEARTBEAT_MS: u64 = 15_000;
51
52/// Default background filesystem pointer watcher poll interval in milliseconds.
53pub const DEFAULT_UPDATE_WATCH_POLL_MS: u64 = 100;
54
55/// Default maximum retained events in each bounded channel event log (`state/events/`).
56pub const DEFAULT_UPDATE_EVENT_LOG_CAP: usize = 256;
57
58/// Subdirectory holding staged artifacts prior to atomic publish.
59pub const STORE_DIR_STAGING: &str = "staging";
60
61/// Subdirectory holding immutable SHA-256 content-addressed blobs (`blobs/sha256/`).
62pub const STORE_DIR_BLOBS: &str = "blobs";
63
64/// Hash algorithm subdirectory beneath `blobs/`.
65pub const STORE_DIR_SHA256: &str = "sha256";
66
67/// Subdirectory holding immutable signed release manifests (`releases/`).
68pub const STORE_DIR_RELEASES: &str = "releases";
69
70/// Subdirectory holding atomically swapped channel active pointers (`channels/`).
71pub const STORE_DIR_CHANNELS: &str = "channels";
72
73/// Subdirectory holding per-track active pointers under a channel directory.
74pub const STORE_DIR_TRACKS: &str = "tracks";
75
76/// Subdirectory holding writer lock and bounded event history (`state/`).
77pub const STORE_DIR_STATE: &str = "state";
78
79/// Subdirectory holding bounded per-channel JSONL event logs under `state/`.
80pub const STORE_DIR_EVENTS: &str = "events";
81
82/// Default target route path updated by `euv update push` when neither `--route` nor `--slot` is given.
83pub const DEFAULT_UPDATE_ROUTE: &str = "/dynamic-panel";
84
85/// Default target component slot identifier updated by `euv update push` when neither `--route` nor `--slot` is given.
86pub const DEFAULT_UPDATE_SLOT: &str = "promo_banner";
87
88/// Default RGB accent color used for inline `euv update push --title` hot-update cards.
89pub const DEFAULT_UPDATE_ACCENT_RGB: u32 = 0x16A34A;
90
91/// WebAssembly binary magic header (`\0asm`) used to auto-detect `.wasm` artifacts during `euv update push`.
92pub(crate) const WASM_BINARY_MAGIC: &[u8; 4] = b"\0asm";
93
94/// Placeholder asset module identifier used for slot-only route manifests.
95pub(crate) const SLOT_CONTAINER_MODULE_ID: &str = "slot-container";
96
97/// Placeholder asset bytes used for slot-only route manifests without overwriting the route page slot.
98pub(crate) const SLOT_CONTAINER_MARKER_BYTES: &[u8] = b"{}";
99
100/// Default artifact module identifier for directly pushed hot-update payloads.
101pub(crate) const PUSH_ARTIFACT_MODULE_ID: &str = "hot-update";
102
103/// Error string when neither `--file` nor `--title` is provided to `euv update push`.
104pub(crate) const ERR_PUSH_SOURCE_REQUIRED: &str =
105    "euv update push requires either --file <path> or --title <text>";
106
107/// Error string when a pushed JSON file is not a valid `DynamicNodeSpec`.
108pub(crate) const ERR_PUSH_INVALID_SPEC: &str =
109    "pushed JSON artifact is not a valid DynamicNodeSpec";
110
111/// Error string when a pushed `.wasm` artifact fails sandbox parsing or host ABI checks.
112pub(crate) const ERR_PUSH_INVALID_WASM: &str =
113    "pushed .wasm artifact failed sandbox or host ABI verification";
114
115/// Default body copy when `euv update push --title` omits `--body`.
116pub(crate) const DEFAULT_PUSH_INLINE_BODY: &str =
117    "Live hot-update delivered via euv update push + Hyperlane SSE (zero restart).";
118
119/// Local writer lock filename inside `state/`.
120pub(crate) const STORE_WRITER_LOCK_FILE: &str = "writer.lock";
121
122/// Active channel pointer filename inside `channels/<project>/<channel>/`.
123pub(crate) const STORE_ACTIVE_POINTER_FILE: &str = "active.json";
124
125/// Staged manifest filename inside `staging/<stage_id>/`.
126pub(crate) const STORE_STAGED_MANIFEST_FILE: &str = "manifest.json";
127
128/// Query parameter key carrying client protocol version.
129#[cfg(feature = "update-server")]
130pub(crate) const QUERY_KEY_PROTOCOL: &str = "protocol";
131
132/// Query parameter key carrying client host ABI version.
133#[cfg(feature = "update-server")]
134pub(crate) const QUERY_KEY_ABI: &str = "abi";
135
136/// Query parameter key carrying client delivery mode (`wasm_component` or `declarative_data`).
137#[cfg(feature = "update-server")]
138pub(crate) const QUERY_KEY_MODE: &str = "mode";
139
140/// Query parameter key carrying preferred compatibility track.
141#[cfg(feature = "update-server")]
142pub(crate) const QUERY_KEY_TRACK: &str = "track";
143
144/// Query parameter key carrying fallback `Last-Event-ID` cursor.
145#[cfg(feature = "update-server")]
146pub(crate) const QUERY_KEY_LAST_EVENT_ID: &str = "last_event_id";
147
148/// Route parameter key for project name.
149#[cfg(feature = "update-server")]
150pub(crate) const ROUTE_PARAM_PROJECT: &str = "project";
151
152/// Route parameter key for channel name.
153#[cfg(feature = "update-server")]
154pub(crate) const ROUTE_PARAM_CHANNEL: &str = "channel";
155
156/// Route parameter key for SHA-256 blob digest.
157#[cfg(feature = "update-server")]
158pub(crate) const ROUTE_PARAM_SHA256: &str = "sha256";
159
160/// Delivery mode wire token for Declarative Data delivery.
161#[cfg(feature = "update-server")]
162pub(crate) const MODE_TOKEN_DATA: &str = "declarative_data";
163
164/// HTTP header name for `ETag`.
165#[cfg(feature = "update-server")]
166pub(crate) const UPDATE_HDR_ETAG: &str = "etag";
167
168/// HTTP header name for `Accept-Ranges`.
169#[cfg(feature = "update-server")]
170pub(crate) const UPDATE_HDR_ACCEPT_RANGES: &str = "accept-ranges";
171
172/// HTTP header value indicating byte range support.
173#[cfg(feature = "update-server")]
174pub(crate) const UPDATE_HDR_BYTES: &str = "bytes";
175
176/// HTTP header name for `Content-Range`.
177#[cfg(feature = "update-server")]
178pub(crate) const UPDATE_HDR_CONTENT_RANGE: &str = "content-range";
179
180/// HTTP header name for incoming `Range` requests.
181#[cfg(feature = "update-server")]
182pub(crate) const UPDATE_HDR_RANGE_LOWER: &str = "range";
183
184/// HTTP header name for `Last-Event-ID`.
185#[cfg(feature = "update-server")]
186pub(crate) const UPDATE_HDR_LAST_EVENT_ID_LOWER: &str = "last-event-id";
187
188/// Immutable cache control directive for content-addressed SHA-256 blobs.
189#[cfg(feature = "update-server")]
190pub(crate) const UPDATE_CACHE_IMMUTABLE: &str = "public, max-age=31536000, immutable";
191
192/// No-cache directive for dynamic channel manifests.
193#[cfg(feature = "update-server")]
194pub(crate) const UPDATE_CACHE_NO_CACHE: &str = "no-cache";
195
196/// Proxy-safe no-cache directive disabling response buffering and transforms on SSE streams.
197#[cfg(feature = "update-server")]
198pub(crate) const UPDATE_SSE_CACHE_CONTROL: &str = "no-cache, no-transform";
199
200/// HTTP header name disabling reverse-proxy buffering on Nginx/Caddy/Cloudflare SSE streams.
201#[cfg(feature = "update-server")]
202pub(crate) const UPDATE_HDR_ACCEL_BUFFERING: &str = "x-accel-buffering";
203
204/// Header value disabling Nginx/proxy SSE response buffering.
205#[cfg(feature = "update-server")]
206pub(crate) const UPDATE_VAL_NO_BUFFER: &str = "no";
207
208/// HTTP CORS allow-origin header name.
209#[cfg(feature = "update-server")]
210pub(crate) const UPDATE_HDR_CORS_ORIGIN: &str = "access-control-allow-origin";
211
212/// HTTP CORS allow-methods header name.
213#[cfg(feature = "update-server")]
214pub(crate) const UPDATE_HDR_CORS_METHODS: &str = "access-control-allow-methods";
215
216/// HTTP CORS allow-headers header name.
217#[cfg(feature = "update-server")]
218pub(crate) const UPDATE_HDR_CORS_HEADERS: &str = "access-control-allow-headers";
219
220/// HTTP CORS expose-headers header name.
221#[cfg(feature = "update-server")]
222pub(crate) const UPDATE_HDR_CORS_EXPOSE: &str = "access-control-expose-headers";
223
224/// HTTP CORS wildcard origin value.
225#[cfg(feature = "update-server")]
226pub(crate) const UPDATE_VAL_CORS_ANY: &str = "*";
227
228/// HTTP CORS allowed methods list.
229#[cfg(feature = "update-server")]
230pub(crate) const UPDATE_VAL_CORS_METHODS: &str = "GET, HEAD, OPTIONS";
231
232/// HTTP CORS allowed request headers list.
233#[cfg(feature = "update-server")]
234pub(crate) const UPDATE_VAL_CORS_HEADERS: &str = "Range, Last-Event-ID, Authorization, Proxy-Authorization, X-Forwarded-Prefix, X-Forwarded-Host, X-Forwarded-Proto";
235
236/// HTTP CORS exposed response headers list.
237#[cfg(feature = "update-server")]
238pub(crate) const UPDATE_VAL_CORS_EXPOSE: &str =
239    "ETag, Content-Range, Accept-Ranges, X-Euv-Proxy-Base";
240
241/// Incoming reverse-proxy prefix header name.
242#[cfg(feature = "update-server")]
243pub(crate) const UPDATE_HDR_X_FWD_PREFIX: &str = "x-forwarded-prefix";
244
245/// Incoming reverse-proxy host header name.
246#[cfg(feature = "update-server")]
247pub(crate) const UPDATE_HDR_X_FWD_HOST: &str = "x-forwarded-host";
248
249/// Incoming reverse-proxy protocol header name.
250#[cfg(feature = "update-server")]
251pub(crate) const UPDATE_HDR_X_FWD_PROTO: &str = "x-forwarded-proto";
252
253/// Response header advertising the resolved proxy-aware base URL for manifest/blob consumers.
254#[cfg(feature = "update-server")]
255pub(crate) const UPDATE_HDR_X_PROXY_BASE: &str = "x-euv-proxy-base";
256
257/// MIME type for JSON responses.
258#[cfg(feature = "update-server")]
259pub(crate) const UPDATE_MIME_JSON: &str = "application/json; charset=utf-8";
260
261/// MIME type for immutable binary blobs.
262#[cfg(feature = "update-server")]
263pub(crate) const UPDATE_MIME_OCTET: &str = "application/octet-stream";
264
265/// Prefix expected on HTTP `Range` byte headers.
266pub(crate) const RANGE_BYTES_PREFIX: &str = "bytes=";
267
268/// File extension for JSON manifest and pointer files.
269pub(crate) const EXT_JSON_DOT: &str = ".json";
270
271/// File extension for JSONL event history files.
272pub(crate) const EXT_JSONL_DOT: &str = ".jsonl";
273
274/// Allowed ASCII hyphen byte in store identifiers.
275pub(crate) const ASCII_HYPHEN: u8 = b'-';
276
277/// Allowed ASCII underscore byte in store identifiers.
278pub(crate) const ASCII_UNDERSCORE: u8 = b'_';
279
280/// Allowed ASCII period byte in store identifiers.
281pub(crate) const ASCII_DOT: u8 = b'.';
282
283/// Error string when an identifier contains unsafe path characters.
284pub(crate) const ERR_INVALID_STORE_IDENT: &str =
285    "store identifier must contain only ASCII alphanumerics, '-', '_', or '.' without traversal";
286
287/// Error string when a writer lock cannot be acquired within the bounded wait budget.
288pub(crate) const ERR_WRITER_LOCK_TIMEOUT: &str = "timed out acquiring update store writer lock";
289
290/// Error string when a signing key is empty during publish or rollback.
291pub(crate) const ERR_EMPTY_SIGNING_KEY: &str =
292    "signing key cannot be empty for publish or rollback";
293
294/// Error string when a staged release directory does not exist.
295pub(crate) const ERR_STAGE_NOT_FOUND: &str = "staged release directory not found";
296
297/// Error string when a target rollback release does not exist.
298pub(crate) const ERR_ROLLBACK_TARGET_MISSING: &str = "rollback target release manifest not found";
299
300/// Error string when a blob referenced by a manifest is missing or corrupted.
301pub(crate) const ERR_BLOB_INTEGRITY: &str = "blob missing or SHA-256 digest mismatch";
302
303/// Error string when no compatible release exists for the client's protocol, ABI, or delivery mode.
304pub(crate) const ERR_NO_COMPATIBLE_RELEASE: &str =
305    "no compatible release available for client protocol, ABI, or delivery mode";
306
307/// Error string when `euv update serve` is invoked without the `update-server` Cargo feature.
308#[cfg(not(feature = "update-server"))]
309pub(crate) const ERR_UPDATE_SERVER_FEATURE_DISABLED: &str =
310    "euv-cli was built without the `update-server` Cargo feature";
311
312/// Error response payload returned for HTTP 404.
313#[cfg(feature = "update-server")]
314pub(crate) const ERR_BODY_NOT_FOUND: &str = "{\"error\":\"not_found\"}";
315
316/// Error response payload returned for HTTP 405.
317#[cfg(feature = "update-server")]
318pub(crate) const ERR_BODY_METHOD_NOT_ALLOWED: &str = "{\"error\":\"method_not_allowed\"}";
319
320/// Error response payload returned for HTTP 400.
321#[cfg(feature = "update-server")]
322pub(crate) const ERR_BODY_BAD_REQUEST: &str = "{\"error\":\"bad_request\"}";
323
324/// Error response payload returned for HTTP 416.
325#[cfg(feature = "update-server")]
326pub(crate) const ERR_BODY_RANGE_INVALID: &str = "{\"error\":\"range_not_satisfiable\"}";
327
328/// Error response payload returned when update server state is not registered.
329#[cfg(feature = "update-server")]
330pub(crate) const ERR_BODY_UNCONFIGURED: &str = "{\"error\":\"update_server_unconfigured\"}";
331
332/// SSE initial connection comment line payload.
333#[cfg(feature = "update-server")]
334pub(crate) const UPDATE_SSE_CONNECTED_COMMENT: &str = "connected";
335
336/// SSE periodic keep-alive heartbeat comment payload.
337#[cfg(feature = "update-server")]
338pub(crate) const UPDATE_SSE_HEARTBEAT_COMMENT: &str = "keep-alive";
339
340/// HTTP header name for conditional `If-None-Match` cache validation.
341#[cfg(feature = "update-server")]
342pub(crate) const UPDATE_HDR_IF_NONE_MATCH_LOWER: &str = "if-none-match";
343
344/// Health status string reported by `GET /healthz`.
345pub(crate) const OTA_HEALTH_STATUS_OK: &str = "ok";
346
347/// Severity label for fatal store integrity errors reported by `verify`.
348pub(crate) const OTA_VERIFY_SEVERITY_ERROR: &str = "error";
349
350/// Severity label for non-fatal store warnings reported by `verify`.
351pub(crate) const OTA_VERIFY_SEVERITY_WARN: &str = "warning";
352
353/// Artifact diff classification for newly introduced artifacts.
354pub(crate) const OTA_DIFF_ADDED: &str = "added";
355
356/// Artifact diff classification for removed artifacts.
357pub(crate) const OTA_DIFF_REMOVED: &str = "removed";
358
359/// Artifact diff classification for modified artifacts.
360pub(crate) const OTA_DIFF_CHANGED: &str = "changed";
361
362/// Artifact diff classification for unchanged artifacts.
363pub(crate) const OTA_DIFF_UNCHANGED: &str = "unchanged";
364
365/// Writer lock payload prefix recording the owning process identifier.
366pub(crate) const OTA_LOCK_PID_PREFIX: &str = "pid=";
367
368/// Writer lock payload prefix recording the creation UNIX timestamp.
369pub(crate) const OTA_LOCK_CREATED_PREFIX: &str = "created_unix=";
370
371/// Unix signal probe executable used to check if a lock owner PID is alive.
372#[cfg(unix)]
373pub(crate) const OTA_KILL_BIN: &str = "kill";
374
375/// Unix signal zero flag testing process liveness without delivering a signal.
376#[cfg(unix)]
377pub(crate) const OTA_KILL_SIGNAL_ZERO: &str = "-0";
378
379/// Lowercase diagnostic phrase emitted by `kill -0` when a process no longer exists.
380#[cfg(unix)]
381pub(crate) const OTA_ERR_NO_SUCH_PROCESS: &str = "no such process";
382
383/// Linux procfs root directory used for fast lock owner liveness probing.
384#[cfg(unix)]
385pub(crate) const OTA_PROC_DIR: &str = "/proc";
386
387/// Unix OS CSPRNG device path used for signing key generation.
388#[cfg(unix)]
389pub(crate) const OTA_DEV_URANDOM: &str = "/dev/urandom";
390
391/// Rust target triple for compiled dynamic WASM widget modules.
392pub(crate) const OTA_WASM_TARGET_TRIPLE: &str = "wasm32-unknown-unknown";
393
394/// Default relative output directory for compiled dynamic WASM widgets.
395pub(crate) const OTA_BUILD_OUT_SUBDIR: &str = "dist/ota";
396
397/// Fallback output filename when compiling a dynamic WASM widget without an explicit package name.
398pub(crate) const OTA_DEFAULT_WIDGET_FILENAME: &str = "widget.wasm";
399
400/// Cargo manifest filename used to detect Rust dynamic widget crates.
401pub(crate) const OTA_CARGO_MANIFEST_FILE: &str = "Cargo.toml";
402
403/// Cargo target directory override environment variable.
404pub(crate) const OTA_ENV_CARGO_TARGET_DIR: &str = "CARGO_TARGET_DIR";
405
406/// Default Cargo target directory name.
407pub(crate) const OTA_DIR_TARGET: &str = "target";
408
409/// Release profile output directory name.
410pub(crate) const OTA_DIR_RELEASE: &str = "release";
411
412/// Debug profile output directory name.
413pub(crate) const OTA_DIR_DEBUG: &str = "debug";
414
415/// Cargo `--lib` flag passed when building dynamic WASM widget libraries.
416pub(crate) const OTA_CARGO_ARG_LIB: &str = "--lib";
417
418/// File extension for WebAssembly binaries.
419pub(crate) const OTA_EXT_WASM: &str = "wasm";
420
421/// Primary UDP routing probe destination used to discover the host's outbound LAN IPv4 address.
422pub(crate) const OTA_LAN_PROBE_PRIMARY: &str = "8.8.8.8:80";
423
424/// Secondary UDP routing probe destination used as a fallback for LAN IPv4 detection.
425pub(crate) const OTA_LAN_PROBE_FALLBACK: &str = "1.1.1.1:80";
426
427/// Wildcard ephemeral UDP bind address used for LAN interface probing.
428pub(crate) const OTA_LAN_BIND_ANY: &str = "0.0.0.0:0";
429
430/// Wildcard IPv4 bind host token.
431#[cfg(feature = "update-server")]
432pub(crate) const OTA_HOST_ALL_INTERFACES: &str = "0.0.0.0";
433
434/// Loopback IPv4 host token.
435#[cfg(feature = "update-server")]
436pub(crate) const OTA_HOST_LOCALHOST: &str = "127.0.0.1";
437
438/// Standard HTTP 200 status reason text.
439pub(crate) const OTA_HTTP_STATUS_OK: &str = "OK";
440
441/// Standard HTTP 204 status reason text.
442pub(crate) const OTA_HTTP_STATUS_NO_CONTENT: &str = "No Content";
443
444/// Standard HTTP 206 status reason text.
445pub(crate) const OTA_HTTP_STATUS_PARTIAL: &str = "Partial Content";
446
447/// Standard HTTP 304 status reason text.
448pub(crate) const OTA_HTTP_STATUS_NOT_MODIFIED: &str = "Not Modified";
449
450/// Standard HTTP 400 status reason text.
451pub(crate) const OTA_HTTP_STATUS_BAD_REQUEST: &str = "Bad Request";
452
453/// Standard HTTP 404 status reason text.
454pub(crate) const OTA_HTTP_STATUS_NOT_FOUND: &str = "Not Found";
455
456/// Standard HTTP 405 status reason text.
457pub(crate) const OTA_HTTP_STATUS_METHOD_NOT_ALLOWED: &str = "Method Not Allowed";
458
459/// Standard HTTP 409 status reason text.
460pub(crate) const OTA_HTTP_STATUS_CONFLICT: &str = "Conflict";
461
462/// Standard HTTP 416 status reason text.
463pub(crate) const OTA_HTTP_STATUS_RANGE_INVALID: &str = "Range Not Satisfiable";
464
465/// Title-case `Cache-Control` header name for embedded v1 OTA responses.
466pub(crate) const OTA_HDR_CACHE_CONTROL_TITLE: &str = "Cache-Control";
467
468/// Title-case `ETag` header name for embedded v1 OTA responses.
469pub(crate) const OTA_HDR_ETAG_TITLE: &str = "ETag";
470
471/// Title-case `Accept-Ranges` header name for embedded v1 OTA responses.
472pub(crate) const OTA_HDR_ACCEPT_RANGES_TITLE: &str = "Accept-Ranges";
473
474/// Title-case `Content-Range` header name for embedded v1 OTA responses.
475pub(crate) const OTA_HDR_CONTENT_RANGE_TITLE: &str = "Content-Range";
476
477/// Route prefix identifying embedded v1 blob requests.
478pub(crate) const OTA_PATH_V1_BLOBS_PREFIX: &str = "/v1/blobs/";
479
480/// Route prefix identifying embedded v1 project/channel requests.
481pub(crate) const OTA_PATH_V1_PROJECTS_PREFIX: &str = "/v1/projects/";
482
483/// Route path segment separating project and channel identifiers.
484pub(crate) const OTA_PATH_SEG_CHANNELS: &str = "channels";
485
486/// Route terminal segment identifying manifest endpoints.
487pub(crate) const OTA_PATH_SEG_MANIFEST: &str = "manifest";
488
489/// Route terminal segment identifying SSE event stream endpoints.
490pub(crate) const OTA_PATH_SEG_EVENTS: &str = "events";
491
492/// Uppercase HTTP GET method token.
493pub(crate) const OTA_METHOD_GET: &str = "GET";
494
495/// Uppercase HTTP HEAD method token.
496pub(crate) const OTA_METHOD_HEAD: &str = "HEAD";
497
498/// Uppercase HTTP OPTIONS method token.
499pub(crate) const OTA_METHOD_OPTIONS: &str = "OPTIONS";
500
501/// Error string when Cargo fails compiling a dynamic WASM widget crate.
502pub(crate) const OTA_ERR_BUILD_FAILED: &str = "cargo wasm widget build failed";
503
504/// Error string when no `.wasm` artifact is produced by `euv update build`.
505pub(crate) const OTA_ERR_WASM_NOT_FOUND: &str = "compiled .wasm output artifact not found";
506
507/// Error string when `euv update build --push` is invoked without a signing secret.
508pub(crate) const OTA_ERR_PUSH_KEY_MISSING: &str = "signing key is required when --push is enabled";
509
510/// Error string when a requested release sequence does not exist in the store.
511pub(crate) const OTA_ERR_RELEASE_MISSING: &str =
512    "release manifest not found for requested sequence";
513
514/// Error string when a release manifest has an empty signature field.
515pub(crate) const OTA_ERR_UNSIGNED_MANIFEST: &str = "release manifest signature is empty";
516
517/// Error string when a stored blob's length does not match its manifest metadata.
518pub(crate) const OTA_ERR_SIZE_MISMATCH: &str = "blob byte size mismatch";
519
520/// Error string when a channel pointer's recorded manifest SHA-256 differs from the manifest file.
521pub(crate) const OTA_ERR_MANIFEST_DIGEST_MISMATCH: &str =
522    "channel pointer manifest_sha256 does not match manifest";
523
524/// Error string when a manifest's `rollback_of` sequence does not exist on disk.
525pub(crate) const OTA_ERR_ROLLBACK_TARGET_BROKEN: &str =
526    "rollback_of points to missing historical release";
527
528/// Warning message emitted by `verify` when run without a signing key.
529pub(crate) const OTA_WARN_NO_KEY_VERIFY: &str =
530    "signature verification skipped because no signing key was provided";
531
532/// Cache-Control header value for dynamic embedded v1 OTA responses.
533pub(crate) const OTA_HTTP_CACHE_NO_CACHE: &str = "no-cache";
534
535/// Cache-Control header value for immutable content-addressed embedded blobs.
536pub(crate) const OTA_HTTP_CACHE_IMMUTABLE: &str = "public, max-age=31536000, immutable";
537
538/// JSON MIME type for embedded v1 OTA responses.
539pub(crate) const OTA_HTTP_MIME_JSON: &str = "application/json; charset=utf-8";
540
541/// Binary octet-stream MIME type for embedded v1 OTA blob responses.
542pub(crate) const OTA_HTTP_MIME_OCTET: &str = "application/octet-stream";
543
544/// Byte-range unit token for embedded v1 OTA responses.
545pub(crate) const OTA_HTTP_RANGE_BYTES: &str = "bytes";
546
547/// JSON error body for embedded HTTP 404 responses.
548pub(crate) const OTA_HTTP_ERR_NOT_FOUND: &str = "{\"error\":\"not_found\"}";
549
550/// JSON error body for embedded HTTP 400 responses.
551pub(crate) const OTA_HTTP_ERR_BAD_REQUEST: &str = "{\"error\":\"bad_request\"}";
552
553/// JSON error body for embedded HTTP 405 responses.
554pub(crate) const OTA_HTTP_ERR_METHOD_NOT_ALLOWED: &str = "{\"error\":\"method_not_allowed\"}";
555
556/// JSON error body for embedded HTTP 416 responses.
557pub(crate) const OTA_HTTP_ERR_RANGE_INVALID: &str = "{\"error\":\"range_not_satisfiable\"}";
558
559/// Query key for protocol version in embedded v1 OTA requests.
560pub(crate) const OTA_HTTP_QUERY_PROTOCOL: &str = "protocol";
561
562/// Query key for host ABI version in embedded v1 OTA requests.
563pub(crate) const OTA_HTTP_QUERY_ABI: &str = "abi";
564
565/// Query key for delivery mode in embedded v1 OTA requests.
566pub(crate) const OTA_HTTP_QUERY_MODE: &str = "mode";
567
568/// Query key for preferred compatibility track in embedded v1 OTA requests.
569pub(crate) const OTA_HTTP_QUERY_TRACK: &str = "track";
570
571/// Wire token identifying Declarative Data delivery mode in embedded v1 OTA requests.
572pub(crate) const OTA_HTTP_MODE_DATA: &str = "declarative_data";
573
574/// Weak ETag prefix stripped during `If-None-Match` comparison.
575pub(crate) const OTA_ETAG_WEAK_PREFIX: &str = "W/";
576
577/// Weak ETag lowercase prefix stripped during `If-None-Match` comparison.
578pub(crate) const OTA_ETAG_WEAK_PREFIX_LOWER: &str = "w/";