Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bluesky: change fediverse handle format? #830

Closed
snarfed opened this issue Feb 12, 2024 · 13 comments
Closed

Bluesky: change fediverse handle format? #830

snarfed opened this issue Feb 12, 2024 · 13 comments
Labels

Comments

@snarfed
Copy link
Owner

snarfed commented Feb 12, 2024

I'm considering changing our Bluesky handle format.

Right now, we use subdomain labels liberally to convert fediverse addresses like @[email protected] to Bluesky handles like user.example.com.ap.brid.gy. This works, and it's simple, but it has drawbacks. We've been struggling to plan for how to scale handle verification, #744.

If I switch to the - character for the fediverse address part, eg user-example-com.ap.brid.gy, the resulting handles are more complicated, but I can switch to Bluesky's HTTPS handle verification method, and I'd only need a single wildcard DNS record and a single wildcard SSL cert.

I'm inclined to do it.

@andrewtj
Copy link

Just in case it's not on your radar, DNS names do have a 63-byte label length limit. (Label being the bit between dots.)

I'd guess it's unlikely that this would be a problem in practice but I don't have anything really substantive to support that feeling.

@snarfed
Copy link
Owner Author

snarfed commented Feb 12, 2024

Thanks, yes! 63 chars per label, 253 chars total.

I also need to look at allowed characters. For DNS it's just alphanumeric and -, right? WebFinger usernames may allow a few more, eg .s, which users would also need to translate to -s.

@snarfed
Copy link
Owner Author

snarfed commented Feb 12, 2024

@jfietkau
Copy link

Also notably, as I understand the RFCs, WebFinger usernames are case sensitive while hostnames are not. In theory, an ActivityPub server using WebFinger may have two or more distinct user accounts whose account names differ only by capitalization.

I don't think this has happened in practice and it would probably cause untold havoc with interoperability if it were tried, but I figured I'd let you know if you're aiming for full spec compliance.

@andrewtj
Copy link

I also need to look at allowed characters. For DNS it's just alphanumeric and -, right?

Kinda. DNS labels are arbitrary bytes but case insensitive to a-z. Hostname labels are alphanumeric and dash (for the most part). To enable internationalisation IDNA (RFC 5890 and RFC 5891) then represents a normalised subset of unicode in a hostname label compatible format. If that's something you want to handle dnspython has some helpers for marshalling names to and from IDNA.

@WisTex
Copy link

WisTex commented Feb 15, 2024

Some platforms support - and _ in their handles. Even domains can have a - in it.

You would need to account for this when you create the Bluesky version of the handle.

@snarfed
Copy link
Owner Author

snarfed commented Feb 16, 2024

Yup, absolutely true. Ugh.

I'm sure I/we can come up with an encoding that can turn every fediverse handle into a single DNS compliant label, and it might still be worth it to avoid the DNS zone scaling issue...but UX-wise, it's getting uglier and uglier. Sigh.

Damn you, @zooko and your Triangle. (Kidding! Been a while, hope you're good!)

@WisTex
Copy link

WisTex commented Feb 22, 2024

Would making it two levels help? (i.e. separating username and server)

username.social-example-com.ap.brid.gy for [email protected]

That would reduce the number of zones, although that may not matter depending on how you implemented creating the zones.

@snarfed
Copy link
Owner Author

snarfed commented Feb 22, 2024

Yeah I've considered various multi-level formats like that. The DNS scaling concern (more in #744) is mainly the number of records, regardless of how they're organized into zones.

The win of going fully flat under ap.brid.gy, as is proposed here, is that we can drop DNS entirely and use ATProto's HTTPS-based handle resolution method instead. That scales better in number of accounts, but SSL certs only support a single level of wildcards, ie *.ap.brid.gy but not *.*.ap.brid.gy, so the namespace would need to be flat. 🤷

@zooko
Copy link

zooko commented Feb 22, 2024 via email

@WisTex
Copy link

WisTex commented Feb 26, 2024

And with the number of subdomains, AutoSSL for each one will become a pain.

The tricky part will be handling domains and usernames with - in it.

@snarfed
Copy link
Owner Author

snarfed commented Feb 27, 2024

Given that this is only a win if it's entirely flat (#830 (comment)), and that means we'd need to come up with a more complicated encoding to handle -, _, ~, and similar characters, which would significantly hurt UX, I'm now less inclined to do this. Sigh.

@snarfed
Copy link
Owner Author

snarfed commented May 2, 2024

Decided against this, sadly.

@snarfed snarfed closed this as not planned Won't fix, can't repro, duplicate, stale May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants