From aa95123bf6bd1516d46ba5e0854a61a9760ae76c Mon Sep 17 00:00:00 2001 From: bryan newbold Date: Thu, 5 Oct 2023 17:42:37 -0700 Subject: [PATCH] syntax: disallow .example and .alt TLDs --- atproto/syntax/handle.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/atproto/syntax/handle.go b/atproto/syntax/handle.go index 9693f8b06..0efe29179 100644 --- a/atproto/syntax/handle.go +++ b/atproto/syntax/handle.go @@ -31,6 +31,8 @@ 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", @@ -38,7 +40,9 @@ func (h Handle) AllowedTLD() bool { "invalid", "localhost", "internal", - "onion": + "example", + "onion", + "alt": return false } return true