Repository navigation
Upgrade wrapped atproto PDS to latest upstream (Node 22 + ESM) #233
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
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
b3c66f6
build(pds-core): move to Node 22 + pure ESM
aspiers 78f6f49
build(pds-core): bump @atproto deps to latest upstream
aspiers 16098dc
refactor(pds-core): repoint oauth-provider imports to 0.21 subpaths
aspiers b0aa58c
fix(pds-core): adopt strongly-typed Account did/handle
aspiers 9a064fd
fix(pds-core): match chooser enrichment to oauth-provider-ui 0.8 markup
aspiers ebd214e
docs(changeset): atproto upstream upgrade + Node 22 requirement
aspiers d785908
fix(pds-core): replace __dirname with import.meta.url under ESM
aspiers c7faa35
test(pds-core): extract + cover internal handle-guard decisions
aspiers d386399
test(pds-core): cover constructed-handle branding guard
aspiers 12147f1
fix(pds-core): tighten Node floor to 22.19.0 and align tsconfig module
aspiers 4338d76
refactor(pds-core): group imports before module init
aspiers d70111a
fix(pds-core): realistic PLC DID in guard tests; correct changeset em…
aspiers File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| --- | ||
| 'ePDS': minor | ||
| --- | ||
|
|
||
| Signing in and managing your account now run on the latest AT Protocol server, which requires operators to upgrade to Node.js 22.19 or newer. | ||
|
|
||
| **Affects:** End users, Operators | ||
|
|
||
| **End users:** the account and sign-in screens now come from a newer version of the underlying AT Protocol software, which adds changing your handle and deactivating or deleting your account through the account-management interface. The passwordless email-code sign-in and email verification you already use through ePDS are unchanged. | ||
|
|
||
| **Operators:** | ||
|
|
||
| - ePDS now requires **Node.js 22.19.0 or newer** (previously 20). Deployments pinned to Node 20 must upgrade; the Docker images already use `node:22-alpine`. `engines.node` is now `>=22.19.0` (the floor is set by a transitive `undici@8` runtime dependency, which fails on Node 22.0–22.18). | ||
| - The bundled AT Protocol packages moved to their latest releases: `@atproto/pds` 0.5.23, `@atproto/oauth-provider` 0.21.1, `@atproto/oauth-provider-ui` 0.8.9. | ||
| - No configuration changes are required, but the native `better-sqlite3` module must be built for the Node 22 ABI — a clean `pnpm install` on Node 22 handles this; an in-place Node version switch needs `pnpm rebuild better-sqlite3`. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 22.19.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,83 @@ | ||
| import { describe, expect, it } from 'vitest' | ||
| import { | ||
| canLookUpAccountByHandle, | ||
| canCheckHandle, | ||
| canResolveHandle, | ||
| isValidConstructedHandle, | ||
| } from '../lib/identifier-guards.js' | ||
|
|
||
| describe('canLookUpAccountByHandle', () => { | ||
| it('accepts a valid handle', () => { | ||
| expect(canLookUpAccountByHandle('alice.example.com')).toBe(true) | ||
| }) | ||
|
|
||
| it('accepts a valid DID', () => { | ||
| expect(canLookUpAccountByHandle('did:plc:7iza6de2dwap2sbkpav7c6c6')).toBe( | ||
| true, | ||
| ) | ||
| }) | ||
|
|
||
| it('rejects a syntactically invalid identifier', () => { | ||
| expect(canLookUpAccountByHandle('not a handle')).toBe(false) | ||
| }) | ||
|
|
||
| it('rejects an empty string', () => { | ||
| expect(canLookUpAccountByHandle('')).toBe(false) | ||
| }) | ||
|
|
||
| it('rejects a bare word with no dot and no did: prefix', () => { | ||
| expect(canLookUpAccountByHandle('alice')).toBe(false) | ||
| }) | ||
| }) | ||
|
|
||
| describe('canCheckHandle', () => { | ||
| it('accepts a valid handle', () => { | ||
| expect(canCheckHandle('alice.example.com')).toBe(true) | ||
| }) | ||
|
|
||
| it('rejects a DID (this endpoint only accepts handles)', () => { | ||
| // A DID is not a HandleString, so availability-check treats it as invalid | ||
| // — which the endpoint reports as "taken", never "free". | ||
| expect(canCheckHandle('did:plc:7iza6de2dwap2sbkpav7c6c6')).toBe(false) | ||
| }) | ||
|
|
||
| it('rejects a syntactically invalid handle', () => { | ||
| expect(canCheckHandle('has spaces.example.com')).toBe(false) | ||
| }) | ||
|
|
||
| it('rejects a handle with no dot', () => { | ||
| expect(canCheckHandle('alice')).toBe(false) | ||
| }) | ||
| }) | ||
|
|
||
| describe('canResolveHandle', () => { | ||
| it('accepts a valid hosted handle', () => { | ||
| expect(canResolveHandle('alice.hosted.example')).toBe(true) | ||
| }) | ||
|
|
||
| it('rejects a syntactically invalid handle', () => { | ||
| expect(canResolveHandle('bad handle')).toBe(false) | ||
| }) | ||
|
|
||
| it('rejects an empty domain', () => { | ||
| expect(canResolveHandle('')).toBe(false) | ||
| }) | ||
| }) | ||
|
|
||
| describe('isValidConstructedHandle', () => { | ||
| it('accepts a well-formed `${local}.${domain}` handle', () => { | ||
| expect(isValidConstructedHandle('alice.example.com')).toBe(true) | ||
| }) | ||
|
|
||
| it('accepts a generated random-style handle', () => { | ||
| expect(isValidConstructedHandle('brave-otter-42.example.com')).toBe(true) | ||
| }) | ||
|
|
||
| it('rejects a handle with no domain suffix (construction bug)', () => { | ||
| expect(isValidConstructedHandle('alice')).toBe(false) | ||
| }) | ||
|
|
||
| it('rejects a handle containing whitespace', () => { | ||
| expect(isValidConstructedHandle('alice bob.example.com')).toBe(false) | ||
| }) | ||
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.