Expand description
Per-field and per-collection size limits for wire protocol payloads.
Post-deserialization validation prevents O(N) or O(N*M) processing attacks within the 1 MB WebSocket frame limit. All limits are set above real-world maximums with generous headroom to avoid breaking legitimate payloads.
§Design decision: post-deserialization validation
We use a WireValidate trait (not custom serde deserializers) because:
- Custom deserializers are verbose and fragile for dozens of fields
- The 1 MB frame limit already caps total memory; the concern is processing cost
- Consistent with the existing
Validatepattern inweb-api-types - Trivially backward-compatible (limits set far above real-world maximums)
Structs§
- Wire
Validation Error - Error returned when a wire payload field exceeds its size limit.
Constants§
- MAX_
ACTIVE_ MQTT_ CLIENTS - Maximum number of active MQTT client IDs.
- MAX_
BATCH_ UPDATES - Maximum number of packages in a batch update.
- MAX_
BATCH_ UPDATE_ RESULTS - Maximum number of results in a batch update result.
- MAX_
CAPABILITIES - Maximum number of capabilities in a capability set.
- MAX_
CAPABILITIES_ PER_ SERVICE - Maximum number of capabilities in a single
Registermessage. - MAX_
CONFIG_ TEST_ OUTPUT_ LEN - Maximum byte length of a config test output string.
- MAX_
CONNECTIVITY_ UPDATES - Maximum number of connectivity updates in a
HostConnectivityUpdatedmessage. - MAX_
DISCOVERED_ QUALIFIER_ LEN - Maximum byte length of a
DiscoveredSoftware.qualifierstring. - MAX_
DISCOVERIES_ PER_ PLUGIN - Maximum number of discoveries per plugin result.
- MAX_
DISCOVERY_ PLUGINS - Maximum number of discovery plugins in a single message.
- MAX_
DISCOVERY_ PLUGIN_ RESULTS - Maximum number of discovery plugin results in a single message.
- MAX_
HOST_ PACKAGE_ HOST_ STATES - Maximum number of host package host states.
- MAX_
HOST_ TAGS - Maximum number of tags per host in a
HostStateMetadataentry. - MAX_
ICON_ URL_ LEN - Maximum byte length of a software item icon URL.
- MAX_
LONG_ STRING_ LEN - Maximum length for long strings (PEM certificates, CSRs, release notes).
- MAX_
MEDIUM_ STRING_ LEN - Maximum length for medium strings (hostnames, error messages).
- MAX_
MQTT_ HOSTS - Maximum number of host metadata entries in a
SoftwareStatesmessage. - MAX_
MQTT_ TENANTS - Maximum number of MQTT tenants in an assignment message.
- MAX_
OUTPUT_ STRING_ LEN - Maximum length for output strings (command output, update output).
Matches the 1 MB frame limit — output is already bounded by
MAX_OUTPUT_BYTESinagent-core/src/update.rs. - MAX_
PENDING_ REPORTS_ PER_ CONNECTION - Maximum number of concurrent pending (incomplete) paginated reports per WebSocket connection. Prevents memory exhaustion from abandoned reports.
- MAX_
PLUGIN_ CONFIG_ JSON_ LEN - Maximum byte length of plugin config JSON in a
ReportPluginConfigmessage. - MAX_
RELEASE_ ASSETS - Maximum number of assets in a
ReleaseInfomessage. - MAX_
REPORT_ HOSTS - Maximum number of hosts in a
ReportHostsmessage. - MAX_
REPORT_ PAGES - Maximum number of pages in a single paginated report.
- MAX_
SERVICE_ CONFIG_ ENTRIES - Maximum number of entries in a
ServiceConfigDeliveryorServiceConfigUpdatedmessage. - MAX_
SERVICE_ CONFIG_ VALUE_ LEN - Maximum byte length of a service config value (serialized JSON).
- MAX_
SHORT_ STRING_ LEN - Maximum length for short strings (identifiers, names, versions).
- MAX_
SOFTWARE_ STATE_ HOSTS - Maximum number of hosts per software state item.
- MAX_
SOFTWARE_ STATE_ ITEMS - Maximum number of software state items.
- MAX_
SPAN_ ID_ LEN - Maximum length of a span ID (16 hex chars for 64-bit W3C span ID).
- MAX_
STDIN_ DATA_ LEN - Maximum byte length of stdin data in an
UpdateStdinDatamessage (64 KB). - MAX_
SURFACE_ ACTIONS - Maximum number of interaction descriptors in a surface registration.
- MAX_
SURFACE_ ACTION_ REFS - Maximum number of action ID references in a single surface node.
- MAX_
SURFACE_ COLUMNS - Maximum number of columns in a
TableColumnsplacement orDataTableUI. - MAX_
SURFACE_ FIELDS - Maximum number of fields in a single form.
- MAX_
SURFACE_ JSON_ DEPTH - Maximum nesting depth for JSON values carried in surface payloads.
- MAX_
SURFACE_ JSON_ NODES - Maximum number of nodes visited when traversing surface JSON values.
- MAX_
SURFACE_ MANIFESTS - Maximum number of surfaces in a single
SurfaceRegistrationmessage. - MAX_
SURFACE_ PARAMS_ LEN - Maximum byte length of surface action params JSON.
- MAX_
SURFACE_ RESPONSE_ LEN - Maximum byte length of surface action response JSON.
- MAX_
SURFACE_ SELECT_ OPTIONS - Maximum number of options in a select field.
- MAX_
SURFACE_ WIZARD_ STEPS - Maximum number of steps in a wizard.
- MAX_
TRACE_ ID_ LEN - Maximum length of a trace ID (32 hex chars for 128-bit W3C trace ID).
- MAX_
UPDATE_ HOOKS - Maximum number of pre/post-update hook plugins in an update message.
- MAX_
VERSION_ CHECK_ ASSIGNMENTS - Maximum number of version check assignments in a single message.
- MAX_
VERSION_ CHECK_ RESULTS - Maximum number of version check results in a single message.
- MAX_
WORKLOAD_ CLAIM_ KEYS - Maximum number of config keys in a single
WorkloadClaimmessage. - PAGINATION_
SIZE_ THRESHOLD - Serialized JSON size threshold (768 KB) above which a payload is split into pages. Well under the 1 MB WebSocket frame limit to leave headroom for the envelope overhead (protocol_version, seq, trace_context, pagination, type tag).
- REPORT_
IDLE_ TIMEOUT - Idle timeout after the last page of a paginated report (15 s).
- REPORT_
TOTAL_ TIMEOUT - Total timeout for a paginated report from first page to completion (5 min).
- SHA256_
DIGEST_ LEN - Expected byte length of a SHA-256 hex digest string (64 hex characters).
- STATES_
HOST_ PAGE_ SIZE - Number of active hosts processed per page in paginated MQTT software-states delivery.
Traits§
- Wire
Validate - Trait for post-deserialization validation of wire protocol payloads.
Functions§
- check_
map_ len - Check that a
BTreeMapdoes not exceed the given length limit. - check_
opt_ string_ len - Check that an
Option<String>does not exceed the given byte length limit. - check_
set_ len - Check that a
BTreeSetdoes not exceed the given length limit. - check_
string_ len - Check that a
Stringdoes not exceed the given byte length limit. - check_
vec_ len - Check that a
Vecdoes not exceed the given length limit.