Skip to content

Commit

Permalink
syntax: disallow .example and .alt TLDs
Browse files Browse the repository at this point in the history
  • Loading branch information
bnewbold committed Oct 6, 2023
1 parent 209acd9 commit aa95123
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion atproto/syntax/handle.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,18 @@ func ParseHandle(raw string) (Handle, error) {
}

// Some top-level domains (TLDs) are disallowed for registration across the atproto ecosystem. The *syntax* is valid, but these should never be considered acceptable handles for account registration or linking.
//
// The reserved '.test' TLD is allowed, for testing and development. It is expected that '.test' domain resolution will fail in a real-world network.
func (h Handle) AllowedTLD() bool {
switch h.TLD() {
case "local",
"arpa",
"invalid",
"localhost",
"internal",
"onion":
"example",
"onion",
"alt":
return false
}
return true
Expand Down

0 comments on commit aa95123

Please sign in to comment.