euv_cli/update_server/
const.rs1pub const UPDATE_ROUTE_MANIFEST: &str = "/v1/projects/{project}/channels/{channel}/manifest";
3
4pub const UPDATE_ROUTE_BLOB: &str = "/v1/blobs/{sha256}";
6
7pub const UPDATE_ROUTE_EVENTS: &str = "/v1/projects/{project}/channels/{channel}/events";
9
10pub const DEFAULT_UPDATE_SERVER_HOST: &str = "127.0.0.1";
12
13pub const DEFAULT_UPDATE_SERVER_PORT: u16 = 8787;
15
16pub const DEFAULT_UPDATE_HEARTBEAT_MS: u64 = 15_000;
18
19pub const DEFAULT_UPDATE_WATCH_POLL_MS: u64 = 100;
21
22pub const DEFAULT_UPDATE_EVENT_LOG_CAP: usize = 256;
24
25pub const STORE_DIR_STAGING: &str = "staging";
27
28pub const STORE_DIR_BLOBS: &str = "blobs";
30
31pub const STORE_DIR_SHA256: &str = "sha256";
33
34pub const STORE_DIR_RELEASES: &str = "releases";
36
37pub const STORE_DIR_CHANNELS: &str = "channels";
39
40pub const STORE_DIR_TRACKS: &str = "tracks";
42
43pub const STORE_DIR_STATE: &str = "state";
45
46pub const STORE_DIR_EVENTS: &str = "events";
48
49pub const DEFAULT_UPDATE_ROUTE: &str = "/dynamic-panel";
51
52pub const DEFAULT_UPDATE_SLOT: &str = "promo_banner";
54
55pub const DEFAULT_UPDATE_ACCENT_RGB: u32 = 0x16A34A;
57
58pub(crate) const WASM_BINARY_MAGIC: &[u8; 4] = b"\0asm";
60
61pub(crate) const SLOT_CONTAINER_MODULE_ID: &str = "slot-container";
63
64pub(crate) const SLOT_CONTAINER_MARKER_BYTES: &[u8] = b"{}";
66
67pub(crate) const PUSH_ARTIFACT_MODULE_ID: &str = "hot-update";
69
70pub(crate) const ERR_PUSH_SOURCE_REQUIRED: &str =
72 "euv update push requires either --file <path> or --title <text>";
73
74pub(crate) const ERR_PUSH_INVALID_SPEC: &str =
76 "pushed JSON artifact is not a valid DynamicNodeSpec";
77
78pub(crate) const ERR_PUSH_INVALID_WASM: &str =
80 "pushed .wasm artifact failed sandbox or host ABI verification";
81
82pub(crate) const DEFAULT_PUSH_INLINE_BODY: &str =
84 "Live hot-update delivered via euv update push + Hyperlane SSE (zero restart).";
85
86pub(crate) const STORE_WRITER_LOCK_FILE: &str = "writer.lock";
88
89pub(crate) const STORE_ACTIVE_POINTER_FILE: &str = "active.json";
91
92pub(crate) const STORE_STAGED_MANIFEST_FILE: &str = "manifest.json";
94
95#[cfg(feature = "update-server")]
97pub(crate) const QUERY_KEY_PROTOCOL: &str = "protocol";
98
99#[cfg(feature = "update-server")]
101pub(crate) const QUERY_KEY_ABI: &str = "abi";
102
103#[cfg(feature = "update-server")]
105pub(crate) const QUERY_KEY_MODE: &str = "mode";
106
107#[cfg(feature = "update-server")]
109pub(crate) const QUERY_KEY_TRACK: &str = "track";
110
111#[cfg(feature = "update-server")]
113pub(crate) const QUERY_KEY_LAST_EVENT_ID: &str = "last_event_id";
114
115#[cfg(feature = "update-server")]
117pub(crate) const ROUTE_PARAM_PROJECT: &str = "project";
118
119#[cfg(feature = "update-server")]
121pub(crate) const ROUTE_PARAM_CHANNEL: &str = "channel";
122
123#[cfg(feature = "update-server")]
125pub(crate) const ROUTE_PARAM_SHA256: &str = "sha256";
126
127#[cfg(feature = "update-server")]
129pub(crate) const MODE_TOKEN_DATA: &str = "declarative_data";
130
131#[cfg(feature = "update-server")]
133pub(crate) const UPDATE_HDR_ETAG: &str = "etag";
134
135#[cfg(feature = "update-server")]
137pub(crate) const UPDATE_HDR_ACCEPT_RANGES: &str = "accept-ranges";
138
139#[cfg(feature = "update-server")]
141pub(crate) const UPDATE_HDR_BYTES: &str = "bytes";
142
143#[cfg(feature = "update-server")]
145pub(crate) const UPDATE_HDR_CONTENT_RANGE: &str = "content-range";
146
147#[cfg(feature = "update-server")]
149pub(crate) const UPDATE_HDR_RANGE_LOWER: &str = "range";
150
151#[cfg(feature = "update-server")]
153pub(crate) const UPDATE_HDR_LAST_EVENT_ID_LOWER: &str = "last-event-id";
154
155#[cfg(feature = "update-server")]
157pub(crate) const UPDATE_CACHE_IMMUTABLE: &str = "public, max-age=31536000, immutable";
158
159#[cfg(feature = "update-server")]
161pub(crate) const UPDATE_CACHE_NO_CACHE: &str = "no-cache";
162
163#[cfg(feature = "update-server")]
165pub(crate) const UPDATE_SSE_CACHE_CONTROL: &str = "no-cache, no-transform";
166
167#[cfg(feature = "update-server")]
169pub(crate) const UPDATE_HDR_ACCEL_BUFFERING: &str = "x-accel-buffering";
170
171#[cfg(feature = "update-server")]
173pub(crate) const UPDATE_VAL_NO_BUFFER: &str = "no";
174
175#[cfg(feature = "update-server")]
177pub(crate) const UPDATE_HDR_CORS_ORIGIN: &str = "access-control-allow-origin";
178
179#[cfg(feature = "update-server")]
181pub(crate) const UPDATE_HDR_CORS_METHODS: &str = "access-control-allow-methods";
182
183#[cfg(feature = "update-server")]
185pub(crate) const UPDATE_HDR_CORS_HEADERS: &str = "access-control-allow-headers";
186
187#[cfg(feature = "update-server")]
189pub(crate) const UPDATE_HDR_CORS_EXPOSE: &str = "access-control-expose-headers";
190
191#[cfg(feature = "update-server")]
193pub(crate) const UPDATE_VAL_CORS_ANY: &str = "*";
194
195#[cfg(feature = "update-server")]
197pub(crate) const UPDATE_VAL_CORS_METHODS: &str = "GET, HEAD, OPTIONS";
198
199#[cfg(feature = "update-server")]
201pub(crate) const UPDATE_VAL_CORS_HEADERS: &str = "Range, Last-Event-ID, Authorization, Proxy-Authorization, X-Forwarded-Prefix, X-Forwarded-Host, X-Forwarded-Proto";
202
203#[cfg(feature = "update-server")]
205pub(crate) const UPDATE_VAL_CORS_EXPOSE: &str =
206 "ETag, Content-Range, Accept-Ranges, X-Euv-Proxy-Base";
207
208#[cfg(feature = "update-server")]
210pub(crate) const UPDATE_HDR_X_FWD_PREFIX: &str = "x-forwarded-prefix";
211
212#[cfg(feature = "update-server")]
214pub(crate) const UPDATE_HDR_X_FWD_HOST: &str = "x-forwarded-host";
215
216#[cfg(feature = "update-server")]
218pub(crate) const UPDATE_HDR_X_FWD_PROTO: &str = "x-forwarded-proto";
219
220#[cfg(feature = "update-server")]
222pub(crate) const UPDATE_HDR_X_PROXY_BASE: &str = "x-euv-proxy-base";
223
224#[cfg(feature = "update-server")]
226pub(crate) const UPDATE_MIME_JSON: &str = "application/json; charset=utf-8";
227
228#[cfg(feature = "update-server")]
230pub(crate) const UPDATE_MIME_OCTET: &str = "application/octet-stream";
231
232pub(crate) const RANGE_BYTES_PREFIX: &str = "bytes=";
234
235pub(crate) const EXT_JSON_DOT: &str = ".json";
237
238pub(crate) const EXT_JSONL_DOT: &str = ".jsonl";
240
241pub(crate) const ASCII_HYPHEN: u8 = b'-';
243
244pub(crate) const ASCII_UNDERSCORE: u8 = b'_';
246
247pub(crate) const ASCII_DOT: u8 = b'.';
249
250pub(crate) const ERR_INVALID_STORE_IDENT: &str =
252 "store identifier must contain only ASCII alphanumerics, '-', '_', or '.' without traversal";
253
254pub(crate) const ERR_WRITER_LOCK_TIMEOUT: &str = "timed out acquiring update store writer lock";
256
257pub(crate) const ERR_EMPTY_SIGNING_KEY: &str =
259 "signing key cannot be empty for publish or rollback";
260
261pub(crate) const ERR_STAGE_NOT_FOUND: &str = "staged release directory not found";
263
264pub(crate) const ERR_ROLLBACK_TARGET_MISSING: &str = "rollback target release manifest not found";
266
267pub(crate) const ERR_BLOB_INTEGRITY: &str = "blob missing or SHA-256 digest mismatch";
269
270pub(crate) const ERR_NO_COMPATIBLE_RELEASE: &str =
272 "no compatible release available for client protocol, ABI, or delivery mode";
273
274#[cfg(not(feature = "update-server"))]
276pub(crate) const ERR_UPDATE_SERVER_FEATURE_DISABLED: &str =
277 "euv-cli was built without the `update-server` Cargo feature";
278
279#[cfg(feature = "update-server")]
281pub(crate) const ERR_BODY_NOT_FOUND: &str = "{\"error\":\"not_found\"}";
282
283#[cfg(feature = "update-server")]
285pub(crate) const ERR_BODY_METHOD_NOT_ALLOWED: &str = "{\"error\":\"method_not_allowed\"}";
286
287#[cfg(feature = "update-server")]
289pub(crate) const ERR_BODY_BAD_REQUEST: &str = "{\"error\":\"bad_request\"}";
290
291#[cfg(feature = "update-server")]
293pub(crate) const ERR_BODY_RANGE_INVALID: &str = "{\"error\":\"range_not_satisfiable\"}";
294
295#[cfg(feature = "update-server")]
297pub(crate) const ERR_BODY_UNCONFIGURED: &str = "{\"error\":\"update_server_unconfigured\"}";
298
299#[cfg(feature = "update-server")]
301pub(crate) const UPDATE_SSE_CONNECTED_COMMENT: &str = "connected";
302
303#[cfg(feature = "update-server")]
305pub(crate) const UPDATE_SSE_HEARTBEAT_COMMENT: &str = "keep-alive";