@atproto/pds 0.5.33 → 0.5.35

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.
Files changed (63) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/dist/actor-store/actor-store-reader.d.ts +3 -2
  3. package/dist/actor-store/actor-store-reader.d.ts.map +1 -1
  4. package/dist/actor-store/actor-store-reader.js +2 -2
  5. package/dist/actor-store/actor-store-reader.js.map +1 -1
  6. package/dist/actor-store/actor-store-transactor.d.ts +3 -2
  7. package/dist/actor-store/actor-store-transactor.d.ts.map +1 -1
  8. package/dist/actor-store/actor-store-transactor.js +1 -1
  9. package/dist/actor-store/actor-store-transactor.js.map +1 -1
  10. package/dist/actor-store/actor-store.d.ts +5 -4
  11. package/dist/actor-store/actor-store.d.ts.map +1 -1
  12. package/dist/actor-store/actor-store.js.map +1 -1
  13. package/dist/actor-store/record/reader.d.ts +5 -3
  14. package/dist/actor-store/record/reader.d.ts.map +1 -1
  15. package/dist/actor-store/record/reader.js +19 -8
  16. package/dist/actor-store/record/reader.js.map +1 -1
  17. package/dist/actor-store/record/transactor.d.ts +3 -1
  18. package/dist/actor-store/record/transactor.d.ts.map +1 -1
  19. package/dist/actor-store/record/transactor.js +3 -2
  20. package/dist/actor-store/record/transactor.js.map +1 -1
  21. package/dist/actor-store/repo/reader.d.ts +3 -1
  22. package/dist/actor-store/repo/reader.d.ts.map +1 -1
  23. package/dist/actor-store/repo/reader.js +3 -2
  24. package/dist/actor-store/repo/reader.js.map +1 -1
  25. package/dist/actor-store/repo/transactor.d.ts +3 -2
  26. package/dist/actor-store/repo/transactor.d.ts.map +1 -1
  27. package/dist/actor-store/repo/transactor.js +2 -2
  28. package/dist/actor-store/repo/transactor.js.map +1 -1
  29. package/dist/api/app/bsky/notification/registerPush.d.ts.map +1 -1
  30. package/dist/api/app/bsky/notification/registerPush.js +3 -5
  31. package/dist/api/app/bsky/notification/registerPush.js.map +1 -1
  32. package/dist/api/app/bsky/notification/unregisterPush.d.ts.map +1 -1
  33. package/dist/api/app/bsky/notification/unregisterPush.js +3 -5
  34. package/dist/api/app/bsky/notification/unregisterPush.js.map +1 -1
  35. package/dist/api/com/atproto/admin/getSubjectStatus.js +1 -1
  36. package/dist/api/com/atproto/admin/getSubjectStatus.js.map +1 -1
  37. package/dist/api/com/atproto/admin/updateSubjectStatus.js +1 -1
  38. package/dist/api/com/atproto/admin/updateSubjectStatus.js.map +1 -1
  39. package/dist/api/com/atproto/moderation/createReport.d.ts.map +1 -1
  40. package/dist/api/com/atproto/moderation/createReport.js +1 -5
  41. package/dist/api/com/atproto/moderation/createReport.js.map +1 -1
  42. package/dist/api/com/atproto/server/activateAccount.d.ts.map +1 -1
  43. package/dist/api/com/atproto/server/activateAccount.js +3 -1
  44. package/dist/api/com/atproto/server/activateAccount.js.map +1 -1
  45. package/dist/api/com/atproto/server/deactivateAccount.d.ts +1 -1
  46. package/dist/api/com/atproto/server/deactivateAccount.d.ts.map +1 -1
  47. package/dist/api/com/atproto/server/deactivateAccount.js +11 -5
  48. package/dist/api/com/atproto/server/deactivateAccount.js.map +1 -1
  49. package/dist/config/config.d.ts +5 -0
  50. package/dist/config/config.d.ts.map +1 -1
  51. package/dist/config/config.js.map +1 -1
  52. package/dist/context.d.ts +10 -0
  53. package/dist/context.d.ts.map +1 -1
  54. package/dist/context.js +98 -45
  55. package/dist/context.js.map +1 -1
  56. package/dist/pipethrough.d.ts +1 -1
  57. package/dist/pipethrough.d.ts.map +1 -1
  58. package/dist/pipethrough.js +18 -10
  59. package/dist/pipethrough.js.map +1 -1
  60. package/dist/read-after-write/util.d.ts.map +1 -1
  61. package/dist/read-after-write/util.js +1 -1
  62. package/dist/read-after-write/util.js.map +1 -1
  63. package/package.json +14 -15
@@ -1 +1 @@
1
- {"version":3,"file":"reader.js","sourceRoot":"","sources":["../../../src/actor-store/repo/reader.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAE9C,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAEpD,MAAM,OAAO,UAAU;IAKrB,YACS,EAAW,EACX,SAAoB;kBADpB,EAAE;yBACF,SAAS;QAEhB,IAAI,CAAC,IAAI,GAAG,IAAI,UAAU,CAAC,EAAE,EAAE,SAAS,CAAC,CAAA;QACzC,IAAI,CAAC,MAAM,GAAG,IAAI,YAAY,CAAC,EAAE,CAAC,CAAA;QAClC,IAAI,CAAC,OAAO,GAAG,IAAI,aAAa,CAAC,EAAE,CAAC,CAAA;IACtC,CAAC;IAED,KAAK,CAAC,gBAAgB;QACpB,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,eAAe,EAAE,CAAA;QACjD,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAA;QAC3D,OAAO;YACL,GAAG,EAAE,IAAI,CAAC,GAAG;YACb,GAAG,EAAE,IAAI,CAAC,GAAG;YACb,MAAM;SACP,CAAA;IACH,CAAC;CACF","sourcesContent":["import type { BlobStore } from '@atproto/repo'\nimport type { SyncEvtData } from '../../repo/index.js'\nimport { BlobReader } from '../blob/reader.js'\nimport type { ActorDb } from '../db/index.js'\nimport { RecordReader } from '../record/reader.js'\nimport { SqlRepoReader } from './sql-repo-reader.js'\n\nexport class RepoReader {\n blob: BlobReader\n record: RecordReader\n storage: SqlRepoReader\n\n constructor(\n public db: ActorDb,\n public blobstore: BlobStore,\n ) {\n this.blob = new BlobReader(db, blobstore)\n this.record = new RecordReader(db)\n this.storage = new SqlRepoReader(db)\n }\n\n async getSyncEventData(): Promise<SyncEvtData> {\n const root = await this.storage.getRootDetailed()\n const { blocks } = await this.storage.getBlocks([root.cid])\n return {\n cid: root.cid,\n rev: root.rev,\n blocks,\n }\n }\n}\n"]}
1
+ {"version":3,"file":"reader.js","sourceRoot":"","sources":["../../../src/actor-store/repo/reader.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAE9C,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAEpD,MAAM,OAAO,UAAU;IAKrB,YACS,EAAW,EACX,SAAoB,EACpB,GAAc;kBAFd,EAAE;yBACF,SAAS;mBACT,GAAG;QAEV,IAAI,CAAC,IAAI,GAAG,IAAI,UAAU,CAAC,EAAE,EAAE,SAAS,CAAC,CAAA;QACzC,IAAI,CAAC,MAAM,GAAG,IAAI,YAAY,CAAC,EAAE,EAAE,GAAG,CAAC,CAAA;QACvC,IAAI,CAAC,OAAO,GAAG,IAAI,aAAa,CAAC,EAAE,CAAC,CAAA;IACtC,CAAC;IAED,KAAK,CAAC,gBAAgB;QACpB,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,eAAe,EAAE,CAAA;QACjD,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAA;QAC3D,OAAO;YACL,GAAG,EAAE,IAAI,CAAC,GAAG;YACb,GAAG,EAAE,IAAI,CAAC,GAAG;YACb,MAAM;SACP,CAAA;IACH,CAAC;CACF","sourcesContent":["import type { DidString } from '@atproto/lex'\nimport type { BlobStore } from '@atproto/repo'\nimport type { SyncEvtData } from '../../repo/index.js'\nimport { BlobReader } from '../blob/reader.js'\nimport type { ActorDb } from '../db/index.js'\nimport { RecordReader } from '../record/reader.js'\nimport { SqlRepoReader } from './sql-repo-reader.js'\n\nexport class RepoReader {\n blob: BlobReader\n record: RecordReader\n storage: SqlRepoReader\n\n constructor(\n public db: ActorDb,\n public blobstore: BlobStore,\n public did: DidString,\n ) {\n this.blob = new BlobReader(db, blobstore)\n this.record = new RecordReader(db, did)\n this.storage = new SqlRepoReader(db)\n }\n\n async getSyncEventData(): Promise<SyncEvtData> {\n const root = await this.storage.getRootDetailed()\n const { blocks } = await this.storage.getBlocks([root.cid])\n return {\n cid: root.cid,\n rev: root.rev,\n blocks,\n }\n }\n}\n"]}
@@ -1,4 +1,5 @@
1
1
  import type * as crypto from '@atproto/crypto';
2
+ import type { DidString } from '@atproto/lex';
2
3
  import { type Cid } from '@atproto/lex-data';
3
4
  import { type BlobStore, Repo } from '@atproto/repo';
4
5
  import type { AtUri } from '@atproto/syntax';
@@ -12,14 +13,14 @@ import { SqlRepoTransactor } from './sql-repo-transactor.js';
12
13
  export declare class RepoTransactor extends RepoReader {
13
14
  db: ActorDb;
14
15
  blobstore: BlobStore;
15
- did: string;
16
+ did: DidString;
16
17
  signingKey: crypto.Keypair;
17
18
  backgroundQueue: BackgroundQueue;
18
19
  now: string;
19
20
  blob: BlobTransactor;
20
21
  record: RecordTransactor;
21
22
  storage: SqlRepoTransactor;
22
- constructor(db: ActorDb, blobstore: BlobStore, did: string, signingKey: crypto.Keypair, backgroundQueue: BackgroundQueue, now?: string);
23
+ constructor(db: ActorDb, blobstore: BlobStore, did: DidString, signingKey: crypto.Keypair, backgroundQueue: BackgroundQueue, now?: string);
23
24
  maybeLoadRepo(): Promise<Repo | null>;
24
25
  createRepo(writes: PreparedCreate[]): Promise<CommitDataWithOps>;
25
26
  processWrites(writes: PreparedWrite[], swapCommitCid?: Cid): Promise<CommitDataWithOps>;
@@ -1 +1 @@
1
- {"version":3,"file":"transactor.d.ts","sourceRoot":"","sources":["../../../src/actor-store/repo/transactor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,MAAM,iBAAiB,CAAA;AAC9C,OAAO,EAAE,KAAK,GAAG,EAAY,MAAM,mBAAmB,CAAA;AACtD,OAAO,EACL,KAAK,SAAS,EACd,IAAI,EAGL,MAAM,eAAe,CAAA;AACtB,OAAO,KAAK,EAAE,KA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EAAE,cAAc,CAAA;IACpB,MAAM,EAAE,gBAAgB,CAAA;IACxB,OAAO,EAAE,iBAAiB,CAAA;IAE1B,YACS,EAAE,EAAE,OAAO,EACX,SAAS,EAAE,SAAS,EACpB,GAAG,EAAE,SAAS,EACd,UAAU,EAAE,MAAM,CAAC,OAAO,EAC1B,eAAe,EAAE,eAAe,EAChC,GAAG,GAAE,MAAiC,EAM9C;IAEK,aAAa,IAAI,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,CAO1C;IAEK,UAAU,CAAC,MAAM,EAAE,cAAc,EAAE,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAsBrE;IAEK,aAAa,CACjB,MAAM,EAAE,aAAa,EAAE,EACvB,aAAa,CAAC,EAAE,GAAG,GAClB,OAAO,CAAC,iBAAiB,CAAC,CAoB5B;IAEK,YAAY,CAChB,MAAM,EAAE,aAAa,EAAE,EACvB,UAAU,CAAC,EAAE,GAAG,GACf,OAAO,CAAC,iBAAiB,CAAC,CAoF5B;IAEK,WAAW,CAAC,MAAM,EAAE,aAAa,EAAE,EAAE,GAAG,EAAE,MAAM,iBAoBrD;IAEK,sBAAsB,CAC1B,IAAI,EAAE,GAAG,EAAE,EACX,WAAW,EAAE,KAAK,EAAE,GACnB,OAAO,CAAC,GAAG,EAAE,CAAC,CAahB;CACF"}
@@ -9,7 +9,7 @@ import { RepoReader } from './reader.js';
9
9
  import { SqlRepoTransactor } from './sql-repo-transactor.js';
10
10
  export class RepoTransactor extends RepoReader {
11
11
  constructor(db, blobstore, did, signingKey, backgroundQueue, now = new Date().toISOString()) {
12
- super(db, blobstore);
12
+ super(db, blobstore, did);
13
13
  this.db = db;
14
14
  this.blobstore = blobstore;
15
15
  this.did = did;
@@ -17,7 +17,7 @@ export class RepoTransactor extends RepoReader {
17
17
  this.backgroundQueue = backgroundQueue;
18
18
  this.now = now;
19
19
  this.blob = new BlobTransactor(db, blobstore, backgroundQueue);
20
- this.record = new RecordTransactor(db, blobstore);
20
+ this.record = new RecordTransactor(db, did, blobstore);
21
21
  this.storage = new SqlRepoTransactor(db, did, now);
22
22
  }
23
23
  async maybeLoadRepo() {
@@ -1 +1 @@
1
- {"version":3,"file":"transactor.js","sourceRoot":"","sources":["../../../src/actor-store/repo/transactor.ts"],"names":[],"mappings":"AACA,OAAO,EAAY,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AACtD,OAAO,EAEL,IAAI,EACJ,aAAa,EACb,aAAa,GACd,MAAM,eAAe,CAAA;AAEtB,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AAE1D,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAChE,OAAO,EACL,kBAAkB,EAClB,kBAAkB,GAKnB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAEtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAE5D,MAAM,OAAO,cAAe,SAAQ,UAAU;IAK5C,YACS,EAAW,EACX,SAAoB,EACpB,GAAW,EACX,UAA0B,EAC1B,eAAgC,EAChC,GAAG,GAAW,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;QAE7C,KAAK,CAAC,EAAE,EAAE,SAAS,CAAC,CAAA;kBAPb,EAAE;yBACF,SAAS;mBACT,GAAG;0BACH,UAAU;+BACV,eAAe;mBACf,GAAG;QAGV,IAAI,CAAC,IAAI,GAAG,IAAI,cAAc,CAAC,EAAE,EAAE,SAAS,EAAE,eAAe,CAAC,CAAA;QAC9D,IAAI,CAAC,MAAM,GAAG,IAAI,gBAAgB,CAAC,EAAE,EAAE,SAAS,CAAC,CAAA;QACjD,IAAI,CAAC,OAAO,GAAG,IAAI,iBAAiB,CAAC,EAAE,EAAE,GAAG,EAAE,GAAG,CA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I,WAAW,CAAC,MAAM,KAAK,CAAC,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAClD,OAAO,EAAE,CAAA;QACX,CAAC;QACD,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAA;QAC7C,MAAM,OAAO,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAA;QACpD,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,EAAE,CAAC,EAAE;aACzB,UAAU,CAAC,QAAQ,CAAC;aACpB,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE,OAAO,CAAC;aAC3B,KAAK,CAAC,KAAK,EAAE,QAAQ,EAAE,OAAO,CAAC;aAC/B,MAAM,CAAC,KAAK,CAAC;aACb,OAAO,EAAE,CAAA;QACZ,OAAO,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAA;IAC5C,CAAC;CACF","sourcesContent":["import type * as crypto from '@atproto/crypto'\nimport { type Cid, parseCid } from '@atproto/lex-data'\nimport {\n type BlobStore,\n Repo,\n WriteOpAction,\n formatDataKey,\n} from '@atproto/repo'\nimport type { AtUri } from '@atproto/syntax'\nimport { InvalidRequestError } from '@atproto/xrpc-server'\nimport type { BackgroundQueue } from '../../background.js'\nimport { createWriteToOp, writeToOp } from '../../repo/index.js'\nimport {\n BadCommitSwapError,\n BadRecordSwapError,\n type CommitDataWithOps,\n type CommitOp,\n type PreparedCreate,\n type PreparedWrite,\n} from '../../repo/types.js'\nimport { BlobTransactor } from '../blob/transactor.js'\nimport type { ActorDb } from '../db/index.js'\nimport { RecordTransactor } from '../record/transactor.js'\nimport { RepoReader } from './reader.js'\nimport { SqlRepoTransactor } from './sql-repo-transactor.js'\n\nexport class RepoTransactor extends RepoReader {\n blob: BlobTransactor\n record: RecordTransactor\n storage: SqlRepoTransactor\n\n constructor(\n public db: ActorDb,\n public blobstore: BlobStore,\n public did: string,\n public signingKey: crypto.Keypair,\n public backgroundQueue: BackgroundQueue,\n public now: string = new Date().toISOString(),\n ) {\n super(db, blobstore)\n this.blob = new BlobTransactor(db, blobstore, backgroundQueue)\n this.record = new RecordTransactor(db, blobstore)\n this.storage = new SqlRepoTransactor(db, did, now)\n }\n\n async maybeLoadRepo(): Promise<Repo | null> {\n const res = await this.db.db\n .selectFrom('repo_root')\n .select('cid')\n .limit(1)\n .executeTakeFirst()\n return res ? Repo.load(this.storage, parseCid(res.cid)) : null\n }\n\n async createRepo(writes: PreparedCreate[]): Promise<CommitDataWithOps> {\n this.db.assertTransaction()\n const commit = await Repo.formatInitCommit(\n this.storage,\n this.did,\n this.signingKey,\n writes.map(createWriteToOp),\n )\n await this.storage.applyCommit(commit, true)\n await this.indexWrites(writes, commit.rev)\n await this.blob.processWriteBlobs(commit.rev, writes)\n\n const ops = writes.map((w) => ({\n action: 'create' as const,\n path: formatDataKey(w.uri.collection, w.uri.rkey),\n cid: w.cid,\n }))\n return {\n ...commit,\n ops,\n prevData: null,\n }\n }\n\n async processWrites(\n writes: PreparedWrite[],\n swapCommitCid?: Cid,\n ): Promise<CommitDataWithOps> {\n this.db.assertTransaction()\n if (writes.length > 200) {\n throw new InvalidRequestError('Too many writes. Max: 200')\n }\n\n const commit = await this.formatCommit(writes, swapCommitCid)\n // Do not allow commits > 2MB\n if (commit.relevantBlocks.byteSize > 2000000) {\n throw new InvalidRequestError('Too many writes. Max event size: 2MB')\n }\n\n // persist the commit to repo storage\n await this.storage.applyCommit(commit)\n // & send to indexing\n await this.indexWrites(writes, commit.rev)\n // process blobs\n await this.blob.processWriteBlobs(commit.rev, writes)\n\n return commit\n }\n\n async formatCommit(\n writes: PreparedWrite[],\n swapCommit?: Cid,\n ): Promise<CommitDataWithOps> {\n // this is not in a txn, so this won't actually hold the lock,\n // we just check if it is currently held by another txn\n const currRoot = await this.storage.getRootDetailed()\n if (!currRoot) {\n throw new InvalidRequestError(`No repo root found for ${this.did}`)\n }\n if (swapCommit && !currRoot.cid.equals(swapCommit)) {\n throw new BadCommitSwapError(currRoot.cid)\n }\n // cache last commit since there's likely overlap\n await this.storage.cacheRev(currRoot.rev)\n const newRecordCids: Cid[] = []\n const delAndUpdateUris: AtUri[] = []\n const commitOps: CommitOp[] = []\n for (const write of writes) {\n const { action, uri, swapCid } = write\n if (action !== WriteOpAction.Delete) {\n newRecordCids.push(write.cid)\n }\n if (action !== WriteOpAction.Create) {\n delAndUpdateUris.push(uri)\n }\n const record = await this.record.getRecord(uri, null, true)\n const currRecord = record ? parseCid(record.cid) : null\n\n const op: CommitOp = {\n action,\n path: formatDataKey(uri.collection, uri.rkey),\n cid: write.action === WriteOpAction.Delete ? null : write.cid,\n }\n if (currRecord) {\n op.prev = currRecord\n }\n commitOps.push(op)\n if (swapCid !== undefined) {\n if (action === WriteOpAction.Create && swapCid !== null) {\n throw new BadRecordSwapError(currRecord) // There should be no current record for a create\n }\n if (action === WriteOpAction.Update && swapCid === null) {\n throw new BadRecordSwapError(currRecord) // There should be a current record for an update\n }\n if (action === WriteOpAction.Delete && swapCid === null) {\n throw new BadRecordSwapError(currRecord) // There should be a current record for a delete\n }\n if (\n // If we have either a current CID or a swap CID\n (currRecord || swapCid) &&\n // We make sure that both are provided and equal\n !(swapCid && currRecord && currRecord.equals(swapCid))\n ) {\n throw new BadRecordSwapError(currRecord)\n }\n }\n }\n\n const repo = await Repo.load(this.storage, currRoot.cid)\n const prevData = repo.commit.data\n const writeOps = writes.map(writeToOp)\n const commit = await repo.formatCommit(writeOps, this.signingKey)\n\n // find blocks that would be deleted but are referenced by another record\n const dupeRecordCids = await this.getDuplicateRecordCids(\n commit.removedCids.toList(),\n delAndUpdateUris,\n )\n for (const cid of dupeRecordCids) {\n commit.removedCids.delete(cid)\n }\n\n // find blocks that are relevant to ops but not included in diff\n // (for instance a record that was moved but cid stayed the same)\n const newRecordBlocks = commit.relevantBlocks.getMany(newRecordCids)\n if (newRecordBlocks.missing.length > 0) {\n const missingBlocks = await this.storage.getBlocks(\n newRecordBlocks.missing,\n )\n commit.relevantBlocks.addMap(missingBlocks.blocks)\n }\n return {\n ...commit,\n ops: commitOps,\n prevData,\n }\n }\n\n async indexWrites(writes: PreparedWrite[], rev: string) {\n this.db.assertTransaction()\n\n for (const write of writes) {\n if (\n write.action === WriteOpAction.Create ||\n write.action === WriteOpAction.Update\n ) {\n await this.record.indexRecord(\n write.uri,\n write.cid,\n write.record,\n write.action,\n rev,\n this.now,\n )\n } else if (write.action === WriteOpAction.Delete) {\n await this.record.deleteRecord(write.uri)\n }\n }\n }\n\n async getDuplicateRecordCids(\n cids: Cid[],\n touchedUris: AtUri[],\n ): Promise<Cid[]> {\n if (touchedUris.length === 0 || cids.length === 0) {\n return []\n }\n const cidStrs = cids.map((c) => c.toString())\n const uriStrs = touchedUris.map((u) => u.toString())\n const res = await this.db.db\n .selectFrom('record')\n .where('cid', 'in', cidStrs)\n .where('uri', 'not in', uriStrs)\n .select('cid')\n .execute()\n return res.map((row) => parseCid(row.cid))\n }\n}\n"]}
1
+ {"version":3,"file":"transactor.js","sourceRoot":"","sources":["../../../src/actor-store/repo/transactor.ts"],"names":[],"mappings":"AAEA,OAAO,EAAY,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AACtD,OAAO,EAEL,IAAI,EACJ,aAAa,EACb,aAAa,GACd,MAAM,eAAe,CAAA;AAEtB,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AAE1D,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAChE,OAAO,EACL,kBAAkB,EAClB,kBAAkB,GAKnB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAEtD,OAAO,EAAE,gBAAgB,EA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,CAAC;aAC/B,MAAM,CAAC,KAAK,CAAC;aACb,OAAO,EAAE,CAAA;QACZ,OAAO,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAA;IAC5C,CAAC;CACF","sourcesContent":["import type * as crypto from '@atproto/crypto'\nimport type { DidString } from '@atproto/lex'\nimport { type Cid, parseCid } from '@atproto/lex-data'\nimport {\n type BlobStore,\n Repo,\n WriteOpAction,\n formatDataKey,\n} from '@atproto/repo'\nimport type { AtUri } from '@atproto/syntax'\nimport { InvalidRequestError } from '@atproto/xrpc-server'\nimport type { BackgroundQueue } from '../../background.js'\nimport { createWriteToOp, writeToOp } from '../../repo/index.js'\nimport {\n BadCommitSwapError,\n BadRecordSwapError,\n type CommitDataWithOps,\n type CommitOp,\n type PreparedCreate,\n type PreparedWrite,\n} from '../../repo/types.js'\nimport { BlobTransactor } from '../blob/transactor.js'\nimport type { ActorDb } from '../db/index.js'\nimport { RecordTransactor } from '../record/transactor.js'\nimport { RepoReader } from './reader.js'\nimport { SqlRepoTransactor } from './sql-repo-transactor.js'\n\nexport class RepoTransactor extends RepoReader {\n blob: BlobTransactor\n record: RecordTransactor\n storage: SqlRepoTransactor\n\n constructor(\n public db: ActorDb,\n public blobstore: BlobStore,\n public did: DidString,\n public signingKey: crypto.Keypair,\n public backgroundQueue: BackgroundQueue,\n public now: string = new Date().toISOString(),\n ) {\n super(db, blobstore, did)\n this.blob = new BlobTransactor(db, blobstore, backgroundQueue)\n this.record = new RecordTransactor(db, did, blobstore)\n this.storage = new SqlRepoTransactor(db, did, now)\n }\n\n async maybeLoadRepo(): Promise<Repo | null> {\n const res = await this.db.db\n .selectFrom('repo_root')\n .select('cid')\n .limit(1)\n .executeTakeFirst()\n return res ? Repo.load(this.storage, parseCid(res.cid)) : null\n }\n\n async createRepo(writes: PreparedCreate[]): Promise<CommitDataWithOps> {\n this.db.assertTransaction()\n const commit = await Repo.formatInitCommit(\n this.storage,\n this.did,\n this.signingKey,\n writes.map(createWriteToOp),\n )\n await this.storage.applyCommit(commit, true)\n await this.indexWrites(writes, commit.rev)\n await this.blob.processWriteBlobs(commit.rev, writes)\n\n const ops = writes.map((w) => ({\n action: 'create' as const,\n path: formatDataKey(w.uri.collection, w.uri.rkey),\n cid: w.cid,\n }))\n return {\n ...commit,\n ops,\n prevData: null,\n }\n }\n\n async processWrites(\n writes: PreparedWrite[],\n swapCommitCid?: Cid,\n ): Promise<CommitDataWithOps> {\n this.db.assertTransaction()\n if (writes.length > 200) {\n throw new InvalidRequestError('Too many writes. Max: 200')\n }\n\n const commit = await this.formatCommit(writes, swapCommitCid)\n // Do not allow commits > 2MB\n if (commit.relevantBlocks.byteSize > 2000000) {\n throw new InvalidRequestError('Too many writes. Max event size: 2MB')\n }\n\n // persist the commit to repo storage\n await this.storage.applyCommit(commit)\n // & send to indexing\n await this.indexWrites(writes, commit.rev)\n // process blobs\n await this.blob.processWriteBlobs(commit.rev, writes)\n\n return commit\n }\n\n async formatCommit(\n writes: PreparedWrite[],\n swapCommit?: Cid,\n ): Promise<CommitDataWithOps> {\n // this is not in a txn, so this won't actually hold the lock,\n // we just check if it is currently held by another txn\n const currRoot = await this.storage.getRootDetailed()\n if (!currRoot) {\n throw new InvalidRequestError(`No repo root found for ${this.did}`)\n }\n if (swapCommit && !currRoot.cid.equals(swapCommit)) {\n throw new BadCommitSwapError(currRoot.cid)\n }\n // cache last commit since there's likely overlap\n await this.storage.cacheRev(currRoot.rev)\n const newRecordCids: Cid[] = []\n const delAndUpdateUris: AtUri[] = []\n const commitOps: CommitOp[] = []\n for (const write of writes) {\n const { action, uri, swapCid } = write\n if (action !== WriteOpAction.Delete) {\n newRecordCids.push(write.cid)\n }\n if (action !== WriteOpAction.Create) {\n delAndUpdateUris.push(uri)\n }\n const record = await this.record.getRecord(uri, null, true)\n const currRecord = record ? parseCid(record.cid) : null\n\n const op: CommitOp = {\n action,\n path: formatDataKey(uri.collection, uri.rkey),\n cid: write.action === WriteOpAction.Delete ? null : write.cid,\n }\n if (currRecord) {\n op.prev = currRecord\n }\n commitOps.push(op)\n if (swapCid !== undefined) {\n if (action === WriteOpAction.Create && swapCid !== null) {\n throw new BadRecordSwapError(currRecord) // There should be no current record for a create\n }\n if (action === WriteOpAction.Update && swapCid === null) {\n throw new BadRecordSwapError(currRecord) // There should be a current record for an update\n }\n if (action === WriteOpAction.Delete && swapCid === null) {\n throw new BadRecordSwapError(currRecord) // There should be a current record for a delete\n }\n if (\n // If we have either a current CID or a swap CID\n (currRecord || swapCid) &&\n // We make sure that both are provided and equal\n !(swapCid && currRecord && currRecord.equals(swapCid))\n ) {\n throw new BadRecordSwapError(currRecord)\n }\n }\n }\n\n const repo = await Repo.load(this.storage, currRoot.cid)\n const prevData = repo.commit.data\n const writeOps = writes.map(writeToOp)\n const commit = await repo.formatCommit(writeOps, this.signingKey)\n\n // find blocks that would be deleted but are referenced by another record\n const dupeRecordCids = await this.getDuplicateRecordCids(\n commit.removedCids.toList(),\n delAndUpdateUris,\n )\n for (const cid of dupeRecordCids) {\n commit.removedCids.delete(cid)\n }\n\n // find blocks that are relevant to ops but not included in diff\n // (for instance a record that was moved but cid stayed the same)\n const newRecordBlocks = commit.relevantBlocks.getMany(newRecordCids)\n if (newRecordBlocks.missing.length > 0) {\n const missingBlocks = await this.storage.getBlocks(\n newRecordBlocks.missing,\n )\n commit.relevantBlocks.addMap(missingBlocks.blocks)\n }\n return {\n ...commit,\n ops: commitOps,\n prevData,\n }\n }\n\n async indexWrites(writes: PreparedWrite[], rev: string) {\n this.db.assertTransaction()\n\n for (const write of writes) {\n if (\n write.action === WriteOpAction.Create ||\n write.action === WriteOpAction.Update\n ) {\n await this.record.indexRecord(\n write.uri,\n write.cid,\n write.record,\n write.action,\n rev,\n this.now,\n )\n } else if (write.action === WriteOpAction.Delete) {\n await this.record.deleteRecord(write.uri)\n }\n }\n }\n\n async getDuplicateRecordCids(\n cids: Cid[],\n touchedUris: AtUri[],\n ): Promise<Cid[]> {\n if (touchedUris.length === 0 || cids.length === 0) {\n return []\n }\n const cidStrs = cids.map((c) => c.toString())\n const uriStrs = touchedUris.map((u) => u.toString())\n const res = await this.db.db\n .selectFrom('record')\n .where('cid', 'in', cidStrs)\n .where('uri', 'not in', uriStrs)\n .select('cid')\n .execute()\n return res.map((row) => parseCid(row.cid))\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"registerPush.d.ts","sourceRoot":"","sources":["../../../../../src/api/app/bsky/notification/registerPush.ts"],"names":[],"mappings":"AAEA,OAAO,EAAuB,KAAK,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAEvE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAIxD,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QAmDvD"}
1
+ {"version":3,"file":"registerPush.d.ts","sourceRoot":"","sources":["../../../../../src/api/app/bsky/notification/registerPush.ts"],"names":[],"mappings":"AACA,OAAO,EAAuB,KAAK,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAEvE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAIxD,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QAkDvD"}
@@ -1,5 +1,4 @@
1
1
  import { getNotif } from '@atproto/identity';
2
- import { xrpc } from '@atproto/lex';
3
2
  import { InvalidRequestError } from '@atproto/xrpc-server';
4
3
  import { AuthScope } from '../../../../auth-scope.js';
5
4
  import { app } from '../../../../lexicons/index.js';
@@ -33,10 +32,9 @@ export default function (server, ctx) {
33
32
  return;
34
33
  }
35
34
  const notifEndpoint = await getEndpoint(ctx, serviceDid);
36
- await xrpc(notifEndpoint, app.bsky.notification.registerPush, {
37
- validateRequest: ctx.cfg.service.devMode,
38
- validateResponse: ctx.cfg.service.devMode,
39
- strictResponseProcessing: ctx.cfg.service.devMode,
35
+ await ctx
36
+ .safeClient(notifEndpoint)
37
+ .xrpc(app.bsky.notification.registerPush, {
40
38
  body,
41
39
  headers,
42
40
  });
@@ -1 +1 @@
1
- {"version":3,"file":"registerPush.js","sourceRoot":"","sources":["../../../../../src/api/app/bsky/notification/registerPush.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACnC,OAAO,EAAE,mBAAmB,EAAe,MAAM,sBAAsB,CAAA;AACvE,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AAErD,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAA;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAE/C,MAAM,CAAC,OAAO,WAAW,MAAc,EAAE,GAAe;IACtD,MAAM,EAAE,WAAW,EAAE,GAAG,GAAG,CAAA;IAC3B,IAAI,CAAC,WAAW;QAAE,OAAM;IAExB,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,YAAY,EAAE;QAC7C,IAAI,EAAE,GAAG,CAAC,YAAY,CAAC,aAAa,CAAC;YACnC,UAAU,EAAE,CAAC,SAAS,CAAC,YAAY,CAAC;YACpC,SAAS,EAAE,GAAG,EAAE;gBACd,uEAAuE;gBACvE,wEAAwE;gBACxE,mEAAmE;gBACnE,2BAA2B;YAC7B,CAAC;SACF,CAAC;QACF,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE;YAC3C,MAAM,EAAE,UAAU,EAAE,GAAG,IAAI,CAAA;YAC3B,MAAM,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,WAAW,CAAA;YAEhC,IAAI,IAAI,CAAC,WAAW,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;gBACtC,IAAI,CAA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I,mBAAmB,CAC3B,yDAAyD,UAAU,EAAE,CACtE,CAAA;IACH,CAAC;IACD,OAAO,aAAa,CAAA;AACtB,CAAC,CAAA","sourcesContent":["import { getNotif } from '@atproto/identity'\nimport { xrpc } from '@atproto/lex'\nimport { InvalidRequestError, type Server } from '@atproto/xrpc-server'\nimport { AuthScope } from '../../../../auth-scope.js'\nimport type { AppContext } from '../../../../context.js'\nimport { app } from '../../../../lexicons/index.js'\nimport { getDidDoc } from '../util/resolver.js'\n\nexport default function (server: Server, ctx: AppContext) {\n const { bskyAppView } = ctx\n if (!bskyAppView) return\n\n server.add(app.bsky.notification.registerPush, {\n auth: ctx.authVerifier.authorization({\n additional: [AuthScope.SignupQueued],\n authorize: () => {\n // @NOTE this endpoint predates generic service proxying but we want to\n // map the permission to the \"RPC\" scope for consistency. However, since\n // the service info is only available in the request body, we can't\n // assert permissions here.\n },\n }),\n handler: async ({ auth, input: { body } }) => {\n const { serviceDid } = body\n const { did } = auth.credentials\n\n if (auth.credentials.type === 'oauth') {\n auth.credentials.permissions.assertRpc({\n aud: `${serviceDid}#bsky_notif`,\n lxm: app.bsky.notification.registerPush.$lxm,\n })\n }\n\n const { headers } = await ctx.serviceAuthHeaders(\n did,\n serviceDid,\n app.bsky.notification.registerPush.$lxm,\n )\n\n if (bskyAppView.did === serviceDid) {\n await bskyAppView.client.call(\n app.bsky.notification.registerPush,\n body,\n { headers },\n )\n return\n }\n\n const notifEndpoint = await getEndpoint(ctx, serviceDid)\n\n await xrpc(notifEndpoint, app.bsky.notification.registerPush, {\n validateRequest: ctx.cfg.service.devMode,\n validateResponse: ctx.cfg.service.devMode,\n strictResponseProcessing: ctx.cfg.service.devMode,\n body,\n headers,\n })\n },\n })\n}\n\nconst getEndpoint = async (ctx: AppContext, serviceDid: string) => {\n const doc = await getDidDoc(ctx, serviceDid)\n const notifEndpoint = getNotif(doc)\n if (!notifEndpoint) {\n throw new InvalidRequestError(\n `invalid notification service details in did document: ${serviceDid}`,\n )\n }\n return notifEndpoint\n}\n"]}
1
+ {"version":3,"file":"registerPush.js","sourceRoot":"","sources":["../../../../../src/api/app/bsky/notification/registerPush.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EAAE,mBAAmB,EAAe,MAAM,sBAAsB,CAAA;AACvE,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AAErD,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAA;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAE/C,MAAM,CAAC,OAAO,WAAW,MAAc,EAAE,GAAe;IACtD,MAAM,EAAE,WAAW,EAAE,GAAG,GAAG,CAAA;IAC3B,IAAI,CAAC,WAAW;QAAE,OAAM;IAExB,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,YAAY,EAAE;QAC7C,IAAI,EAAE,GAAG,CAAC,YAAY,CAAC,aAAa,CAAC;YACnC,UAAU,EAAE,CAAC,SAAS,CAAC,YAAY,CAAC;YACpC,SAAS,EAAE,GAAG,EAAE;gBACd,uEAAuE;gBACvE,wEAAwE;gBACxE,mEAAmE;gBACnE,2BAA2B;YAC7B,CAAC;SACF,CAAC;QACF,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE;YAC3C,MAAM,EAAE,UAAU,EAAE,GAAG,IAAI,CAAA;YAC3B,MAAM,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,WAAW,CAAA;YAEhC,IAAI,IAAI,CAAC,WAAW,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;gBACtC,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,SAAS,CAAC;oBACrC,GAAG,EAAE,GAAG,UAAU,aAAa;oBAC/B,GAAG,EAAE,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC,IAAI;iBAC7C,CAAC,CAAA;YACJ,CAAC;YAED,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,GAAG,CAAC,kBAAkB,CAC9C,GAAG,EACH,UAAU,EACV,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC,IAAI,CACxC,CAAA;YAED,IAAI,WAAW,CAAC,GAAG,KAAK,UAAU,EAAE,CAAC;gBACnC,MAAM,WAAW,CAAC,MAAM,CAAC,IAAI,CAC3B,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,YAAY,EAClC,IAAI,EACJ,EAAE,OAAO,EAAE,CACZ,CAAA;gBACD,OAAM;YACR,CAAC;YAED,MAAM,aAAa,GAAG,MAAM,WAAW,CAAC,GAAG,EAAE,UAAU,CAAC,CAAA;YAExD,MAAM,GAAG;iBACN,UAAU,CAAC,aAAa,CAAC;iBACzB,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,YAAY,EAAE;gBACxC,IAAI;gBACJ,OAAO;aACR,CAAC,CAAA;QACN,CAAC;KACF,CAAC,CAAA;AACJ,CAAC;AAED,MAAM,WAAW,GAAG,KAAK,EAAE,GAAe,EAAE,UAAkB,EAAE,EAAE;IAChE,MAAM,GAAG,GAAG,MAAM,SAAS,CAAC,GAAG,EAAE,UAAU,CAAC,CAAA;IAC5C,MAAM,aAAa,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAA;IACnC,IAAI,CAAC,aAAa,EAAE,CAAC;QACnB,MAAM,IAAI,mBAAmB,CAC3B,yDAAyD,UAAU,EAAE,CACtE,CAAA;IACH,CAAC;IACD,OAAO,aAAa,CAAA;AACtB,CAAC,CAAA","sourcesContent":["import { getNotif } from '@atproto/identity'\nimport { InvalidRequestError, type Server } from '@atproto/xrpc-server'\nimport { AuthScope } from '../../../../auth-scope.js'\nimport type { AppContext } from '../../../../context.js'\nimport { app } from '../../../../lexicons/index.js'\nimport { getDidDoc } from '../util/resolver.js'\n\nexport default function (server: Server, ctx: AppContext) {\n const { bskyAppView } = ctx\n if (!bskyAppView) return\n\n server.add(app.bsky.notification.registerPush, {\n auth: ctx.authVerifier.authorization({\n additional: [AuthScope.SignupQueued],\n authorize: () => {\n // @NOTE this endpoint predates generic service proxying but we want to\n // map the permission to the \"RPC\" scope for consistency. However, since\n // the service info is only available in the request body, we can't\n // assert permissions here.\n },\n }),\n handler: async ({ auth, input: { body } }) => {\n const { serviceDid } = body\n const { did } = auth.credentials\n\n if (auth.credentials.type === 'oauth') {\n auth.credentials.permissions.assertRpc({\n aud: `${serviceDid}#bsky_notif`,\n lxm: app.bsky.notification.registerPush.$lxm,\n })\n }\n\n const { headers } = await ctx.serviceAuthHeaders(\n did,\n serviceDid,\n app.bsky.notification.registerPush.$lxm,\n )\n\n if (bskyAppView.did === serviceDid) {\n await bskyAppView.client.call(\n app.bsky.notification.registerPush,\n body,\n { headers },\n )\n return\n }\n\n const notifEndpoint = await getEndpoint(ctx, serviceDid)\n\n await ctx\n .safeClient(notifEndpoint)\n .xrpc(app.bsky.notification.registerPush, {\n body,\n headers,\n })\n },\n })\n}\n\nconst getEndpoint = async (ctx: AppContext, serviceDid: string) => {\n const doc = await getDidDoc(ctx, serviceDid)\n const notifEndpoint = getNotif(doc)\n if (!notifEndpoint) {\n throw new InvalidRequestError(\n `invalid notification service details in did document: ${serviceDid}`,\n )\n }\n return notifEndpoint\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"unregisterPush.d.ts","sourceRoot":"","sources":["../../../../../src/api/app/bsky/notification/unregisterPush.ts"],"names":[],"mappings":"AAEA,OAAO,EAAuB,KAAK,MAAM,EAAE,MAAM,sBAAsB,CAAA;AACvE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAIxD,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QA8CvD"}
1
+ {"version":3,"file":"unregisterPush.d.ts","sourceRoot":"","sources":["../../../../../src/api/app/bsky/notification/unregisterPush.ts"],"names":[],"mappings":"AACA,OAAO,EAAuB,KAAK,MAAM,EAAE,MAAM,sBAAsB,CAAA;AACvE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAIxD,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QA6CvD"}
@@ -1,5 +1,4 @@
1
1
  import { getNotif } from '@atproto/identity';
2
- import { xrpc } from '@atproto/lex';
3
2
  import { InvalidRequestError } from '@atproto/xrpc-server';
4
3
  import { app } from '../../../../lexicons/index.js';
5
4
  import { getDidDoc } from '../util/resolver.js';
@@ -27,10 +26,9 @@ export default function (server, ctx) {
27
26
  return;
28
27
  }
29
28
  const notifEndpoint = await getEndpoint(ctx, serviceDid);
30
- await xrpc(notifEndpoint, app.bsky.notification.unregisterPush, {
31
- validateRequest: ctx.cfg.service.devMode,
32
- validateResponse: ctx.cfg.service.devMode,
33
- strictResponseProcessing: ctx.cfg.service.devMode,
29
+ await ctx
30
+ .safeClient(notifEndpoint)
31
+ .xrpc(app.bsky.notification.unregisterPush, {
34
32
  body,
35
33
  headers,
36
34
  });
@@ -1 +1 @@
1
- {"version":3,"file":"unregisterPush.js","sourceRoot":"","sources":["../../../../../src/api/app/bsky/notification/unregisterPush.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACnC,OAAO,EAAE,mBAAmB,EAAe,MAAM,sBAAsB,CAAA;AAEvE,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAA;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAE/C,MAAM,CAAC,OAAO,WAAW,MAAc,EAAE,GAAe;IACtD,MAAM,EAAE,WAAW,EAAE,GAAG,GAAG,CAAA;IAC3B,IAAI,CAAC,WAAW;QAAE,OAAM;IAExB,MAAM,CAAC,G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CAAC,OAAO,CAAC,OAAO;gBACxC,gBAAgB,EAAE,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO;gBACzC,wBAAwB,EAAE,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO;gBACjD,IAAI;gBACJ,OAAO;aACR,CAAC,CAAA;QACJ,CAAC;KACF,CAAC,CAAA;AACJ,CAAC;AAED,MAAM,WAAW,GAAG,KAAK,EAAE,GAAe,EAAE,UAAkB,EAAE,EAAE;IAChE,MAAM,GAAG,GAAG,MAAM,SAAS,CAAC,GAAG,EAAE,UAAU,CAAC,CAAA;IAC5C,MAAM,aAAa,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAA;IACnC,IAAI,CAAC,aAAa,EAAE,CAAC;QACnB,MAAM,IAAI,mBAAmB,CAC3B,yDAAyD,UAAU,EAAE,CACtE,CAAA;IACH,CAAC;IACD,OAAO,aAAa,CAAA;AACtB,CAAC,CAAA","sourcesContent":["import { getNotif } from '@atproto/identity'\nimport { xrpc } from '@atproto/lex'\nimport { InvalidRequestError, type Server } from '@atproto/xrpc-server'\nimport type { AppContext } from '../../../../context.js'\nimport { app } from '../../../../lexicons/index.js'\nimport { getDidDoc } from '../util/resolver.js'\n\nexport default function (server: Server, ctx: AppContext) {\n const { bskyAppView } = ctx\n if (!bskyAppView) return\n\n server.add(app.bsky.notification.unregisterPush, {\n auth: ctx.authVerifier.authorization({\n additional: [],\n authorize: () => {},\n }),\n handler: async ({ auth, input: { body } }) => {\n const { serviceDid } = body\n const { did } = auth.credentials\n\n if (auth.credentials.type === 'oauth') {\n auth.credentials.permissions.assertRpc({\n aud: `${serviceDid}#bsky_notif`,\n lxm: app.bsky.notification.unregisterPush.$lxm,\n })\n }\n\n const { headers } = await ctx.serviceAuthHeaders(\n did,\n serviceDid,\n app.bsky.notification.unregisterPush.$lxm,\n )\n\n if (bskyAppView.did === serviceDid) {\n await bskyAppView.client.call(\n app.bsky.notification.unregisterPush,\n body,\n { headers },\n )\n return\n }\n\n const notifEndpoint = await getEndpoint(ctx, serviceDid)\n\n await xrpc(notifEndpoint, app.bsky.notification.unregisterPush, {\n validateRequest: ctx.cfg.service.devMode,\n validateResponse: ctx.cfg.service.devMode,\n strictResponseProcessing: ctx.cfg.service.devMode,\n body,\n headers,\n })\n },\n })\n}\n\nconst getEndpoint = async (ctx: AppContext, serviceDid: string) => {\n const doc = await getDidDoc(ctx, serviceDid)\n const notifEndpoint = getNotif(doc)\n if (!notifEndpoint) {\n throw new InvalidRequestError(\n `invalid notification service details in did document: ${serviceDid}`,\n )\n }\n return notifEndpoint\n}\n"]}
1
+ {"version":3,"file":"unregisterPush.js","sourceRoot":"","sources":["../../../../../src/api/app/bsky/notification/unregisterPush.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EAAE,mBAAmB,EAAe,MAAM,sBAAsB,CAAA;AAEvE,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAA;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAE/C,MAAM,CAAC,OAAO,WAAW,MAAc,EAAE,GAAe;IACtD,MAAM,EAAE,WAAW,EAAE,GAAG,GAAG,CAAA;IAC3B,IAAI,CAAC,WAAW;QAAE,OAAM;IAExB,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,cAAc,EAAE;QAC/C,IAAI,EAAE,GAAG,CAAC,YAAY,CAAC,aAAa,CAAC;YACnC,UAAU,EAAE,EAAE;YACd,SAAS,EAAE,GAAG,EAAE,GAAE,CAAC;SACpB,CAAC;QACF,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE;YAC3C,MAAM,EAAE,UAAU,EAAE,GAAG,IAAI,CAAA;YAC3B,MAAM,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,WAAW,CAAA;YAEhC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AAA;AACtB,CAAC,CAAA","sourcesContent":["import { getNotif } from '@atproto/identity'\nimport { InvalidRequestError, type Server } from '@atproto/xrpc-server'\nimport type { AppContext } from '../../../../context.js'\nimport { app } from '../../../../lexicons/index.js'\nimport { getDidDoc } from '../util/resolver.js'\n\nexport default function (server: Server, ctx: AppContext) {\n const { bskyAppView } = ctx\n if (!bskyAppView) return\n\n server.add(app.bsky.notification.unregisterPush, {\n auth: ctx.authVerifier.authorization({\n additional: [],\n authorize: () => {},\n }),\n handler: async ({ auth, input: { body } }) => {\n const { serviceDid } = body\n const { did } = auth.credentials\n\n if (auth.credentials.type === 'oauth') {\n auth.credentials.permissions.assertRpc({\n aud: `${serviceDid}#bsky_notif`,\n lxm: app.bsky.notification.unregisterPush.$lxm,\n })\n }\n\n const { headers } = await ctx.serviceAuthHeaders(\n did,\n serviceDid,\n app.bsky.notification.unregisterPush.$lxm,\n )\n\n if (bskyAppView.did === serviceDid) {\n await bskyAppView.client.call(\n app.bsky.notification.unregisterPush,\n body,\n { headers },\n )\n return\n }\n\n const notifEndpoint = await getEndpoint(ctx, serviceDid)\n\n await ctx\n .safeClient(notifEndpoint)\n .xrpc(app.bsky.notification.unregisterPush, {\n body,\n headers,\n })\n },\n })\n}\n\nconst getEndpoint = async (ctx: AppContext, serviceDid: string) => {\n const doc = await getDidDoc(ctx, serviceDid)\n const notifEndpoint = getNotif(doc)\n if (!notifEndpoint) {\n throw new InvalidRequestError(\n `invalid notification service details in did document: ${serviceDid}`,\n )\n }\n return notifEndpoint\n}\n"]}
@@ -26,7 +26,7 @@ export default function (server, ctx) {
26
26
  }
27
27
  else if (uri) {
28
28
  const parsedUri = new AtUri(uri);
29
- const [takedown, cid] = await ctx.actorStore.read(parsedUri.hostname, (store) => Promise.all([
29
+ const [takedown, cid] = await ctx.actorStore.read(parsedUri.did, (store) => Promise.all([
30
30
  store.record.getRecordTakedownStatus(parsedUri),
31
31
  store.record.getCurrentRecordCid(parsedUri),
32
32
  ]));
@@ -1 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A;QACH,CAAC;KACF,CAAC,CAAA;AACJ,CAAC","sourcesContent":["import { parseCid } from '@atproto/lex-data'\nimport { AtUri } from '@atproto/syntax'\nimport { InvalidRequestError, type Server } from '@atproto/xrpc-server'\nimport type { AppContext } from '../../../../context.js'\nimport { com } from '../../../../lexicons/index.js'\n\nexport default function (server: Server, ctx: AppContext) {\n server.add(com.atproto.admin.getSubjectStatus, {\n auth: ctx.authVerifier.moderator,\n handler: async ({ params }) => {\n const { did, uri, blob } = params\n let body: com.atproto.admin.getSubjectStatus.$OutputBody | null = null\n if (blob) {\n if (!did) {\n throw new InvalidRequestError(\n 'Must provide a did to request blob state',\n )\n }\n const takedown = await ctx.actorStore.read(did, (store) =>\n store.repo.blob.getBlobTakedownStatus(parseCid(blob)),\n )\n if (takedown) {\n body = {\n subject: {\n $type: 'com.atproto.admin.defs#repoBlobRef',\n did: did,\n cid: blob,\n },\n takedown,\n }\n }\n } else if (uri) {\n const parsedUri = new AtUri(uri)\n const [takedown, cid] = await ctx.actorStore.read(\n parsedUri.hostname,\n (store) =>\n Promise.all([\n store.record.getRecordTakedownStatus(parsedUri),\n store.record.getCurrentRecordCid(parsedUri),\n ]),\n )\n if (cid && takedown) {\n body = {\n subject: {\n $type: 'com.atproto.repo.strongRef',\n uri: parsedUri.toString(),\n cid: cid.toString(),\n },\n takedown,\n }\n }\n } else if (did) {\n const status = await ctx.accountManager.getAccountAdminStatus(did)\n if (status) {\n body = {\n subject: {\n $type: 'com.atproto.admin.defs#repoRef',\n did: did,\n },\n takedown: status.takedown,\n deactivated: status.deactivated,\n }\n }\n } else {\n throw new InvalidRequestError('No provided subject')\n }\n if (body === null) {\n throw new InvalidRequestError('Subject not found', 'NotFound')\n }\n return {\n encoding: 'application/json' as const,\n body,\n }\n },\n })\n}\n"]}
1
+ {"version":3,"file":"getSubjectStatus.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/admin/getSubjectStatus.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,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U,CAAC,IAAI,CAC/C,SAAS,CAAC,GAAG,EACb,CAAC,KAAK,EAAE,EAAE,CACR,OAAO,CAAC,GAAG,CAAC;oBACV,KAAK,CAAC,MAAM,CAAC,uBAAuB,CAAC,SAAS,CAAC;oBAC/C,KAAK,CAAC,MAAM,CAAC,mBAAmB,CAAC,SAAS,CAAC;iBAC5C,CAAC,CACL,CAAA;gBACD,IAAI,GAAG,IAAI,QAAQ,EAAE,CAAC;oBACpB,IAAI,GAAG;wBACL,OAAO,EAAE;4BACP,KAAK,EAAE,4BAA4B;4BACnC,GAAG,EAAE,SAAS,CAAC,QAAQ,EAAE;4BACzB,GAAG,EAAE,GAAG,CAAC,QAAQ,EAAE;yBACpB;wBACD,QAAQ;qBACT,CAAA;gBACH,CAAC;YACH,CAAC;iBAAM,IAAI,GAAG,EAAE,CAAC;gBACf,MAAM,MAAM,GAAG,MAAM,GAAG,CAAC,cAAc,CAAC,qBAAqB,CAAC,GAAG,CAAC,CAAA;gBAClE,IAAI,MAAM,EAAE,CAAC;oBACX,IAAI,GAAG;wBACL,OAAO,EAAE;4BACP,KAAK,EAAE,gCAAgC;4BACvC,GAAG,EAAE,GAAG;yBACT;wBACD,QAAQ,EAAE,MAAM,CAAC,QAAQ;wBACzB,WAAW,EAAE,MAAM,CAAC,WAAW;qBAChC,CAAA;gBACH,CAAC;YACH,CAAC;iBAAM,CAAC;gBACN,MAAM,IAAI,mBAAmB,CAAC,qBAAqB,CAAC,CAAA;YACtD,CAAC;YACD,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;gBAClB,MAAM,IAAI,mBAAmB,CAAC,mBAAmB,EAAE,UAAU,CAAC,CAAA;YAChE,CAAC;YACD,OAAO;gBACL,QAAQ,EAAE,kBAA2B;gBACrC,IAAI;aACL,CAAA;QACH,CAAC;KACF,CAAC,CAAA;AACJ,CAAC","sourcesContent":["import { parseCid } from '@atproto/lex-data'\nimport { AtUri } from '@atproto/syntax'\nimport { InvalidRequestError, type Server } from '@atproto/xrpc-server'\nimport type { AppContext } from '../../../../context.js'\nimport { com } from '../../../../lexicons/index.js'\n\nexport default function (server: Server, ctx: AppContext) {\n server.add(com.atproto.admin.getSubjectStatus, {\n auth: ctx.authVerifier.moderator,\n handler: async ({ params }) => {\n const { did, uri, blob } = params\n let body: com.atproto.admin.getSubjectStatus.$OutputBody | null = null\n if (blob) {\n if (!did) {\n throw new InvalidRequestError(\n 'Must provide a did to request blob state',\n )\n }\n const takedown = await ctx.actorStore.read(did, (store) =>\n store.repo.blob.getBlobTakedownStatus(parseCid(blob)),\n )\n if (takedown) {\n body = {\n subject: {\n $type: 'com.atproto.admin.defs#repoBlobRef',\n did: did,\n cid: blob,\n },\n takedown,\n }\n }\n } else if (uri) {\n const parsedUri = new AtUri(uri)\n const [takedown, cid] = await ctx.actorStore.read(\n parsedUri.did,\n (store) =>\n Promise.all([\n store.record.getRecordTakedownStatus(parsedUri),\n store.record.getCurrentRecordCid(parsedUri),\n ]),\n )\n if (cid && takedown) {\n body = {\n subject: {\n $type: 'com.atproto.repo.strongRef',\n uri: parsedUri.toString(),\n cid: cid.toString(),\n },\n takedown,\n }\n }\n } else if (did) {\n const status = await ctx.accountManager.getAccountAdminStatus(did)\n if (status) {\n body = {\n subject: {\n $type: 'com.atproto.admin.defs#repoRef',\n did: did,\n },\n takedown: status.takedown,\n deactivated: status.deactivated,\n }\n }\n } else {\n throw new InvalidRequestError('No provided subject')\n }\n if (body === null) {\n throw new InvalidRequestError('Subject not found', 'NotFound')\n }\n return {\n encoding: 'application/json' as const,\n body,\n }\n },\n })\n}\n"]}
@@ -16,7 +16,7 @@ export default function (server, ctx) {
16
16
  }
17
17
  else if (com.atproto.repo.strongRef.$isTypeOf(subject)) {
18
18
  const uri = new AtUri(subject.uri);
19
- await ctx.actorStore.transact(uri.hostname, async (store) => {
19
+ await ctx.actorStore.transact(uri.did, async (store) => {
20
20
  await store.record.updateRecordTakedownStatus(uri, takedown);
21
21
  });
22
22
  }
@@ -1 +1 @@
1
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AAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC;oBACtD,MAAM,GAAG,CAAC,cAAc,CAAC,qBAAqB,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;gBAC7D,CAAC;YACH,CAAC;YAED,OAAO;gBACL,QAAQ,EAAE,kBAA2B;gBACrC,IAAI,EAAE;oBACJ,OAAO;oBACP,QAAQ;iBACT;aACF,CAAA;QACH,CAAC;KACF,CAAC,CAAA;AACJ,CAAC","sourcesContent":["import { parseCid } from '@atproto/lex-data'\nimport { AtUri } from '@atproto/syntax'\nimport { InvalidRequestError, type Server } from '@atproto/xrpc-server'\nimport type { AppContext } from '../../../../context.js'\nimport { com } from '../../../../lexicons/index.js'\n\nexport default function (server: Server, ctx: AppContext) {\n server.add(com.atproto.admin.updateSubjectStatus, {\n auth: ctx.authVerifier.moderator,\n handler: async ({ input }) => {\n const { subject, takedown, deactivated } = input.body\n\n if (takedown?.applied && deactivated != null && !deactivated.applied) {\n throw new InvalidRequestError(\n `Cannot activate and takedown an account at the same time`,\n )\n }\n\n if (takedown) {\n if (com.atproto.admin.defs.repoRef.$isTypeOf(subject)) {\n await ctx.accountManager.takedownAccount(subject.did, takedown)\n } else if (com.atproto.repo.strongRef.$isTypeOf(subject)) {\n const uri = new AtUri(subject.uri)\n await ctx.actorStore.transact(uri.hostname, async (store) => {\n await store.record.updateRecordTakedownStatus(uri, takedown)\n })\n } else if (com.atproto.admin.defs.repoBlobRef.$isTypeOf(subject)) {\n await ctx.actorStore.transact(subject.did, async (store) => {\n await store.repo.blob.updateBlobTakedownStatus(\n parseCid(subject.cid),\n takedown,\n )\n })\n } else {\n throw new InvalidRequestError(`Invalid subject (${subject.$type})`)\n }\n }\n\n if (deactivated) {\n if (com.atproto.admin.defs.repoRef.$isTypeOf(subject)) {\n if (deactivated.applied) {\n await ctx.accountManager.deactivateAccount(subject.did)\n } else {\n await ctx.accountManager.activateAccount(subject.did)\n }\n }\n }\n\n // @NOTE accountManager will sequence an account status when updating the\n // status, so we don't *need* to sequence the account status here.\n // However, this endpoint historically has always sequenced the account\n // status.\n if (!takedown && !deactivated) {\n if (com.atproto.admin.defs.repoRef.$isTypeOf(subject)) {\n await ctx.accountManager.sequenceAccountStatus(subject.did)\n }\n }\n\n return {\n encoding: 'application/json' as const,\n body: {\n subject,\n takedown,\n },\n }\n },\n })\n}\n"]}
1
+ {"version":3,"file":"updateSubjectStatus.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/admin/updateSubjectStatus.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AACvC,OAAO,EAAE,mBAAmB,EAAe,MAAM,sBAAsB,CAAA;AAEvE,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAA;AAEnD,MAAM,CAAC,OAAO,WAAW,MAAc,EAAE,GAAe;IACtD,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,mBAAmB,EAAE;QAChD,IAAI,EAAE,GAAG,CAAC,YAAY,CAAC,SAAS;QAChC,OAAO,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE;YAC3B,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,GAAG,KAAK,CAAC,IAAI,CAAA;YAErD,IAAI,QAAQ,EAAE,OAAO,IAAI,WAAW,IAAI,IAAI,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,CAAC;gBACrE,MAAM,IAAI,mBAAmB,CAC3B,0DAA0D,CAC3D,CAAA;YACH,CAAC;YAED,IAAI,QAAQ,EAAE,CAAC;gBACb,IAAI,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC;oBACtD,MAAM,GAAG,CAAC,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A;oBACzD,CAAC;yBAAM,CAAC;wBACN,MAAM,GAAG,CAAC,cAAc,CAAC,eAAe,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;oBACvD,CAAC;gBACH,CAAC;YACH,CAAC;YAED,yEAAyE;YACzE,kEAAkE;YAClE,uEAAuE;YACvE,UAAU;YACV,IAAI,CAAC,QAAQ,IAAI,CAAC,WAAW,EAAE,CAAC;gBAC9B,IAAI,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC;oBACtD,MAAM,GAAG,CAAC,cAAc,CAAC,qBAAqB,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;gBAC7D,CAAC;YACH,CAAC;YAED,OAAO;gBACL,QAAQ,EAAE,kBAA2B;gBACrC,IAAI,EAAE;oBACJ,OAAO;oBACP,QAAQ;iBACT;aACF,CAAA;QACH,CAAC;KACF,CAAC,CAAA;AACJ,CAAC","sourcesContent":["import { parseCid } from '@atproto/lex-data'\nimport { AtUri } from '@atproto/syntax'\nimport { InvalidRequestError, type Server } from '@atproto/xrpc-server'\nimport type { AppContext } from '../../../../context.js'\nimport { com } from '../../../../lexicons/index.js'\n\nexport default function (server: Server, ctx: AppContext) {\n server.add(com.atproto.admin.updateSubjectStatus, {\n auth: ctx.authVerifier.moderator,\n handler: async ({ input }) => {\n const { subject, takedown, deactivated } = input.body\n\n if (takedown?.applied && deactivated != null && !deactivated.applied) {\n throw new InvalidRequestError(\n `Cannot activate and takedown an account at the same time`,\n )\n }\n\n if (takedown) {\n if (com.atproto.admin.defs.repoRef.$isTypeOf(subject)) {\n await ctx.accountManager.takedownAccount(subject.did, takedown)\n } else if (com.atproto.repo.strongRef.$isTypeOf(subject)) {\n const uri = new AtUri(subject.uri)\n await ctx.actorStore.transact(uri.did, async (store) => {\n await store.record.updateRecordTakedownStatus(uri, takedown)\n })\n } else if (com.atproto.admin.defs.repoBlobRef.$isTypeOf(subject)) {\n await ctx.actorStore.transact(subject.did, async (store) => {\n await store.repo.blob.updateBlobTakedownStatus(\n parseCid(subject.cid),\n takedown,\n )\n })\n } else {\n throw new InvalidRequestError(`Invalid subject (${subject.$type})`)\n }\n }\n\n if (deactivated) {\n if (com.atproto.admin.defs.repoRef.$isTypeOf(subject)) {\n if (deactivated.applied) {\n await ctx.accountManager.deactivateAccount(subject.did)\n } else {\n await ctx.accountManager.activateAccount(subject.did)\n }\n }\n }\n\n // @NOTE accountManager will sequence an account status when updating the\n // status, so we don't *need* to sequence the account status here.\n // However, this endpoint historically has always sequenced the account\n // status.\n if (!takedown && !deactivated) {\n if (com.atproto.admin.defs.repoRef.$isTypeOf(subject)) {\n await ctx.accountManager.sequenceAccountStatus(subject.did)\n }\n }\n\n return {\n encoding: 'application/json' as const,\n body: {\n subject,\n takedown,\n },\n }\n },\n })\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"createReport.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/moderation/createReport.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAElD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAIxD,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QAiCvD"}
1
+ {"version":3,"file":"createReport.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/moderation/createReport.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAElD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAIxD,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QA8BvD"}
@@ -1,4 +1,3 @@
1
- import { xrpc } from '@atproto/lex';
2
1
  import { AuthScope } from '../../../../auth-scope.js';
3
2
  import { com } from '../../../../lexicons/index.js';
4
3
  import { computeProxyTo, parseProxyInfo } from '../../../../pipethrough.js';
@@ -15,10 +14,7 @@ export default function (server, ctx) {
15
14
  handler: async ({ auth, params, input: { body }, req }) => {
16
15
  const { url, did: aud } = await parseProxyInfo(ctx, req, com.atproto.moderation.createReport.$lxm);
17
16
  const { headers } = await ctx.serviceAuthHeaders(auth.credentials.did, aud, com.atproto.moderation.createReport.$lxm);
18
- return xrpc(url, com.atproto.moderation.createReport, {
19
- validateRequest: ctx.cfg.service.devMode,
20
- validateResponse: ctx.cfg.service.devMode,
21
- strictResponseProcessing: ctx.cfg.service.devMode,
17
+ return ctx.safeClient(url).xrpc(com.atproto.moderation.createReport, {
22
18
  headers,
23
19
  params,
24
20
  body,
@@ -1 +1 @@
1
- {"version":3,"file":"createReport.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/moderation/createReport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAEnC,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AAErD,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAA;AACnD,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAE3E,MAAM,CAAC,OAAO,WAAW,MAAc,EAAE,GAAe;IACtD,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC,YAAY,EAAE;QAC9C,IAAI,EAAE,GAAG,CAAC,YAAY,CAAC,aAAa,CAAC;YACnC,UAAU,EAAE,CAAC,SAAS,CAAC,SAAS,CAAC;YACjC,SAAS,EAAE,CAAC,WAAW,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE;gBAClC,MAAM,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,IAAI,CAAA;gBACpD,MAAM,GAAG,GAAG,cAAc,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA;gBACzC,WAAW,CAAC,SAAS,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAA;YACrC,CAAC;SACF,CAAC;QACF,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE;YACxD,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,MAAM,cAAc,CAC5C,GAAG,EACH,GAAG,EACH,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,IAAI,CACzC,CAAA;YAED,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,GAAG,CAAC,kBAAkB,CAC9C,IAAI,CAAC,WAAW,CAAC,GAAG,EACpB,GAAG,EACH,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,IAAI,CACzC,CAAA;YAED,OAAO,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC,YAAY,EAAE;gBACpD,eAAe,EAAE,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO;gBACxC,gBAAgB,EAAE,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO;gBACzC,wBAAwB,EAAE,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO;gBACjD,OAAO;gBACP,MAAM;gBACN,IAAI;aACL,CAAC,CAAA;QACJ,CAAC;KACF,CAAC,CAAA;AACJ,CAAC","sourcesContent":["import { xrpc } from '@atproto/lex'\nimport type { Server } from '@atproto/xrpc-server'\nimport { AuthScope } from '../../../../auth-scope.js'\nimport type { AppContext } from '../../../../context.js'\nimport { com } from '../../../../lexicons/index.js'\nimport { computeProxyTo, parseProxyInfo } from '../../../../pipethrough.js'\n\nexport default function (server: Server, ctx: AppContext) {\n server.add(com.atproto.moderation.createReport, {\n auth: ctx.authVerifier.authorization({\n additional: [AuthScope.Takendown],\n authorize: (permissions, { req }) => {\n const lxm = com.atproto.moderation.createReport.$lxm\n const aud = computeProxyTo(ctx, req, lxm)\n permissions.assertRpc({ aud, lxm })\n },\n }),\n handler: async ({ auth, params, input: { body }, req }) => {\n const { url, did: aud } = await parseProxyInfo(\n ctx,\n req,\n com.atproto.moderation.createReport.$lxm,\n )\n\n const { headers } = await ctx.serviceAuthHeaders(\n auth.credentials.did,\n aud,\n com.atproto.moderation.createReport.$lxm,\n )\n\n return xrpc(url, com.atproto.moderation.createReport, {\n validateRequest: ctx.cfg.service.devMode,\n validateResponse: ctx.cfg.service.devMode,\n strictResponseProcessing: ctx.cfg.service.devMode,\n headers,\n params,\n body,\n })\n },\n })\n}\n"]}
1
+ {"version":3,"file":"createReport.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/moderation/createReport.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AAErD,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAA;AACnD,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAE3E,MAAM,CAAC,OAAO,WAAW,MAAc,EAAE,GAAe;IACtD,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC,YAAY,EAAE;QAC9C,IAAI,EAAE,GAAG,CAAC,YAAY,CAAC,aAAa,CAAC;YACnC,UAAU,EAAE,CAAC,SAAS,CAAC,SAAS,CAAC;YACjC,SAAS,EAAE,CAAC,WAAW,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE;gBAClC,MAAM,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,IAAI,CAAA;gBACpD,MAAM,GAAG,GAAG,cAAc,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA;gBACzC,WAAW,CAAC,SAAS,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAA;YACrC,CAAC;SACF,CAAC;QACF,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE;YACxD,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,MAAM,cAAc,CAC5C,GAAG,EACH,GAAG,EACH,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,IAAI,CACzC,CAAA;YAED,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,GAAG,CAAC,kBAAkB,CAC9C,IAAI,CAAC,WAAW,CAAC,GAAG,EACpB,GAAG,EACH,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,IAAI,CACzC,CAAA;YAED,OAAO,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC,YAAY,EAAE;gBACnE,OAAO;gBACP,MAAM;gBACN,IAAI;aACL,CAAC,CAAA;QACJ,CAAC;KACF,CAAC,CAAA;AACJ,CAAC","sourcesContent":["import type { Server } from '@atproto/xrpc-server'\nimport { AuthScope } from '../../../../auth-scope.js'\nimport type { AppContext } from '../../../../context.js'\nimport { com } from '../../../../lexicons/index.js'\nimport { computeProxyTo, parseProxyInfo } from '../../../../pipethrough.js'\n\nexport default function (server: Server, ctx: AppContext) {\n server.add(com.atproto.moderation.createReport, {\n auth: ctx.authVerifier.authorization({\n additional: [AuthScope.Takendown],\n authorize: (permissions, { req }) => {\n const lxm = com.atproto.moderation.createReport.$lxm\n const aud = computeProxyTo(ctx, req, lxm)\n permissions.assertRpc({ aud, lxm })\n },\n }),\n handler: async ({ auth, params, input: { body }, req }) => {\n const { url, did: aud } = await parseProxyInfo(\n ctx,\n req,\n com.atproto.moderation.createReport.$lxm,\n )\n\n const { headers } = await ctx.serviceAuthHeaders(\n auth.credentials.did,\n aud,\n com.atproto.moderation.createReport.$lxm,\n )\n\n return ctx.safeClient(url).xrpc(com.atproto.moderation.createReport, {\n headers,\n params,\n body,\n })\n },\n })\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"activateAccount.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/server/activateAccount.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAElE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAGxD,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QA+BvD"}
1
+ {"version":3,"file":"activateAccount.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/server/activateAccount.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAElE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAGxD,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QAiCvD"}
@@ -5,8 +5,10 @@ export default function (server, ctx) {
5
5
  const { entrywayClient } = ctx;
6
6
  const auth = ctx.authVerifier.authorization({
7
7
  scopes: ACCESS_FULL,
8
+ // OAuth authorization flows are refused for deactivated accounts, so a
9
+ // client cannot obtain fresh credentials to reactivate an account with.
8
10
  authorize: () => {
9
- throw new ForbiddenError('OAuth credentials are not supported for this endpoint');
11
+ throw new ForbiddenError('Account reactivation is not available with OAuth credentials. Sign in to your account management page to reactivate.');
10
12
  },
11
13
  });
12
14
  if (entrywayClient) {
@@ -1 +1 @@
1
- {"version":3,"file":"activateAccount.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/server/activateAccount.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAe,MAAM,sBAAsB,CAAA;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAA;AAEvD,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAA;AAEnD,MAAM,CAAC,OAAO,WAAW,MAAc,EAAE,GAAe;IACtD,MAAM,EAAE,cAAc,EAAE,GAAG,GAAG,CAAA;IAE9B,MAAM,IAAI,GAAG,GAAG,CAAC,YAAY,CAAC,aAAa,CAAC;QAC1C,MAAM,EAAE,WAAW;QACnB,SAAS,EAAE,GAAG,EAAE;YACd,MAAM,IAAI,cAAc,CACtB,uDAAuD,CACxD,CAAA;QACH,CAAC;KACF,CAAC,CAAA;IAEF,IAAI,cAAc,EAAE,CAAC;QACnB,4HAA4H;QAC5H,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,eAAe,EAAE;YAC7C,IAAI;YACJ,OAAO,EAAE,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE;gBACzB,MAAM,EAAE,OAAO,EAAE,GAAG,GAAG,CAAC,uBAAuB,CAAC,GAAG,CAAC,CAAA;gBACpD,MAAM,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,eAAe,EAAE;oBAC5D,OAAO;iBACR,CAAC,CAAA;YACJ,CAAC;SACF,CAAC,CAAA;IACJ,CAAC;SAAM,CAAC;QACN,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,eAAe,EAAE;YAC7C,IAAI;YACJ,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;gBAC1B,MAAM,GAAG,CAAC,cAAc,CAAC,eAAe,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAA;YAChE,CAAC;SACF,CAAC,CAAA;IACJ,CAAC;AACH,CAAC","sourcesContent":["import { ForbiddenError, type Server } from '@atproto/xrpc-server'\nimport { ACCESS_FULL } from '../../../../auth-scope.js'\nimport type { AppContext } from '../../../../context.js'\nimport { com } from '../../../../lexicons/index.js'\n\nexport default function (server: Server, ctx: AppContext) {\n const { entrywayClient } = ctx\n\n const auth = ctx.authVerifier.authorization({\n scopes: ACCESS_FULL,\n authorize: () => {\n throw new ForbiddenError(\n 'OAuth credentials are not supported for this endpoint',\n )\n },\n })\n\n if (entrywayClient) {\n // in the case of entryway, the full flow is activateAccount (PDS) -> activateAccount (Entryway) -> updateSubjectStatus(PDS)\n server.add(com.atproto.server.activateAccount, {\n auth,\n handler: async ({ req }) => {\n const { headers } = ctx.entrywayPassthruHeaders(req)\n await entrywayClient.xrpc(com.atproto.server.activateAccount, {\n headers,\n })\n },\n })\n } else {\n server.add(com.atproto.server.activateAccount, {\n auth,\n handler: async ({ auth }) => {\n await ctx.accountManager.activateAccount(auth.credentials.did)\n },\n })\n }\n}\n"]}
1
+ {"version":3,"file":"activateAccount.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/server/activateAccount.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAe,MAAM,sBAAsB,CAAA;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAA;AAEvD,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAA;AAEnD,MAAM,CAAC,OAAO,WAAW,MAAc,EAAE,GAAe;IACtD,MAAM,EAAE,cAAc,EAAE,GAAG,GAAG,CAAA;IAE9B,MAAM,IAAI,GAAG,GAAG,CAAC,YAAY,CAAC,aAAa,CAAC;QAC1C,MAAM,EAAE,WAAW;QACnB,uEAAuE;QACvE,wEAAwE;QACxE,SAAS,EAAE,GAAG,EAAE;YACd,MAAM,IAAI,cAAc,CACtB,sHAAsH,CACvH,CAAA;QACH,CAAC;KACF,CAAC,CAAA;IAEF,IAAI,cAAc,EAAE,CAAC;QACnB,4HAA4H;QAC5H,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,eAAe,EAAE;YAC7C,IAAI;YACJ,OAAO,EAAE,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE;gBACzB,MAAM,EAAE,OAAO,EAAE,GAAG,GAAG,CAAC,uBAAuB,CAAC,GAAG,CAAC,CAAA;gBACpD,MAAM,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,eAAe,EAAE;oBAC5D,OAAO;iBACR,CAAC,CAAA;YACJ,CAAC;SACF,CAAC,CAAA;IACJ,CAAC;SAAM,CAAC;QACN,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,eAAe,EAAE;YAC7C,IAAI;YACJ,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;gBAC1B,MAAM,GAAG,CAAC,cAAc,CAAC,eAAe,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAA;YAChE,CAAC;SACF,CAAC,CAAA;IACJ,CAAC;AACH,CAAC","sourcesContent":["import { ForbiddenError, type Server } from '@atproto/xrpc-server'\nimport { ACCESS_FULL } from '../../../../auth-scope.js'\nimport type { AppContext } from '../../../../context.js'\nimport { com } from '../../../../lexicons/index.js'\n\nexport default function (server: Server, ctx: AppContext) {\n const { entrywayClient } = ctx\n\n const auth = ctx.authVerifier.authorization({\n scopes: ACCESS_FULL,\n // OAuth authorization flows are refused for deactivated accounts, so a\n // client cannot obtain fresh credentials to reactivate an account with.\n authorize: () => {\n throw new ForbiddenError(\n 'Account reactivation is not available with OAuth credentials. Sign in to your account management page to reactivate.',\n )\n },\n })\n\n if (entrywayClient) {\n // in the case of entryway, the full flow is activateAccount (PDS) -> activateAccount (Entryway) -> updateSubjectStatus(PDS)\n server.add(com.atproto.server.activateAccount, {\n auth,\n handler: async ({ req }) => {\n const { headers } = ctx.entrywayPassthruHeaders(req)\n await entrywayClient.xrpc(com.atproto.server.activateAccount, {\n headers,\n })\n },\n })\n } else {\n server.add(com.atproto.server.activateAccount, {\n auth,\n handler: async ({ auth }) => {\n await ctx.accountManager.activateAccount(auth.credentials.did)\n },\n })\n }\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { type Server } from '@atproto/xrpc-server';
1
+ import type { Server } from '@atproto/xrpc-server';
2
2
  import type { AppContext } from '../../../../context.js';
3
3
  export default function (server: Server, ctx: AppContext): void;
4
4
  //# sourceMappingURL=deactivateAccount.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"deactivateAccount.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/server/deactivateAccount.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAElE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAGxD,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QAmCvD"}
1
+ {"version":3,"file":"deactivateAccount.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/server/deactivateAccount.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAElD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAGxD,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QA6CvD"}
@@ -1,4 +1,3 @@
1
- import { ForbiddenError } from '@atproto/xrpc-server';
2
1
  import { ACCESS_FULL, AuthScope } from '../../../../auth-scope.js';
3
2
  import { com } from '../../../../lexicons/index.js';
4
3
  export default function (server, ctx) {
@@ -6,16 +5,18 @@ export default function (server, ctx) {
6
5
  const auth = ctx.authVerifier.authorization({
7
6
  additional: [AuthScope.Takendown],
8
7
  scopes: ACCESS_FULL,
9
- authorize: () => {
10
- throw new ForbiddenError('OAuth credentials are not supported for this endpoint');
8
+ authorize: (permissions) => {
9
+ permissions.assertAccount({ attr: 'status', action: 'manage' });
11
10
  },
12
11
  });
13
12
  if (entrywayClient) {
14
13
  server.add(com.atproto.server.deactivateAccount, {
15
14
  auth,
16
15
  // in the case of entryway, the full flow is deactivateAccount (PDS) -> deactivateAccount (Entryway) -> updateSubjectStatus(PDS)
17
- handler: async ({ input: { body }, req }) => {
18
- const { headers } = ctx.entrywayPassthruHeaders(req);
16
+ handler: async ({ input: { body }, auth, req }) => {
17
+ // DPoP bound credentials cannot be forwarded as-is, so OAuth callers
18
+ // are authenticated towards the entryway using entryway auth instead.
19
+ const { headers } = await ctx.entrywayAuthHeaders(req, auth.credentials.did, com.atproto.server.deactivateAccount.$lxm);
19
20
  await entrywayClient.xrpc(com.atproto.server.deactivateAccount, {
20
21
  headers,
21
22
  body,
@@ -28,6 +29,11 @@ export default function (server, ctx) {
28
29
  auth,
29
30
  handler: async ({ input: { body }, auth }) => {
30
31
  await ctx.accountManager.deactivateAccount(auth.credentials.did, {
32
+ // For legacy reasons we check if it's an oauth credential before passing
33
+ // deleteCredentials since it did not before.
34
+ // @TODO Investiage why the deleteCredentials was not passed previously and
35
+ // address it in a different line of work
36
+ deleteCredentials: auth.credentials.type === 'oauth',
31
37
  deleteAfter: body.deleteAfter ?? null,
32
38
  });
33
39
  },
@@ -1 +1 @@
1
- {"version":3,"file":"deactivateAccount.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/server/deactivateAccount.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAe,MAAM,sBAAsB,CAAA;AAClE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AAElE,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAA;AAEnD,MAAM,CAAC,OAAO,WAAW,MAAc,EAAE,GAAe;IACtD,MAAM,EAAE,cAAc,EAAE,GAAG,GAAG,CAAA;IAE9B,MAAM,IAAI,GAAG,GAAG,CAAC,YAAY,CAAC,aAAa,CAAC;QAC1C,UAAU,EAAE,CAAC,SAAS,CAAC,SAAS,CAAC;QACjC,MAAM,EAAE,WAAW;QACnB,SAAS,EAAE,GAAG,EAAE;YACd,MAAM,IAAI,cAAc,CACtB,uDAAuD,CACxD,CAAA;QACH,CAAC;KACF,CAAC,CAAA;IAEF,IAAI,cAAc,EAAE,CAAC;QACnB,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,iBAAiB,EAAE;YAC/C,IAAI;YACJ,gIAAgI;YAChI,OAAO,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE;gBAC1C,MAAM,EAAE,OAAO,EAAE,GAAG,GAAG,CAAC,uBAAuB,CAAC,GAAG,CAAC,CAAA;gBACpD,MAAM,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,iBAAiB,EAAE;oBAC9D,OAAO;oBACP,IAAI;iBACL,CAAC,CAAA;YACJ,CAAC;SACF,CAAC,CAAA;IACJ,CAAC;SAAM,CAAC;QACN,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,iBAAiB,EAAE;YAC/C,IAAI;YACJ,OAAO,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;gBAC3C,MAAM,GAAG,CAAC,cAAc,CAAC,iBAAiB,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,EAAE;oBAC/D,WAAW,EAAE,IAAI,CAAC,WAAW,IAAI,IAAI;iBACtC,CAAC,CAAA;YACJ,CAAC;SACF,CAAC,CAAA;IACJ,CAAC;AACH,CAAC","sourcesContent":["import { ForbiddenError, type Server } from '@atproto/xrpc-server'\nimport { ACCESS_FULL, AuthScope } from '../../../../auth-scope.js'\nimport type { AppContext } from '../../../../context.js'\nimport { com } from '../../../../lexicons/index.js'\n\nexport default function (server: Server, ctx: AppContext) {\n const { entrywayClient } = ctx\n\n const auth = ctx.authVerifier.authorization({\n additional: [AuthScope.Takendown],\n scopes: ACCESS_FULL,\n authorize: () => {\n throw new ForbiddenError(\n 'OAuth credentials are not supported for this endpoint',\n )\n },\n })\n\n if (entrywayClient) {\n server.add(com.atproto.server.deactivateAccount, {\n auth,\n // in the case of entryway, the full flow is deactivateAccount (PDS) -> deactivateAccount (Entryway) -> updateSubjectStatus(PDS)\n handler: async ({ input: { body }, req }) => {\n const { headers } = ctx.entrywayPassthruHeaders(req)\n await entrywayClient.xrpc(com.atproto.server.deactivateAccount, {\n headers,\n body,\n })\n },\n })\n } else {\n server.add(com.atproto.server.deactivateAccount, {\n auth,\n handler: async ({ input: { body }, auth }) => {\n await ctx.accountManager.deactivateAccount(auth.credentials.did, {\n deleteAfter: body.deleteAfter ?? null,\n })\n },\n })\n }\n}\n"]}
1
+ {"version":3,"file":"deactivateAccount.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/server/deactivateAccount.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AAElE,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAA;AAEnD,MAAM,CAAC,OAAO,WAAW,MAAc,EAAE,GAAe;IACtD,MAAM,EAAE,cAAc,EAAE,GAAG,GAAG,CAAA;IAE9B,MAAM,IAAI,GAAG,GAAG,CAAC,YAAY,CAAC,aAAa,CAAC;QAC1C,UAAU,EAAE,CAAC,SAAS,CAAC,SAAS,CAAC;QACjC,MAAM,EAAE,WAAW;QACnB,SAAS,EAAE,CAAC,WAAW,EAAE,EAAE;YACzB,WAAW,CAAC,aAAa,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAA;QACjE,CAAC;KACF,CAAC,CAAA;IAEF,IAAI,cAAc,EAAE,CAAC;QACnB,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,iBAAiB,EAAE;YAC/C,IAAI;YACJ,gIAAgI;YAChI,OAAO,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,EAAE;gBAChD,qEAAqE;gBACrE,sEAAsE;gBACtE,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,GAAG,CAAC,mBAAmB,CAC/C,GAAG,EACH,IAAI,CAAC,WAAW,CAAC,GAAG,EACpB,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,iBAAiB,CAAC,IAAI,CAC1C,CAAA;gBAED,MAAM,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,iBAAiB,EAAE;oBAC9D,OAAO;oBACP,IAAI;iBACL,CAAC,CAAA;YACJ,CAAC;SACF,CAAC,CAAA;IACJ,CAAC;SAAM,CAAC;QACN,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,iBAAiB,EAAE;YAC/C,IAAI;YACJ,OAAO,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;gBAC3C,MAAM,GAAG,CAAC,cAAc,CAAC,iBAAiB,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,EAAE;oBAC/D,yEAAyE;oBACzE,6CAA6C;oBAC7C,2EAA2E;oBAC3E,yCAAyC;oBACzC,iBAAiB,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,KAAK,OAAO;oBACpD,WAAW,EAAE,IAAI,CAAC,WAAW,IAAI,IAAI;iBACtC,CAAC,CAAA;YACJ,CAAC;SACF,CAAC,CAAA;IACJ,CAAC;AACH,CAAC","sourcesContent":["import type { Server } from '@atproto/xrpc-server'\nimport { ACCESS_FULL, AuthScope } from '../../../../auth-scope.js'\nimport type { AppContext } from '../../../../context.js'\nimport { com } from '../../../../lexicons/index.js'\n\nexport default function (server: Server, ctx: AppContext) {\n const { entrywayClient } = ctx\n\n const auth = ctx.authVerifier.authorization({\n additional: [AuthScope.Takendown],\n scopes: ACCESS_FULL,\n authorize: (permissions) => {\n permissions.assertAccount({ attr: 'status', action: 'manage' })\n },\n })\n\n if (entrywayClient) {\n server.add(com.atproto.server.deactivateAccount, {\n auth,\n // in the case of entryway, the full flow is deactivateAccount (PDS) -> deactivateAccount (Entryway) -> updateSubjectStatus(PDS)\n handler: async ({ input: { body }, auth, req }) => {\n // DPoP bound credentials cannot be forwarded as-is, so OAuth callers\n // are authenticated towards the entryway using entryway auth instead.\n const { headers } = await ctx.entrywayAuthHeaders(\n req,\n auth.credentials.did,\n com.atproto.server.deactivateAccount.$lxm,\n )\n\n await entrywayClient.xrpc(com.atproto.server.deactivateAccount, {\n headers,\n body,\n })\n },\n })\n } else {\n server.add(com.atproto.server.deactivateAccount, {\n auth,\n handler: async ({ input: { body }, auth }) => {\n await ctx.accountManager.deactivateAccount(auth.credentials.did, {\n // For legacy reasons we check if it's an oauth credential before passing\n // deleteCredentials since it did not before.\n // @TODO Investiage why the deleteCredentials was not passed previously and\n // address it in a different line of work\n deleteCredentials: auth.credentials.type === 'oauth',\n deleteAfter: body.deleteAfter ?? null,\n })\n },\n })\n }\n}\n"]}
@@ -71,6 +71,11 @@ export type DiskBlobstoreConfig = {
71
71
  };
72
72
  export type IdentityConfig = {
73
73
  plcUrl: string;
74
+ /**
75
+ * Bounds each individual identity resolution attempt. Note that
76
+ * `safeFetch`'s own 10s timeout acts as an upper backstop, so values above
77
+ * 10s are effectively capped.
78
+ */
74
79
  resolverTimeout: number;
75
80
  cacheStaleTTL: number;
76
81
  cacheMaxTTL: number;
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config/config.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,cAAc,EACd,cAAc,EACf,MAAM,kCAAkC,CAAA;AACzC,OAAO,EAAE,KAAK,SAAS,EAA8B,MAAM,iBAAiB,CAAA;AAE5E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAEjD,YAAY,EAAE,cAAc,EAAE,CAAA;AAK9B,eAAO,MAAM,QAAQ,QAAS,iBAAiB,KA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