Skip to main content

MAX_KEY_LENGTH

Constant MAX_KEY_LENGTH 

Source
pub const MAX_KEY_LENGTH: usize = didbot_identity::MAX_DID_LENGTH; // 2_048usize
Expand description

The longest key that gets a bucket of its own.

caller_key answers an address, but a limiter keyed on something the caller sends is handed an arbitrary string by an unauthenticated caller. MAX_DID_LENGTH is the longest an atproto identifier can be at all: a handle caps at 253 bytes and a DID at this, so nothing longer than this resolves to an account on any deployment. Keys past it are therefore not identifiers being checked, and giving each one a bucket would mean retaining a caller-chosen string per request in a map with no other bound on it.