Skip to content

Conversation

@tom-sherman
Copy link
Contributor

@tom-sherman tom-sherman commented Dec 18, 2025

Closes #241

There are potential edge cases to consider around account deletion eg. what if someone takes hold of the domain, they have then taken over the account. I'm just choosing to ignore this for now, we can cross that bridge when we come to it.

@vercel
Copy link

vercel bot commented Dec 18, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
frontpage Ready Ready Preview, Comment Dec 18, 2025 3:54pm
3 Skipped Deployments
Project Deployment Review Updated (UTC)
atproto-browser Skipped Skipped Dec 18, 2025 3:54pm
frontpage-oauth-preview-client Skipped Skipped Dec 18, 2025 3:54pm
unravel Skipped Skipped Dec 18, 2025 3:54pm

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for did:web identifiers alongside the existing did:plc support, enabling the application to resolve decentralized identifiers from web-based sources in addition to the PLC directory.

Key changes:

  • Updated the DID type definition to accept both did:plc and did:web formats
  • Replaced single PlcDidDocumentResolver with CompositeDidDocumentResolver that handles both DID methods
  • Integrated isAtprotoDid from @atcute/identity for standardized DID validation

@tom-sherman
Copy link
Contributor Author

Instead of accepting the potential concerns of did:web, maybe we just continue to prevent did:webs from logging in or creating records? But still keep the did:web implementation there for eg. feedgen servers.


type Brand<K, T> = K & { __brand: T };
export type DID = Brand<`did:plc:${string}`, "DID">;
export type DID = Brand<`did:${"plc" | "web"}:${string}`, "DID">;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that we have the template literal type the brand has less value, but it's still nice to have because it's much easier to trace where exactly DID values are being created. Compared to just the template literal where any line of code can just do

`did:web:example.com` as const

And that is now a value assignable to something that accepts a DID.

@tom-sherman
Copy link
Contributor Author

I don't think we should support did:webs for user accounts but will need to be able to handle them for service accounts like feedgens.

I can't find a nice way to support separate functions to support both. Separate types (eg. PlcDID and WebDID) is kinda yuck but maybe the best way. This might be the best way to represent "this code uses plc dids, not web dids" instead of having a single DID type that represents both kinds and then checking the method in invariants.

@tom-sherman
Copy link
Contributor Author

Gonna sleep on that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants