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
| Type | Example | Description |
|---|---|---|
Route | POST|/api/users|page=1 | HTTP method + path + query |
Ip | 192.168.1.1 | Client IP address |
Device | device_abc123 | Device identifier |
Session | sess_xyz789 | Session token |
User | user@example.com | User identifier |
Tenant | tenant_acme | Multi-tenant identifier |
Custom | any string | Application-defined binding |
Structs§
- Normalized
Binding Value - Result of binding normalization.
Enums§
- Binding
Type - 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.