Skip to main content

Module limits

Module limits 

Source
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 Validate pattern in web-api-types
  • Trivially backward-compatible (limits set far above real-world maximums)

Structs§

WireValidationError
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 Register message.
MAX_CONFIG_TEST_OUTPUT_LEN
Maximum byte length of a config test output string.
MAX_CONNECTIVITY_UPDATES
Maximum number of connectivity updates in a HostConnectivityUpdated message.
MAX_DISCOVERED_QUALIFIER_LEN
Maximum byte length of a DiscoveredSoftware.qualifier string.
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 HostStateMetadata entry.
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 SoftwareStates message.
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_BYTES in agent-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 ReportPluginConfig message.
MAX_RELEASE_ASSETS
Maximum number of assets in a ReleaseInfo message.
MAX_REPORT_HOSTS
Maximum number of hosts in a ReportHosts message.
MAX_REPORT_PAGES
Maximum number of pages in a single paginated report.
MAX_SERVICE_CONFIG_ENTRIES
Maximum number of entries in a ServiceConfigDelivery or ServiceConfigUpdated message.
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 UpdateStdinData message (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 TableColumns placement or DataTable UI.
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 SurfaceRegistration message.
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 WorkloadClaim message.
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§

WireValidate
Trait for post-deserialization validation of wire protocol payloads.

Functions§

check_map_len
Check that a BTreeMap does 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 BTreeSet does not exceed the given length limit.
check_string_len
Check that a String does not exceed the given byte length limit.
check_vec_len
Check that a Vec does not exceed the given length limit.