@getcirrus/pds 0.10.1 → 0.10.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/cli.js +12 -2
- package/dist/index.d.ts +20 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +163 -27
- package/dist/index.js.map +1 -1
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -387,7 +387,7 @@ See [Cloudflare's data location documentation](https://developers.cloudflare.com
|
|
|
387
387
|
| ------------------------------ | ----------------------------------------------------- |
|
|
388
388
|
| `GET /.well-known/did.json` | DID document for did:web resolution |
|
|
389
389
|
| `GET /.well-known/atproto-did` | Handle verification (only if handle matches hostname) |
|
|
390
|
-
| `GET /
|
|
390
|
+
| `GET /xrpc/_health` | Health check with version info |
|
|
391
391
|
|
|
392
392
|
### Federation (Sync)
|
|
393
393
|
|
package/dist/cli.js
CHANGED
|
@@ -611,7 +611,7 @@ var PDSClient = class PDSClient {
|
|
|
611
611
|
* Get account status including migration progress
|
|
612
612
|
*/
|
|
613
613
|
async getAccountStatus() {
|
|
614
|
-
const url = new URL("/xrpc/com.atproto.server.
|
|
614
|
+
const url = new URL("/xrpc/com.atproto.server.checkAccountStatus", this.baseUrl);
|
|
615
615
|
const headers = {};
|
|
616
616
|
if (this.authToken) headers["Authorization"] = `Bearer ${this.authToken}`;
|
|
617
617
|
const res = await fetch(url.toString(), {
|
|
@@ -2113,6 +2113,15 @@ const initCommand = defineCommand({
|
|
|
2113
2113
|
spinner.stop("Password hashed");
|
|
2114
2114
|
return hash;
|
|
2115
2115
|
});
|
|
2116
|
+
const email = await promptText({
|
|
2117
|
+
message: "Email address (optional, some clients expect it - press Enter to skip)",
|
|
2118
|
+
placeholder: "you@example.com",
|
|
2119
|
+
defaultValue: "",
|
|
2120
|
+
validate: (value) => {
|
|
2121
|
+
if (!value) return;
|
|
2122
|
+
if (!value.includes("@")) return "Must be a valid email address";
|
|
2123
|
+
}
|
|
2124
|
+
});
|
|
2116
2125
|
spinner.start("Updating wrangler.jsonc...");
|
|
2117
2126
|
setWorkerName(workerName);
|
|
2118
2127
|
setVars({
|
|
@@ -2121,7 +2130,8 @@ const initCommand = defineCommand({
|
|
|
2121
2130
|
HANDLE: handle,
|
|
2122
2131
|
SIGNING_KEY_PUBLIC: signingKeyPublic,
|
|
2123
2132
|
INITIAL_ACTIVE: initialActive,
|
|
2124
|
-
DATA_LOCATION: dataLocation
|
|
2133
|
+
DATA_LOCATION: dataLocation,
|
|
2134
|
+
...email ? { EMAIL: email } : {}
|
|
2125
2135
|
});
|
|
2126
2136
|
setCustomDomains([hostname]);
|
|
2127
2137
|
spinner.stop("wrangler.jsonc updated");
|
package/dist/index.d.ts
CHANGED
|
@@ -97,6 +97,14 @@ declare class SqliteRepoStorage extends ReadableBlockstore implements RepoStorag
|
|
|
97
97
|
* Set the activation state of the account.
|
|
98
98
|
*/
|
|
99
99
|
setActive(active: boolean): Promise<void>;
|
|
100
|
+
/**
|
|
101
|
+
* Get the stored email address.
|
|
102
|
+
*/
|
|
103
|
+
getEmail(): string | null;
|
|
104
|
+
/**
|
|
105
|
+
* Set the email address.
|
|
106
|
+
*/
|
|
107
|
+
setEmail(email: string): void;
|
|
100
108
|
/**
|
|
101
109
|
* Add a blob reference from a record.
|
|
102
110
|
*/
|
|
@@ -296,6 +304,8 @@ interface PDSEnv {
|
|
|
296
304
|
ACCOUNT: DurableObjectNamespace<AccountDurableObject>;
|
|
297
305
|
/** R2 bucket for blob storage (optional) */
|
|
298
306
|
BLOBS?: R2Bucket;
|
|
307
|
+
/** Account email address (optional, used by some clients) */
|
|
308
|
+
EMAIL?: string;
|
|
299
309
|
/** Initial activation state for new accounts (default: true) */
|
|
300
310
|
INITIAL_ACTIVE?: string;
|
|
301
311
|
/**
|
|
@@ -553,6 +563,16 @@ declare class AccountDurableObject extends DurableObject<PDSEnv> {
|
|
|
553
563
|
* RPC method: Put user preferences
|
|
554
564
|
*/
|
|
555
565
|
rpcPutPreferences(preferences: unknown[]): Promise<void>;
|
|
566
|
+
/**
|
|
567
|
+
* RPC method: Get stored email
|
|
568
|
+
*/
|
|
569
|
+
rpcGetEmail(): Promise<{
|
|
570
|
+
email: string | null;
|
|
571
|
+
}>;
|
|
572
|
+
/**
|
|
573
|
+
* RPC method: Update stored email
|
|
574
|
+
*/
|
|
575
|
+
rpcUpdateEmail(email: string): Promise<void>;
|
|
556
576
|
/**
|
|
557
577
|
* RPC method: Get account activation state
|
|
558
578
|
*/
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/storage.ts","../src/oauth-storage.ts","../src/blobs.ts","../src/types.ts","../src/account-do.ts","../src/index.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;;;;cAUa,iBAAA,SACJ,kBAAA,YACG;EAFC,QAAA,GAAA;EAIa,WAAA,CAAA,GAAA,EAAA,UAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/storage.ts","../src/oauth-storage.ts","../src/blobs.ts","../src/types.ts","../src/account-do.ts","../src/index.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;;;;cAUa,iBAAA,SACJ,kBAAA,YACG;EAFC,QAAA,GAAA;EAIa,WAAA,CAAA,GAAA,EAAA,UAAA;EAmGA;;;;EAiCR,UAAA,CAAA,aAAA,CAAA,EAAA,OAAA,CAAA,EAAA,IAAA;EAQG;;;EAcL,OAAA,CAAA,CAAA,EAvDE,OAuDF,CAvDU,GAuDV,GAAA,IAAA,CAAA;EAAM;;;EAU8C,MAAA,CAAA,CAAA,EApDnD,OAoDmD,CAAA,MAAA,GAAA,IAAA,CAAA;EAArC;;;EAmB4B,MAAA,CAAA,CAAA,EA7D1C,OA6D0C,CAAA,MAAA,CAAA;EAYpC;;;EAoBmB,OAAA,CAAA,CAAA,EAnFxB,OAmFwB,CAAA,MAAA,CAAA;EAWf;;;EA6CT,QA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A"}
|
package/dist/index.js
CHANGED
|
@@ -5,6 +5,7 @@ import { CID, asCid, isBlobRef } from "@atproto/lex-data";
|
|
|
5
5
|
import { now } from "@atcute/tid";
|
|
6
6
|
import { decode, encode, fromBytes, isBytes, toBytes, toCidLink } from "@atcute/cbor";
|
|
7
7
|
import { CODEC_RAW, create, fromString, toString } from "@atcute/cid";
|
|
8
|
+
import { jsonToLex } from "@atproto/lex-json";
|
|
8
9
|
import { Hono } from "hono";
|
|
9
10
|
import { cors } from "hono/cors";
|
|
10
11
|
import { isDid, isHandle, isNsid, isRecordKey } from "@atcute/lexicons/syntax";
|
|
@@ -127,7 +128,8 @@ var SqliteRepoStorage = class extends ReadableBlockstore {
|
|
|
127
128
|
root_cid TEXT,
|
|
128
129
|
rev TEXT,
|
|
129
130
|
seq INTEGER NOT NULL DEFAULT 0,
|
|
130
|
-
active INTEGER NOT NULL DEFAULT 1
|
|
131
|
+
active INTEGER NOT NULL DEFAULT 1,
|
|
132
|
+
email TEXT
|
|
131
133
|
);
|
|
132
134
|
|
|
133
135
|
-- Initialize with empty state if not exists
|
|
@@ -188,6 +190,9 @@ var SqliteRepoStorage = class extends ReadableBlockstore {
|
|
|
188
190
|
name TEXT
|
|
189
191
|
);
|
|
190
192
|
`);
|
|
193
|
+
try {
|
|
194
|
+
this.sql.exec("ALTER TABLE repo_state ADD COLUMN email TEXT");
|
|
195
|
+
} catch {}
|
|
191
196
|
}
|
|
192
197
|
/**
|
|
193
198
|
* Get the current root CID of the repository.
|
|
@@ -332,6 +337,19 @@ var SqliteRepoStorage = class extends ReadableBlockstore {
|
|
|
332
337
|
this.sql.exec("UPDATE repo_state SET active = ? WHERE id = 1", active ? 1 : 0);
|
|
333
338
|
}
|
|
334
339
|
/**
|
|
340
|
+
* Get the stored email address.
|
|
341
|
+
*/
|
|
342
|
+
getEmail() {
|
|
343
|
+
const rows = this.sql.exec("SELECT email FROM repo_state WHERE id = 1").toArray();
|
|
344
|
+
return rows.length > 0 ? rows[0].email ?? null : null;
|
|
345
|
+
}
|
|
346
|
+
/**
|
|
347
|
+
* Set the email address.
|
|
348
|
+
*/
|
|
349
|
+
setEmail(email) {
|
|
350
|
+
this.sql.exec("UPDATE repo_state SET email = ? WHERE id = 1", email);
|
|
351
|
+
}
|
|
352
|
+
/**
|
|
335
353
|
* Add a blob reference from a record.
|
|
336
354
|
*/
|
|
337
355
|
addRecordBlob(recordUri, blobCid) {
|
|
@@ -1081,7 +1099,7 @@ var AccountDurableObject = class extends DurableObject {
|
|
|
1081
1099
|
action: WriteOpAction.Create,
|
|
1082
1100
|
collection,
|
|
1083
1101
|
rkey: actualRkey,
|
|
1084
|
-
record
|
|
1102
|
+
record: jsonToLex(record)
|
|
1085
1103
|
};
|
|
1086
1104
|
const prevRev = repo.commit.rev;
|
|
1087
1105
|
this.repo = await repo.applyWrites([createOp], keypair);
|
|
@@ -1167,16 +1185,18 @@ var AccountDurableObject = class extends DurableObject {
|
|
|
1167
1185
|
await this.ensureActive();
|
|
1168
1186
|
const repo = await this.getRepo();
|
|
1169
1187
|
const keypair = await this.getKeypair();
|
|
1170
|
-
const
|
|
1188
|
+
const isUpdate = await repo.getRecord(collection, rkey) !== null;
|
|
1189
|
+
const normalizedRecord = jsonToLex(record);
|
|
1190
|
+
const op = isUpdate ? {
|
|
1171
1191
|
action: WriteOpAction.Update,
|
|
1172
1192
|
collection,
|
|
1173
1193
|
rkey,
|
|
1174
|
-
record
|
|
1194
|
+
record: normalizedRecord
|
|
1175
1195
|
} : {
|
|
1176
1196
|
action: WriteOpAction.Create,
|
|
1177
1197
|
collection,
|
|
1178
1198
|
rkey,
|
|
1179
|
-
record
|
|
1199
|
+
record: normalizedRecord
|
|
1180
1200
|
};
|
|
1181
1201
|
const prevRev = repo.commit.rev;
|
|
1182
1202
|
this.repo = await repo.applyWrites([op], keypair);
|
|
@@ -1231,7 +1251,7 @@ var AccountDurableObject = class extends DurableObject {
|
|
|
1231
1251
|
action: WriteOpAction.Create,
|
|
1232
1252
|
collection: write.collection,
|
|
1233
1253
|
rkey,
|
|
1234
|
-
record: write.value
|
|
1254
|
+
record: jsonToLex(write.value)
|
|
1235
1255
|
};
|
|
1236
1256
|
ops.push(op);
|
|
1237
1257
|
results.push({
|
|
@@ -1246,7 +1266,7 @@ var AccountDurableObject = class extends DurableObject {
|
|
|
1246
1266
|
action: WriteOpAction.Update,
|
|
1247
1267
|
collection: write.collection,
|
|
1248
1268
|
rkey: write.rkey,
|
|
1249
|
-
record: write.value
|
|
1269
|
+
record: jsonToLex(write.value)
|
|
1250
1270
|
};
|
|
1251
1271
|
ops.push(op);
|
|
1252
1272
|
results.push({
|
|
@@ -1579,6 +1599,18 @@ var AccountDurableObject = class extends DurableObject {
|
|
|
1579
1599
|
await (await this.getStorage()).putPreferences(preferences);
|
|
1580
1600
|
}
|
|
1581
1601
|
/**
|
|
1602
|
+
* RPC method: Get stored email
|
|
1603
|
+
*/
|
|
1604
|
+
async rpcGetEmail() {
|
|
1605
|
+
return { email: (await this.getStorage()).getEmail() };
|
|
1606
|
+
}
|
|
1607
|
+
/**
|
|
1608
|
+
* RPC method: Update stored email
|
|
1609
|
+
*/
|
|
1610
|
+
async rpcUpdateEmail(email) {
|
|
1611
|
+
(await this.getStorage()).setEmail(email);
|
|
1612
|
+
}
|
|
1613
|
+
/**
|
|
1582
1614
|
* RPC method: Get account activation state
|
|
1583
1615
|
*/
|
|
1584
1616
|
async rpcGetActive() {
|
|
@@ -1811,6 +1843,11 @@ function serializeRecord(obj) {
|
|
|
1811
1843
|
if (obj === null || obj === void 0) return obj;
|
|
1812
1844
|
const cid = asCid(obj);
|
|
1813
1845
|
if (cid) return { $link: cid.toString() };
|
|
1846
|
+
if (obj instanceof Uint8Array) {
|
|
1847
|
+
let binary = "";
|
|
1848
|
+
for (let i = 0; i < obj.length; i++) binary += String.fromCharCode(obj[i]);
|
|
1849
|
+
return { $bytes: btoa(binary) };
|
|
1850
|
+
}
|
|
1814
1851
|
if (Array.isArray(obj)) return obj.map(serializeRecord);
|
|
1815
1852
|
if (typeof obj === "object") {
|
|
1816
1853
|
const result = {};
|
|
@@ -2314,6 +2351,21 @@ function createOAuthApp(accountDOGetter) {
|
|
|
2314
2351
|
});
|
|
2315
2352
|
});
|
|
2316
2353
|
oauth.get("/oauth/authorize", async (c) => {
|
|
2354
|
+
const ua = c.req.header("User-Agent") ?? "";
|
|
2355
|
+
if (/TelegramBot|Slackbot|Discordbot|Twitterbot|facebookexternalhit|WhatsApp/i.test(ua)) return c.html(`<!DOCTYPE html>
|
|
2356
|
+
<html lang="en">
|
|
2357
|
+
<head>
|
|
2358
|
+
<meta charset="UTF-8">
|
|
2359
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
2360
|
+
<title>Cirrus Authorization</title>
|
|
2361
|
+
<meta name="description" content="Cirrus PDS authorization page. Open this link in your browser to continue.">
|
|
2362
|
+
<meta property="og:title" content="Cirrus Authorization">
|
|
2363
|
+
<meta property="og:description" content="Open this link in your browser to continue.">
|
|
2364
|
+
</head>
|
|
2365
|
+
<body>
|
|
2366
|
+
<p>Open this link in your browser to continue.</p>
|
|
2367
|
+
</body>
|
|
2368
|
+
</html>`);
|
|
2317
2369
|
return getProvider(c.env).handleAuthorize(c.req.raw);
|
|
2318
2370
|
});
|
|
2319
2371
|
oauth.post("/oauth/authorize", async (c) => {
|
|
@@ -2667,6 +2719,30 @@ async function handleXrpcProxy(c, didResolver$1, getKeypair$1) {
|
|
|
2667
2719
|
return fetch(targetUrl.toString(), reqInit);
|
|
2668
2720
|
}
|
|
2669
2721
|
|
|
2722
|
+
//#endregion
|
|
2723
|
+
//#region src/format.ts
|
|
2724
|
+
/**
|
|
2725
|
+
* Detect content type from file magic bytes.
|
|
2726
|
+
* Returns the detected MIME type or null if unknown.
|
|
2727
|
+
*/
|
|
2728
|
+
function detectContentType(bytes) {
|
|
2729
|
+
if (bytes.length >= 12) {
|
|
2730
|
+
if (String.fromCharCode(bytes[4], bytes[5], bytes[6], bytes[7]) === "ftyp") {
|
|
2731
|
+
const brand = String.fromCharCode(bytes[8], bytes[9], bytes[10], bytes[11]);
|
|
2732
|
+
if (brand === "isom" || brand === "iso2" || brand === "mp41" || brand === "mp42" || brand === "avc1") return "video/mp4";
|
|
2733
|
+
if (brand === "M4V " || brand === "M4VH" || brand === "M4VP") return "video/x-m4v";
|
|
2734
|
+
if (brand === "qt ") return "video/quicktime";
|
|
2735
|
+
return "video/mp4";
|
|
2736
|
+
}
|
|
2737
|
+
}
|
|
2738
|
+
if (bytes[0] === 255 && bytes[1] === 216 && bytes[2] === 255) return "image/jpeg";
|
|
2739
|
+
if (bytes[0] === 137 && bytes[1] === 80 && bytes[2] === 78 && bytes[3] === 71) return "image/png";
|
|
2740
|
+
if (bytes[0] === 71 && bytes[1] === 73 && bytes[2] === 70) return "image/gif";
|
|
2741
|
+
if (bytes[0] === 82 && bytes[1] === 73 && bytes[2] === 70 && bytes[3] === 70 && bytes[8] === 87 && bytes[9] === 69 && bytes[10] === 66 && bytes[11] === 80) return "image/webp";
|
|
2742
|
+
if (bytes[0] === 26 && bytes[1] === 69 && bytes[2] === 223 && bytes[3] === 163) return "video/webm";
|
|
2743
|
+
return null;
|
|
2744
|
+
}
|
|
2745
|
+
|
|
2670
2746
|
//#endregion
|
|
2671
2747
|
//#region src/xrpc/sync.ts
|
|
2672
2748
|
async function getRepo(c, accountDO) {
|
|
@@ -2803,10 +2879,26 @@ async function getBlob(c, _accountDO) {
|
|
|
2803
2879
|
error: "BlobNotFound",
|
|
2804
2880
|
message: `Blob not found: ${cid}`
|
|
2805
2881
|
}, 404);
|
|
2882
|
+
let contentType = blob.httpMetadata?.contentType;
|
|
2883
|
+
if (!contentType || contentType === "*/*") {
|
|
2884
|
+
const [headerStream, bodyStream] = blob.body.tee();
|
|
2885
|
+
const reader = headerStream.getReader();
|
|
2886
|
+
const { value: headerBytes } = await reader.read();
|
|
2887
|
+
reader.releaseLock();
|
|
2888
|
+
if (headerBytes && headerBytes.length >= 12) contentType = detectContentType(headerBytes) || "application/octet-stream";
|
|
2889
|
+
else contentType = "application/octet-stream";
|
|
2890
|
+
return new Response(bodyStream, {
|
|
2891
|
+
status: 200,
|
|
2892
|
+
headers: {
|
|
2893
|
+
"Content-Type": contentType,
|
|
2894
|
+
"Content-Length": blob.size.toString()
|
|
2895
|
+
}
|
|
2896
|
+
});
|
|
2897
|
+
}
|
|
2806
2898
|
return new Response(blob.body, {
|
|
2807
2899
|
status: 200,
|
|
2808
2900
|
headers: {
|
|
2809
|
-
"Content-Type":
|
|
2901
|
+
"Content-Type": contentType,
|
|
2810
2902
|
"Content-Length": blob.size.toString()
|
|
2811
2903
|
}
|
|
2812
2904
|
});
|
|
@@ -3157,8 +3249,9 @@ async function applyWrites(c, accountDO) {
|
|
|
3157
3249
|
}
|
|
3158
3250
|
}
|
|
3159
3251
|
async function uploadBlob(c, accountDO) {
|
|
3160
|
-
|
|
3252
|
+
let contentType = c.req.header("Content-Type");
|
|
3161
3253
|
const bytes = new Uint8Array(await c.req.arrayBuffer());
|
|
3254
|
+
if (!contentType || contentType === "*/*") contentType = detectContentType(bytes) || "application/octet-stream";
|
|
3162
3255
|
const MAX_BLOB_SIZE = 60 * 1024 * 1024;
|
|
3163
3256
|
if (bytes.length > MAX_BLOB_SIZE) return c.json({
|
|
3164
3257
|
error: "BlobTooLarge",
|
|
@@ -3235,7 +3328,7 @@ async function describeServer(c) {
|
|
|
3235
3328
|
/**
|
|
3236
3329
|
* Create a new session (login)
|
|
3237
3330
|
*/
|
|
3238
|
-
async function createSession(c) {
|
|
3331
|
+
async function createSession(c, accountDO) {
|
|
3239
3332
|
const { identifier, password } = await c.req.json();
|
|
3240
3333
|
if (!identifier || !password) return c.json({
|
|
3241
3334
|
error: "InvalidRequest",
|
|
@@ -3252,19 +3345,22 @@ async function createSession(c) {
|
|
|
3252
3345
|
const serviceDid = `did:web:${c.env.PDS_HOSTNAME}`;
|
|
3253
3346
|
const accessJwt = await createAccessToken(c.env.JWT_SECRET, c.env.DID, serviceDid);
|
|
3254
3347
|
const refreshJwt = await createRefreshToken(c.env.JWT_SECRET, c.env.DID, serviceDid);
|
|
3348
|
+
const { email: storedEmail } = await accountDO.rpcGetEmail();
|
|
3349
|
+
const email = storedEmail || c.env.EMAIL;
|
|
3255
3350
|
return c.json({
|
|
3256
3351
|
accessJwt,
|
|
3257
3352
|
refreshJwt,
|
|
3258
3353
|
handle: c.env.HANDLE,
|
|
3259
3354
|
did: c.env.DID,
|
|
3260
|
-
|
|
3355
|
+
...email ? { email } : {},
|
|
3356
|
+
emailConfirmed: true,
|
|
3261
3357
|
active: true
|
|
3262
3358
|
});
|
|
3263
3359
|
}
|
|
3264
3360
|
/**
|
|
3265
3361
|
* Refresh a session
|
|
3266
3362
|
*/
|
|
3267
|
-
async function refreshSession(c) {
|
|
3363
|
+
async function refreshSession(c, accountDO) {
|
|
3268
3364
|
const authHeader = c.req.header("Authorization");
|
|
3269
3365
|
if (!authHeader?.startsWith("Bearer ")) return c.json({
|
|
3270
3366
|
error: "AuthenticationRequired",
|
|
@@ -3279,12 +3375,15 @@ async function refreshSession(c) {
|
|
|
3279
3375
|
}, 401);
|
|
3280
3376
|
const accessJwt = await createAccessToken(c.env.JWT_SECRET, c.env.DID, serviceDid);
|
|
3281
3377
|
const refreshJwt = await createRefreshToken(c.env.JWT_SECRET, c.env.DID, serviceDid);
|
|
3378
|
+
const { email: storedEmail } = await accountDO.rpcGetEmail();
|
|
3379
|
+
const email = storedEmail || c.env.EMAIL;
|
|
3282
3380
|
return c.json({
|
|
3283
3381
|
accessJwt,
|
|
3284
3382
|
refreshJwt,
|
|
3285
3383
|
handle: c.env.HANDLE,
|
|
3286
3384
|
did: c.env.DID,
|
|
3287
|
-
|
|
3385
|
+
...email ? { email } : {},
|
|
3386
|
+
emailConfirmed: true,
|
|
3288
3387
|
active: true
|
|
3289
3388
|
});
|
|
3290
3389
|
} catch (err) {
|
|
@@ -3301,7 +3400,7 @@ async function refreshSession(c) {
|
|
|
3301
3400
|
/**
|
|
3302
3401
|
* Get current session info
|
|
3303
3402
|
*/
|
|
3304
|
-
async function getSession(c) {
|
|
3403
|
+
async function getSession(c, accountDO) {
|
|
3305
3404
|
const authHeader = c.req.header("Authorization");
|
|
3306
3405
|
if (!authHeader?.startsWith("Bearer ")) return c.json({
|
|
3307
3406
|
error: "AuthenticationRequired",
|
|
@@ -3309,21 +3408,29 @@ async function getSession(c) {
|
|
|
3309
3408
|
}, 401);
|
|
3310
3409
|
const token = authHeader.slice(7);
|
|
3311
3410
|
const serviceDid = `did:web:${c.env.PDS_HOSTNAME}`;
|
|
3312
|
-
if (token === c.env.AUTH_TOKEN)
|
|
3313
|
-
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
|
|
3317
|
-
|
|
3411
|
+
if (token === c.env.AUTH_TOKEN) {
|
|
3412
|
+
const { email: storedEmail } = await accountDO.rpcGetEmail();
|
|
3413
|
+
const email = storedEmail || c.env.EMAIL;
|
|
3414
|
+
return c.json({
|
|
3415
|
+
handle: c.env.HANDLE,
|
|
3416
|
+
did: c.env.DID,
|
|
3417
|
+
...email ? { email } : {},
|
|
3418
|
+
emailConfirmed: true,
|
|
3419
|
+
active: true
|
|
3420
|
+
});
|
|
3421
|
+
}
|
|
3318
3422
|
try {
|
|
3319
3423
|
if ((await verifyAccessToken(token, c.env.JWT_SECRET, serviceDid)).sub !== c.env.DID) return c.json({
|
|
3320
3424
|
error: "AuthenticationRequired",
|
|
3321
3425
|
message: "Invalid access token"
|
|
3322
3426
|
}, 401);
|
|
3427
|
+
const { email: storedEmail } = await accountDO.rpcGetEmail();
|
|
3428
|
+
const email = storedEmail || c.env.EMAIL;
|
|
3323
3429
|
return c.json({
|
|
3324
3430
|
handle: c.env.HANDLE,
|
|
3325
3431
|
did: c.env.DID,
|
|
3326
|
-
|
|
3432
|
+
...email ? { email } : {},
|
|
3433
|
+
emailConfirmed: true,
|
|
3327
3434
|
active: true
|
|
3328
3435
|
});
|
|
3329
3436
|
} catch (err) {
|
|
@@ -3346,7 +3453,7 @@ async function deleteSession(c) {
|
|
|
3346
3453
|
/**
|
|
3347
3454
|
* Get account status - used for migration checks and progress tracking
|
|
3348
3455
|
*/
|
|
3349
|
-
async function
|
|
3456
|
+
async function checkAccountStatus(c, accountDO) {
|
|
3350
3457
|
try {
|
|
3351
3458
|
const status = await accountDO.rpcGetRepoStatus();
|
|
3352
3459
|
const active = await accountDO.rpcGetActive();
|
|
@@ -3433,6 +3540,32 @@ async function deactivateAccount(c, accountDO) {
|
|
|
3433
3540
|
}
|
|
3434
3541
|
}
|
|
3435
3542
|
/**
|
|
3543
|
+
* Request a token to update the account email.
|
|
3544
|
+
* Single-user PDS: no token needed, always returns tokenRequired: false.
|
|
3545
|
+
*/
|
|
3546
|
+
async function requestEmailUpdate(c) {
|
|
3547
|
+
return c.json({ tokenRequired: false });
|
|
3548
|
+
}
|
|
3549
|
+
/**
|
|
3550
|
+
* Request email confirmation.
|
|
3551
|
+
* Single-user PDS: email is always confirmed, nothing to do.
|
|
3552
|
+
*/
|
|
3553
|
+
async function requestEmailConfirmation(c) {
|
|
3554
|
+
return c.json({});
|
|
3555
|
+
}
|
|
3556
|
+
/**
|
|
3557
|
+
* Update the account email address
|
|
3558
|
+
*/
|
|
3559
|
+
async function updateEmail(c, accountDO) {
|
|
3560
|
+
const body = await c.req.json();
|
|
3561
|
+
if (!body.email) return c.json({
|
|
3562
|
+
error: "InvalidRequest",
|
|
3563
|
+
message: "Missing required field: email"
|
|
3564
|
+
}, 400);
|
|
3565
|
+
await accountDO.rpcUpdateEmail(body.email);
|
|
3566
|
+
return c.json({});
|
|
3567
|
+
}
|
|
3568
|
+
/**
|
|
3436
3569
|
* Reset migration state - clears imported repo and blob tracking.
|
|
3437
3570
|
* Only works on deactivated accounts.
|
|
3438
3571
|
*/
|
|
@@ -4044,7 +4177,7 @@ function renderPasskeyErrorPage(error, description) {
|
|
|
4044
4177
|
|
|
4045
4178
|
//#endregion
|
|
4046
4179
|
//#region package.json
|
|
4047
|
-
var version = "0.10.
|
|
4180
|
+
var version = "0.10.3";
|
|
4048
4181
|
|
|
4049
4182
|
//#endregion
|
|
4050
4183
|
//#region src/index.ts
|
|
@@ -4219,14 +4352,17 @@ app.use("/xrpc/com.atproto.identity.resolveHandle", async (c, next) => {
|
|
|
4219
4352
|
app.post("/xrpc/com.atproto.identity.requestPlcOperationSignature", requireAuth, requestPlcOperationSignature);
|
|
4220
4353
|
app.post("/xrpc/com.atproto.identity.signPlcOperation", requireAuth, signPlcOperation);
|
|
4221
4354
|
app.get("/xrpc/gg.mk.experimental.getMigrationToken", requireAuth, getMigrationToken);
|
|
4222
|
-
app.post("/xrpc/com.atproto.server.createSession", createSession);
|
|
4223
|
-
app.post("/xrpc/com.atproto.server.refreshSession", refreshSession);
|
|
4224
|
-
app.get("/xrpc/com.atproto.server.getSession", getSession);
|
|
4355
|
+
app.post("/xrpc/com.atproto.server.createSession", (c) => createSession(c, getAccountDO(c.env)));
|
|
4356
|
+
app.post("/xrpc/com.atproto.server.refreshSession", (c) => refreshSession(c, getAccountDO(c.env)));
|
|
4357
|
+
app.get("/xrpc/com.atproto.server.getSession", (c) => getSession(c, getAccountDO(c.env)));
|
|
4225
4358
|
app.post("/xrpc/com.atproto.server.deleteSession", deleteSession);
|
|
4226
|
-
app.get("/xrpc/com.atproto.server.
|
|
4359
|
+
app.get("/xrpc/com.atproto.server.checkAccountStatus", requireAuth, (c) => checkAccountStatus(c, getAccountDO(c.env)));
|
|
4227
4360
|
app.post("/xrpc/com.atproto.server.activateAccount", requireAuth, (c) => activateAccount(c, getAccountDO(c.env)));
|
|
4228
4361
|
app.post("/xrpc/com.atproto.server.deactivateAccount", requireAuth, (c) => deactivateAccount(c, getAccountDO(c.env)));
|
|
4229
4362
|
app.post("/xrpc/gg.mk.experimental.resetMigration", requireAuth, (c) => resetMigration(c, getAccountDO(c.env)));
|
|
4363
|
+
app.post("/xrpc/com.atproto.server.requestEmailUpdate", requireAuth, requestEmailUpdate);
|
|
4364
|
+
app.post("/xrpc/com.atproto.server.requestEmailConfirmation", requireAuth, requestEmailConfirmation);
|
|
4365
|
+
app.post("/xrpc/com.atproto.server.updateEmail", requireAuth, (c) => updateEmail(c, getAccountDO(c.env)));
|
|
4230
4366
|
app.get("/xrpc/com.atproto.server.getServiceAuth", requireAuth, getServiceAuth);
|
|
4231
4367
|
app.get("/xrpc/app.bsky.actor.getPreferences", requireAuth, async (c) => {
|
|
4232
4368
|
const result = await getAccountDO(c.env).rpcGetPreferences();
|