Skip to main content

Module binding

Module binding 

Source
Expand description

Generic binding normalizer.

Normalizes any binding value (ip, device, session, user, tenant, route) with consistent rules: trimming, encoding, control character rejection, and length enforcement.

§Why This Exists

Previously, SDKs applied ad-hoc normalization to binding values with inconsistent rules (different trimming, different charset checks). This module provides a single function that all SDKs call for any binding type.

§Binding Types

TypeExampleDescription
RoutePOST|/api/users|page=1HTTP method + path + query
Ip192.168.1.1Client IP address
Devicedevice_abc123Device identifier
Sessionsess_xyz789Session token
Useruser@example.comUser identifier
Tenanttenant_acmeMulti-tenant identifier
Customany stringApplication-defined binding

Structs§

NormalizedBindingValue
Result of binding normalization.

Enums§

BindingType
Binding type classification.

Constants§

MAX_BINDING_VALUE_LENGTH
Maximum allowed length for any binding value.
MIN_BINDING_VALUE_LENGTH
Minimum allowed length for a non-empty binding value.

Functions§

ash_normalize_binding_value
Normalize a binding value with universal safety rules.