Expand description
Handle syntax, as atproto specifies it.
A handle is a domain name, and this validator says only whether a string
could be one. It is deliberately looser than crate::did’s hostname
rules in two ways that matter:
- Case is allowed.
A.ISI.EDUis a syntactically valid handle: the spec’s answer to case is to lowercase before comparing, not to refuse. Adid:webcannot do that, because the DID is compared byte for byte across the network and two spellings would be two identities. .arpais allowed. The atproto handle spec keeps “is this a legal handle string” separate from “is this a top-level domain handles may be registered under”, and puts.arpa,.local,.invalidand the rest in the second list.SRI-NIC.ARPAis in the upstream valid vectors for exactly that reason, and a caller that needs the second question asks it separately.
Nothing here touches DNS. A syntactically valid handle is one that could be resolved, not one that resolves.
Enums§
- Handle
Error - Why a string is not a syntactically valid handle.
Constants§
- ATPROTO_
DID_ PATH - Path an atproto handle resolves through over HTTPS.
- DISALLOWED_
TLDS - Top-level domains the atproto handle spec reserves: a handle under one is syntactically valid and never resolves.
- MAX_
HANDLE_ LENGTH - Longest a handle may be, matching a DNS name.
- MAX_
SEGMENT_ LENGTH - Longest any one segment may be, matching a DNS label.
Functions§
- atproto_
did_ url - Where
handleis resolved over HTTPS, or why it cannot be. - has_
disallowed_ tld - Whether
handlesits under one ofDISALLOWED_TLDS, compared without regard to case. - parse_
atproto_ did - Reads the body of an
/.well-known/atproto-didresponse. - validate
- Checks a string against the handle syntax rules.