@atproto/pds 0.4.25 → 0.4.27

Sign up to get free protection for your applications and to get access to all the features.
Files changed (85) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/account-manager/db/migrations/003-privileged-app-passwords.d.ts +4 -0
  3. package/dist/account-manager/db/migrations/003-privileged-app-passwords.d.ts.map +1 -0
  4. package/dist/account-manager/db/migrations/003-privileged-app-passwords.js +15 -0
  5. package/dist/account-manager/db/migrations/003-privileged-app-passwords.js.map +1 -0
  6. package/dist/account-manager/db/migrations/index.d.ts +2 -0
  7. package/dist/account-manager/db/migrations/index.d.ts.map +1 -1
  8. package/dist/account-manager/db/migrations/index.js +2 -0
  9. package/dist/account-manager/db/migrations/index.js.map +1 -1
  10. package/dist/account-manager/db/schema/app-password.d.ts +1 -0
  11. package/dist/account-manager/db/schema/app-password.d.ts.map +1 -1
  12. package/dist/account-manager/db/schema/app-password.js.map +1 -1
  13. package/dist/account-manager/helpers/auth.d.ts +9 -4
  14. package/dist/account-manager/helpers/auth.d.ts.map +1 -1
  15. package/dist/account-manager/helpers/auth.js +32 -5
  16. package/dist/account-manager/helpers/auth.js.map +1 -1
  17. package/dist/account-manager/helpers/password.d.ts +7 -2
  18. package/dist/account-manager/helpers/password.d.ts.map +1 -1
  19. package/dist/account-manager/helpers/password.js +17 -4
  20. package/dist/account-manager/helpers/password.js.map +1 -1
  21. package/dist/account-manager/index.d.ts +5 -3
  22. package/dist/account-manager/index.d.ts.map +1 -1
  23. package/dist/account-manager/index.js +7 -7
  24. package/dist/account-manager/index.js.map +1 -1
  25. package/dist/api/chat/index.js +14 -14
  26. package/dist/api/chat/index.js.map +1 -1
  27. package/dist/api/com/atproto/identity/requestPlcOperationSignature.js +1 -1
  28. package/dist/api/com/atproto/identity/requestPlcOperationSignature.js.map +1 -1
  29. package/dist/api/com/atproto/identity/signPlcOperation.js +1 -1
  30. package/dist/api/com/atproto/identity/signPlcOperation.js.map +1 -1
  31. package/dist/api/com/atproto/repo/importRepo.js +1 -1
  32. package/dist/api/com/atproto/repo/importRepo.js.map +1 -1
  33. package/dist/api/com/atproto/server/activateAccount.js +1 -1
  34. package/dist/api/com/atproto/server/activateAccount.js.map +1 -1
  35. package/dist/api/com/atproto/server/createAppPassword.d.ts.map +1 -1
  36. package/dist/api/com/atproto/server/createAppPassword.js +2 -2
  37. package/dist/api/com/atproto/server/createAppPassword.js.map +1 -1
  38. package/dist/api/com/atproto/server/createSession.d.ts.map +1 -1
  39. package/dist/api/com/atproto/server/createSession.js +4 -4
  40. package/dist/api/com/atproto/server/createSession.js.map +1 -1
  41. package/dist/api/com/atproto/server/deactivateAccount.js +1 -1
  42. package/dist/api/com/atproto/server/deactivateAccount.js.map +1 -1
  43. package/dist/api/com/atproto/server/getAccountInviteCodes.js +1 -1
  44. package/dist/api/com/atproto/server/getAccountInviteCodes.js.map +1 -1
  45. package/dist/api/com/atproto/server/getServiceAuth.js +1 -1
  46. package/dist/api/com/atproto/server/getServiceAuth.js.map +1 -1
  47. package/dist/api/com/atproto/server/updateEmail.js +1 -1
  48. package/dist/api/com/atproto/server/updateEmail.js.map +1 -1
  49. package/dist/auth-verifier.d.ts +3 -1
  50. package/dist/auth-verifier.d.ts.map +1 -1
  51. package/dist/auth-verifier.js +16 -1
  52. package/dist/auth-verifier.js.map +1 -1
  53. package/dist/lexicon/lexicons.d.ts +10 -0
  54. package/dist/lexicon/lexicons.d.ts.map +1 -1
  55. package/dist/lexicon/lexicons.js +10 -0
  56. package/dist/lexicon/lexicons.js.map +1 -1
  57. package/dist/lexicon/types/com/atproto/server/createAppPassword.d.ts +3 -0
  58. package/dist/lexicon/types/com/atproto/server/createAppPassword.d.ts.map +1 -1
  59. package/dist/lexicon/types/com/atproto/server/createAppPassword.js.map +1 -1
  60. package/dist/lexicon/types/com/atproto/server/listAppPasswords.d.ts +1 -0
  61. package/dist/lexicon/types/com/atproto/server/listAppPasswords.d.ts.map +1 -1
  62. package/dist/lexicon/types/com/atproto/server/listAppPasswords.js.map +1 -1
  63. package/package.json +4 -4
  64. package/src/account-manager/db/migrations/003-privileged-app-passwords.ts +12 -0
  65. package/src/account-manager/db/migrations/index.ts +2 -0
  66. package/src/account-manager/db/schema/app-password.ts +1 -0
  67. package/src/account-manager/helpers/auth.ts +32 -4
  68. package/src/account-manager/helpers/password.ts +23 -5
  69. package/src/account-manager/index.ts +11 -9
  70. package/src/api/chat/index.ts +14 -14
  71. package/src/api/com/atproto/identity/requestPlcOperationSignature.ts +1 -1
  72. package/src/api/com/atproto/identity/signPlcOperation.ts +1 -1
  73. package/src/api/com/atproto/repo/importRepo.ts +1 -1
  74. package/src/api/com/atproto/server/activateAccount.ts +1 -1
  75. package/src/api/com/atproto/server/createAppPassword.ts +3 -1
  76. package/src/api/com/atproto/server/createSession.ts +5 -4
  77. package/src/api/com/atproto/server/deactivateAccount.ts +1 -1
  78. package/src/api/com/atproto/server/getAccountInviteCodes.ts +1 -1
  79. package/src/api/com/atproto/server/getServiceAuth.ts +1 -1
  80. package/src/api/com/atproto/server/updateEmail.ts +1 -1
  81. package/src/auth-verifier.ts +12 -1
  82. package/src/lexicon/lexicons.ts +11 -0
  83. package/src/lexicon/types/com/atproto/server/createAppPassword.ts +3 -0
  84. package/src/lexicon/types/com/atproto/server/listAppPasswords.ts +1 -0
  85. package/tests/app-passwords.test.ts +108 -7
package/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # @atproto/pds
2
2
 
3
+ ## 0.4.27
4
+
5
+ ### Patch Changes
6
+
7
+ - [#2517](https://github.com/bluesky-social/atproto/pull/2517) [`1d4ab5d04`](https://github.com/bluesky-social/atproto/commit/1d4ab5d046aac4539658ee6d7e61882c54d5beb9) Thanks [@dholms](https://github.com/dholms)! - Fix a bad join on privileged app passwords.
8
+
9
+ - Updated dependencies [[`1d4ab5d04`](https://github.com/bluesky-social/atproto/commit/1d4ab5d046aac4539658ee6d7e61882c54d5beb9)]:
10
+ - @atproto/api@0.12.13
11
+
12
+ ## 0.4.26
13
+
14
+ ### Patch Changes
15
+
16
+ - [#2515](https://github.com/bluesky-social/atproto/pull/2515) [`0cc5ef70f`](https://github.com/bluesky-social/atproto/commit/0cc5ef70f4e5a8e24983051d5f5ad8ee27be8684) Thanks [@dholms](https://github.com/dholms)! - Add privileged app password auth scope
17
+
3
18
  ## 0.4.25
4
19
 
5
20
  ### Patch Changes
@@ -0,0 +1,4 @@
1
+ import { Kysely } from 'kysely';
2
+ export declare function up(db: Kysely<unknown>): Promise<void>;
3
+ export declare function down(db: Kysely<unknown>): Promise<void>;
4
+ //# sourceMappingURL=003-privileged-app-passwords.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"003-privileged-app-passwords.d.ts","sourceRoot":"","sources":["../../../../src/account-manager/db/migrations/003-privileged-app-passwords.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAE/B,wBAAsB,EAAE,CAAC,EAAE,EAAE,MAAM,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAK3D;AAED,wBAAsB,IAAI,CAAC,EAAE,EAAE,MAAM,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAE7D"}
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.down = exports.up = void 0;
4
+ async function up(db) {
5
+ await db.schema
6
+ .alterTable('app_password')
7
+ .addColumn('privileged', 'integer', (col) => col.notNull().defaultTo(0))
8
+ .execute();
9
+ }
10
+ exports.up = up;
11
+ async function down(db) {
12
+ await db.schema.alterTable('app_password').dropColumn('privileged').execute();
13
+ }
14
+ exports.down = down;
15
+ //# sourceMappingURL=003-privileged-app-passwords.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"003-privileged-app-passwords.js","sourceRoot":"","sources":["../../../../src/account-manager/db/migrations/003-privileged-app-passwords.ts"],"names":[],"mappings":";;;AAEO,KAAK,UAAU,EAAE,CAAC,EAAmB;IAC1C,MAAM,EAAE,CAAC,MAAM;SACZ,UAAU,CAAC,cAAc,CAAC;SAC1B,SAAS,CAAC,YAAY,EAAE,SAAS,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;SACvE,OAAO,EAAE,CAAA;AACd,CAAC;AALD,gBAKC;AAEM,KAAK,UAAU,IAAI,CAAC,EAAmB;IAC5C,MAAM,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC,OAAO,EAAE,CAAA;AAC/E,CAAC;AAFD,oBAEC"}
@@ -1,8 +1,10 @@
1
1
  import * as mig001 from './001-init';
2
2
  import * as mig002 from './002-account-deactivation';
3
+ import * as mig003 from './003-privileged-app-passwords';
3
4
  declare const _default: {
4
5
  '001': typeof mig001;
5
6
  '002': typeof mig002;
7
+ '003': typeof mig003;
6
8
  };
7
9
  export default _default;
8
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/account-manager/db/migrations/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,YAAY,CAAA;AACpC,OAAO,KAAK,MAAM,MAAM,4BAA4B,CAAA;;;;;AAEpD,wBAGC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/account-manager/db/migrations/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,YAAY,CAAA;AACpC,OAAO,KAAK,MAAM,MAAM,4BAA4B,CAAA;AACpD,OAAO,KAAK,MAAM,MAAM,gCAAgC,CAAA;;;;;;AAExD,wBAIC"}
@@ -25,8 +25,10 @@ var __importStar = (this && this.__importStar) || function (mod) {
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
26
  const mig001 = __importStar(require("./001-init"));
27
27
  const mig002 = __importStar(require("./002-account-deactivation"));
28
+ const mig003 = __importStar(require("./003-privileged-app-passwords"));
28
29
  exports.default = {
29
30
  '001': mig001,
30
31
  '002': mig002,
32
+ '003': mig003,
31
33
  };
32
34
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/account-manager/db/migrations/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mDAAoC;AACpC,mEAAoD;AAEpD,kBAAe;IACb,KAAK,EAAE,MAAM;IACb,KAAK,EAAE,MAAM;CACd,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/account-manager/db/migrations/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mDAAoC;AACpC,mEAAoD;AACpD,uEAAwD;AAExD,kBAAe;IACb,KAAK,EAAE,MAAM;IACb,KAAK,EAAE,MAAM;IACb,KAAK,EAAE,MAAM;CACd,CAAA"}
@@ -3,6 +3,7 @@ export interface AppPassword {
3
3
  name: string;
4
4
  passwordScrypt: string;
5
5
  createdAt: string;
6
+ privileged: 0 | 1;
6
7
  }
7
8
  export declare const tableName = "app_password";
8
9
  export type PartialDB = {
@@ -1 +1 @@
1
- {"version":3,"file":"app-password.d.ts","sourceRoot":"","sources":["../../../../src/account-manager/db/schema/app-password.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;IACZ,cAAc,EAAE,MAAM,CAAA;IACtB,SAAS,EAAE,MAAM,CAAA;CAClB;AAED,eAAO,MAAM,SAAS,iBAAiB,CAAA;AAEvC,MAAM,MAAM,SAAS,GAAG;IAAE,CAAC,SAAS,CAAC,EAAE,WAAW,CAAA;CAAE,CAAA"}
1
+ {"version":3,"file":"app-password.d.ts","sourceRoot":"","sources":["../../../../src/account-manager/db/schema/app-password.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;IACZ,cAAc,EAAE,MAAM,CAAA;IACtB,SAAS,EAAE,MAAM,CAAA;IACjB,UAAU,EAAE,CAAC,GAAG,CAAC,CAAA;CAClB;AAED,eAAO,MAAM,SAAS,iBAAiB,CAAA;AAEvC,MAAM,MAAM,SAAS,GAAG;IAAE,CAAC,SAAS,CAAC,EAAE,WAAW,CAAA;CAAE,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"app-password.js","sourceRoot":"","sources":["../../../../src/account-manager/db/schema/app-password.ts"],"names":[],"mappings":";;;AAOa,QAAA,SAAS,GAAG,cAAc,CAAA"}
1
+ {"version":3,"file":"app-password.js","sourceRoot":"","sources":["../../../../src/account-manager/db/schema/app-password.ts"],"names":[],"mappings":";;;AAQa,QAAA,SAAS,GAAG,cAAc,CAAA"}
@@ -2,6 +2,7 @@
2
2
  import { KeyObject } from 'node:crypto';
3
3
  import { AuthScope } from '../../auth-verifier';
4
4
  import { AccountDb } from '../db';
5
+ import { AppPassDescript } from './password';
5
6
  export type AuthToken = {
6
7
  scope: AuthScope;
7
8
  sub: string;
@@ -37,14 +38,17 @@ export declare const createRefreshToken: (opts: {
37
38
  expiresIn?: string | number;
38
39
  }) => Promise<string>;
39
40
  export declare const decodeRefreshToken: (jwt: string) => RefreshToken;
40
- export declare const storeRefreshToken: (db: AccountDb, payload: RefreshToken, appPasswordName: string | null) => Promise<import("kysely").InsertResult>;
41
+ export declare const storeRefreshToken: (db: AccountDb, payload: RefreshToken, appPassword: AppPassDescript | null) => Promise<import("kysely").InsertResult>;
41
42
  export declare const getRefreshToken: (db: AccountDb, id: string) => Promise<{
42
- did: string;
43
43
  id: string;
44
+ did: string;
44
45
  expiresAt: string;
45
46
  nextId: string | null;
46
- appPasswordName: string | null;
47
- } | undefined>;
47
+ appPassword: {
48
+ name: string;
49
+ privileged: boolean;
50
+ } | null;
51
+ } | null>;
48
52
  export declare const deleteExpiredRefreshTokens: (db: AccountDb, did: string, now: string) => Promise<void>;
49
53
  export declare const addRefreshGracePeriod: (db: AccountDb, opts: {
50
54
  id: string;
@@ -55,6 +59,7 @@ export declare const revokeRefreshToken: (db: AccountDb, id: string) => Promise<
55
59
  export declare const revokeRefreshTokensByDid: (db: AccountDb, did: string) => Promise<boolean>;
56
60
  export declare const revokeAppPasswordRefreshToken: (db: AccountDb, did: string, appPassName: string) => Promise<boolean>;
57
61
  export declare const getRefreshTokenId: () => string;
62
+ export declare const formatScope: (appPassword: AppPassDescript | null) => AuthScope;
58
63
  export declare class ConcurrentRefreshError extends Error {
59
64
  }
60
65
  //# sourceMappingURL=auth.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../src/account-manager/helpers/auth.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAIvC,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEjC,MAAM,MAAM,SAAS,GAAG;IACtB,KAAK,EAAE,SAAS,CAAA;IAChB,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,EAAE,MAAM,CAAA;CACZ,CAAA;AAED,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG;IAAE,KAAK,EAAE,SAAS,CAAC,OAAO,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAA;AAEhF,eAAO,MAAM,YAAY,SAAgB;IACvC,GAAG,EAAE,MAAM,CAAA;IACX,MAAM,EAAE,SAAS,CAAA;IACjB,UAAU,EAAE,MAAM,CAAA;IAClB,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;CAC5B;;;EAOA,CAAA;AAED,eAAO,MAAM,iBAAiB,SAAU;IACtC,GAAG,EAAE,MAAM,CAAA;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e,GAAG,IAAI,2CAcpC,CAAA;AAED,eAAO,MAAM,eAAe,sBAA6B,MAAM;;;;;;;;;SA0B9D,CAAA;AAED,eAAO,MAAM,0BAA0B,uBAEhC,MAAM,OACN,MAAM,kBAQZ,CAAA;AAED,eAAO,MAAM,qBAAqB,wBAE1B;IACJ,EAAE,EAAE,MAAM,CAAA;IACV,SAAS,EAAE,MAAM,CAAA;IACjB,MAAM,EAAE,MAAM,CAAA;CACf,kBAgBF,CAAA;AAED,eAAO,MAAM,kBAAkB,sBAA6B,MAAM,qBAKjE,CAAA;AAED,eAAO,MAAM,wBAAwB,uBAA8B,MAAM,qBAKxE,CAAA;AAED,eAAO,MAAM,6BAA6B,uBAEnC,MAAM,eACE,MAAM,qBAUpB,CAAA;AAED,eAAO,MAAM,iBAAiB,cAE7B,CAAA;AAED,eAAO,MAAM,WAAW,gBAAiB,eAAe,GAAG,IAAI,KAAG,SAKjE,CAAA;AAED,qBAAa,sBAAuB,SAAQ,KAAK;CAAG"}
@@ -26,7 +26,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
26
26
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
27
  };
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.ConcurrentRefreshError = exports.getRefreshTokenId = exports.revokeAppPasswordRefreshToken = exports.revokeRefreshTokensByDid = exports.revokeRefreshToken = exports.addRefreshGracePeriod = exports.deleteExpiredRefreshTokens = exports.getRefreshToken = exports.storeRefreshToken = exports.decodeRefreshToken = exports.createRefreshToken = exports.createAccessToken = exports.createTokens = void 0;
29
+ exports.ConcurrentRefreshError = exports.formatScope = exports.getRefreshTokenId = exports.revokeAppPasswordRefreshToken = exports.revokeRefreshTokensByDid = exports.revokeRefreshToken = exports.addRefreshGracePeriod = exports.deleteExpiredRefreshTokens = exports.getRefreshToken = exports.storeRefreshToken = exports.decodeRefreshToken = exports.createRefreshToken = exports.createAccessToken = exports.createTokens = void 0;
30
30
  const node_assert_1 = __importDefault(require("node:assert"));
31
31
  const jose = __importStar(require("jose"));
32
32
  const ui8 = __importStar(require("uint8arrays"));
@@ -71,13 +71,13 @@ const decodeRefreshToken = (jwt) => {
71
71
  return token;
72
72
  };
73
73
  exports.decodeRefreshToken = decodeRefreshToken;
74
- const storeRefreshToken = async (db, payload, appPasswordName) => {
74
+ const storeRefreshToken = async (db, payload, appPassword) => {
75
75
  const [result] = await db.executeWithRetry(db.db
76
76
  .insertInto('refresh_token')
77
77
  .values({
78
78
  id: payload.jti,
79
79
  did: payload.sub,
80
- appPasswordName,
80
+ appPasswordName: appPassword?.name,
81
81
  expiresAt: new Date(payload.exp * 1000).toISOString(),
82
82
  })
83
83
  .onConflict((oc) => oc.doNothing()));
@@ -85,11 +85,30 @@ const storeRefreshToken = async (db, payload, appPasswordName) => {
85
85
  };
86
86
  exports.storeRefreshToken = storeRefreshToken;
87
87
  const getRefreshToken = async (db, id) => {
88
- return db.db
88
+ const res = await db.db
89
89
  .selectFrom('refresh_token')
90
+ .leftJoin('app_password', (join) => join
91
+ .onRef('app_password.did', '=', 'refresh_token.did')
92
+ .onRef('app_password.name', '=', 'refresh_token.appPasswordName'))
90
93
  .where('id', '=', id)
91
- .selectAll()
94
+ .selectAll('refresh_token')
95
+ .select('app_password.privileged')
92
96
  .executeTakeFirst();
97
+ if (!res)
98
+ return null;
99
+ const { did, expiresAt, appPasswordName, nextId, privileged } = res;
100
+ return {
101
+ id,
102
+ did,
103
+ expiresAt,
104
+ nextId,
105
+ appPassword: appPasswordName
106
+ ? {
107
+ name: appPasswordName,
108
+ privileged: privileged === 1 ? true : false,
109
+ }
110
+ : null,
111
+ };
93
112
  };
94
113
  exports.getRefreshToken = getRefreshToken;
95
114
  const deleteExpiredRefreshTokens = async (db, did, now) => {
@@ -134,6 +153,14 @@ const getRefreshTokenId = () => {
134
153
  return ui8.toString(crypto.randomBytes(32), 'base64');
135
154
  };
136
155
  exports.getRefreshTokenId = getRefreshTokenId;
156
+ const formatScope = (appPassword) => {
157
+ if (!appPassword)
158
+ return auth_verifier_1.AuthScope.Access;
159
+ return appPassword.privileged
160
+ ? auth_verifier_1.AuthScope.AppPassPrivileged
161
+ : auth_verifier_1.AuthScope.AppPass;
162
+ };
163
+ exports.formatScope = formatScope;
137
164
  class ConcurrentRefreshError extends Error {
138
165
  }
139
166
  exports.ConcurrentRefreshError = ConcurrentRefreshError;
@@ -1 +1 @@
1
- {"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../src/account-manager/helpers/auth.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8DAAgC;AAEhC,2CAA4B;AAC5B,iDAAkC;AAClC,wDAAyC;AACzC,uDAA+C;AAWxC,MAAM,YAAY,GAAG,KAAK,EAAE,IAOlC,EAAE,EAAE;IACH,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,IAAI,CAAA;IAC/D,MAAM,CAAC,SAAS,EAAE,UAAU,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QAChD,IAAA,yBAAiB,EAAC,EAAE,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC;QAChE,IAAA,0BAAkB,EAAC,EAAE,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,EAAE,SAAS,EAAE,CAAC;KAChE,CAAC,CAAA;IACF,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,CAAA;AAClC,CAAC,CAAA;AAdY,QAAA,YAAY,gBAcxB;AAEM,MAAM,iBAAiB,GAAG,CAAC,IAMjC,EAAmB,EAAE;IACpB,MAAM,EACJ,GAAG,EACH,MAAM,EACN,UAAU,EACV,KAAK,GAAG,yBAAS,CAAC,MAAM,EACxB,SAAS,GAAG,SAAS,GACtB,GAAG,IAAI,CAAA;IACR,MAAM,MAAM,GAAG,IAAI,IAAI,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,CA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EAAa,EACb,GAAW,EACX,WAAmB,EACnB,EAAE;IACF,MAAM,CAAC,EAAE,cAAc,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,gBAAgB,CACpD,EAAE,CAAC,EAAE;SACF,UAAU,CAAC,eAAe,CAAC;SAC3B,KAAK,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,CAAC;SACtB,KAAK,CAAC,iBAAiB,EAAE,GAAG,EAAE,WAAW,CAAC,CAC9C,CAAA;IAED,OAAO,cAAc,GAAG,CAAC,CAAA;AAC3B,CAAC,CAAA;AAbY,QAAA,6BAA6B,iCAazC;AAEM,MAAM,iBAAiB,GAAG,GAAG,EAAE;IACpC,OAAO,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC,EAAE,QAAQ,CAAC,CAAA;AACvD,CAAC,CAAA;AAFY,QAAA,iBAAiB,qBAE7B;AAEM,MAAM,WAAW,GAAG,CAAC,WAAmC,EAAa,EAAE;IAC5E,IAAI,CAAC,WAAW;QAAE,OAAO,yBAAS,CAAC,MAAM,CAAA;IACzC,OAAO,WAAW,CAAC,UAAU;QAC3B,CAAC,CAAC,yBAAS,CAAC,iBAAiB;QAC7B,CAAC,CAAC,yBAAS,CAAC,OAAO,CAAA;AACvB,CAAC,CAAA;AALY,QAAA,WAAW,eAKvB;AAED,MAAa,sBAAuB,SAAQ,KAAK;CAAG;AAApD,wDAAoD"}
@@ -1,15 +1,20 @@
1
1
  import { AccountDb } from '../db';
2
2
  import { AppPassword } from '../../lexicon/types/com/atproto/server/createAppPassword';
3
+ export type AppPassDescript = {
4
+ name: string;
5
+ privileged: boolean;
6
+ };
3
7
  export declare const verifyAccountPassword: (db: AccountDb, did: string, password: string) => Promise<boolean>;
4
- export declare const verifyAppPassword: (db: AccountDb, did: string, password: string) => Promise<string | null>;
8
+ export declare const verifyAppPassword: (db: AccountDb, did: string, password: string) => Promise<AppPassDescript | null>;
5
9
  export declare const updateUserPassword: (db: AccountDb, opts: {
6
10
  did: string;
7
11
  passwordScrypt: string;
8
12
  }) => Promise<void>;
9
- export declare const createAppPassword: (db: AccountDb, did: string, name: string) => Promise<AppPassword>;
13
+ export declare const createAppPassword: (db: AccountDb, did: string, name: string, privileged: boolean) => Promise<AppPassword>;
10
14
  export declare const listAppPasswords: (db: AccountDb, did: string) => Promise<{
11
15
  name: string;
12
16
  createdAt: string;
17
+ privileged: boolean;
13
18
  }[]>;
14
19
  export declare const deleteAppPassword: (db: AccountDb, did: string, name: string) => Promise<void>;
15
20
  //# sourceMappingURL=password.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"password.d.ts","sourceRoot":"","sources":["../../../src/account-manager/helpers/password.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,0DAA0D,CAAA;AAEtF,eAAO,MAAM,qBAAqB,uBAE3B,MAAM,YACD,MAAM,KACf,QAAQ,OAAO,CAOjB,CAAA;AAED,eAAO,MAAM,iBAAiB,uBAEvB,MAAM,YACD,MAAM,KACf,QAAQ,MAAM,GAAG,IAAI,CASvB,CAAA;AAED,eAAO,MAAM,kBAAkB,wBAEvB;IACJ,GAAG,EAAE,MAAM,CAAA;IACX,cAAc,EAAE,MAAM,CAAA;CACvB,kBAQF,CAAA;AAED,eAAO,MAAM,iBAAiB,uBAEvB,MAAM,QACL,MAAM,KACX,QAAQ,WAAW,CA+BrB,CAAA;AAED,eAAO,MAAM,gBAAgB,uBAEtB,MAAM,KACV,QAAQ;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,EAAE,CAM/C,CAAA;AAED,eAAO,MAAM,iBAAiB,uBAEvB,MAAM,QACL,MAAM,kBAQb,CAAA"}
1
+ {"version":3,"file":"password.d.ts","sourceRoot":"","sources":["../../../src/account-manager/helpers/password.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,0DAA0D,CAAA;AAEtF,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,MAAM,CAAA;IACZ,UAAU,EAAE,OAAO,CAAA;CACpB,CAAA;AAED,eAAO,MAAM,qBAAqB,uBAE3B,MAAM,YACD,MAAM,KACf,QAAQ,OAAO,CAOjB,CAAA;AAED,eAAO,MAAM,iBAAiB,uBAEvB,MAAM,YACD,MAAM,KACf,QAAQ,eAAe,GAAG,IAAI,CAahC,CAAA;AAED,eAAO,MAAM,kBAAkB,wBAEvB;IACJ,GAAG,EAAE,MAAM,CAAA;IACX,cAAc,EAAE,MAAM,CAAA;CACvB,kBAQF,CAAA;AAED,eAAO,MAAM,iBAAiB,uBAEvB,MAAM,QACL,MAAM,cACA,OAAO,KAClB,QAAQ,WAAW,CAiCrB,CAAA;AAED,eAAO,MAAM,gBAAgB,uBAEtB,MAAM,KACV,QAAQ;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,OAAO,CAAA;CAAE,EAAE,CAYpE,CAAA;AAED,eAAO,MAAM,iBAAiB,uBAEvB,MAAM,QACL,MAAM,kBAQb,CAAA"}
@@ -44,7 +44,12 @@ const verifyAppPassword = async (db, did, password) => {
44
44
  .where('did', '=', did)
45
45
  .where('passwordScrypt', '=', passwordScrypt)
46
46
  .executeTakeFirst();
47
- return found?.name ?? null;
47
+ if (!found)
48
+ return null;
49
+ return {
50
+ name: found.name,
51
+ privileged: found.privileged === 1 ? true : false,
52
+ };
48
53
  };
49
54
  exports.verifyAppPassword = verifyAppPassword;
50
55
  const updateUserPassword = async (db, opts) => {
@@ -54,7 +59,7 @@ const updateUserPassword = async (db, opts) => {
54
59
  .where('did', '=', opts.did));
55
60
  };
56
61
  exports.updateUserPassword = updateUserPassword;
57
- const createAppPassword = async (db, did, name) => {
62
+ const createAppPassword = async (db, did, name, privileged) => {
58
63
  // create an app password with format:
59
64
  // 1234-abcd-5678-efgh
60
65
  const str = (0, crypto_1.randomStr)(16, 'base32').slice(0, 16);
@@ -73,6 +78,7 @@ const createAppPassword = async (db, did, name) => {
73
78
  name,
74
79
  passwordScrypt,
75
80
  createdAt: new Date().toISOString(),
81
+ privileged: privileged ? 1 : 0,
76
82
  })
77
83
  .returningAll());
78
84
  if (!got) {
@@ -82,15 +88,22 @@ const createAppPassword = async (db, did, name) => {
82
88
  name,
83
89
  password,
84
90
  createdAt: got.createdAt,
91
+ privileged,
85
92
  };
86
93
  };
87
94
  exports.createAppPassword = createAppPassword;
88
95
  const listAppPasswords = async (db, did) => {
89
- return db.db
96
+ const res = await db.db
90
97
  .selectFrom('app_password')
91
- .select(['name', 'createdAt'])
98
+ .select(['name', 'createdAt', 'privileged'])
92
99
  .where('did', '=', did)
100
+ .orderBy('createdAt', 'desc')
93
101
  .execute();
102
+ return res.map((row) => ({
103
+ name: row.name,
104
+ createdAt: row.createdAt,
105
+ privileged: row.privileged === 1 ? true : false,
106
+ }));
94
107
  };
95
108
  exports.listAppPasswords = listAppPasswords;
96
109
  const deleteAppPassword = async (db, did, name) => {
@@ -1 +1 @@
1
- {"version":3,"file":"password.js","sourceRoot":"","sources":["../../../src/account-manager/helpers/password.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4CAA2C;AAC3C,sDAA0D;AAC1D,iDAAkC;AAI3B,MAAM,qBAAqB,GAAG,KAAK,EACxC,EAAa,EACb,GAAW,EACX,QAAgB,EACE,EAAE;IACpB,MAAM,KAAK,GAAG,MAAM,EAAE,CAAC,EAAE;SACtB,UAAU,CAAC,SAAS,CAAC;SACrB,SAAS,EAAE;SACX,KAAK,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,CAAC;SACtB,gBAAgB,EAAE,CAAA;IACrB,OAAO,KAAK,CAAC,CAAC,CAAC,MAAM,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,KAAK,CAAC,cA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Aa,EACb,GAAW,EACX,IAAY,EACZ,EAAE;IACF,MAAM,EAAE,CAAC,gBAAgB,CACvB,EAAE,CAAC,EAAE;SACF,UAAU,CAAC,cAAc,CAAC;SAC1B,KAAK,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,CAAC;SACtB,KAAK,CAAC,MAAM,EAAE,GAAG,EAAE,IAAI,CAAC,CAC5B,CAAA;AACH,CAAC,CAAA;AAXY,QAAA,iBAAiB,qBAW7B"}
@@ -5,6 +5,7 @@ import { AccountDb, EmailTokenPurpose } from './db';
5
5
  import * as account from './helpers/account';
6
6
  import { ActorAccount } from './helpers/account';
7
7
  import * as invite from './helpers/invite';
8
+ import * as password from './helpers/password';
8
9
  import { StatusAttr } from '../lexicon/types/com/atproto/admin/defs';
9
10
  export declare class AccountManager {
10
11
  private jwtKey;
@@ -38,19 +39,20 @@ export declare class AccountManager {
38
39
  updateRepoRoot(did: string, cid: CID, rev: string): Promise<void>;
39
40
  deactivateAccount(did: string, deleteAfter: string | null): Promise<void>;
40
41
  activateAccount(did: string): Promise<void>;
41
- createSession(did: string, appPasswordName: string | null): Promise<{
42
+ createSession(did: string, appPassword: password.AppPassDescript | null): Promise<{
42
43
  accessJwt: string;
43
44
  refreshJwt: string;
44
45
  }>;
45
46
  rotateRefreshToken(id: string): any;
46
47
  revokeRefreshToken(id: string): Promise<boolean>;
47
- createAppPassword(did: string, name: string): Promise<import("../lexicon/types/com/atproto/server/createAppPassword").AppPassword>;
48
+ createAppPassword(did: string, name: string, privileged: boolean): Promise<import("../lexicon/types/com/atproto/server/createAppPassword").AppPassword>;
48
49
  listAppPasswords(did: string): Promise<{
49
50
  name: string;
50
51
  createdAt: string;
52
+ privileged: boolean;
51
53
  }[]>;
52
54
  verifyAccountPassword(did: string, passwordStr: string): Promise<boolean>;
53
- verifyAppPassword(did: string, passwordStr: string): Promise<string | null>;
55
+ verifyAppPassword(did: string, passwordStr: string): Promise<password.AppPassDescript | null>;
54
56
  revokeAppPassword(did: string, name: string): Promise<void>;
55
57
  ensureInviteIsAvailable(code: string): Promise<void>;
56
58
  createInviteCodes(toCreate: {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/account-manager/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAEvC,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAA;AACtC,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAsB,MAAM,MAAM,CAAA;AAEvE,OAAO,KAAK,OAAO,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAGhD,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAA;AAI1C,OAAO,EAAE,UAAU,EAAE,MAAM,yCAAyC,CAAA;AAEpE,qBAAa,cAAc;IAKvB,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,UAAU;IALpB,EAAE,EAAE,SAAS,CAAA;gBAGX,UAAU,EAAE,MAAM,EACV,MAAM,EAAE,SAAS,EACjB,UAAU,EAAE,MAAM,EAC1B,wBAAwB,UAAQ;IAK5B,cAAc;IAKpB,KAAK;IAOC,UAAU,CACd,WAAW,EAAE,MAAM,EACnB,KAAK,CAAC,EAAE,OAAO,CAAC,iBAAiB,GAChC,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC;IAIzB,iBAAiB,CACrB,KAAK,EAAE,MAAM,EACb,KAAK,CAAC,EAAE,OAAO,CAAC,iBAAiB,GAChC,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC;IAKzB,eAAe,CAAC,GAAG,EAAE,MAAM;IAK3B,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAMjD,cAAc,CAClB,WAAW,EAAE,MAAM,EACnB,KAAK,CAAC,EAAE,OAAO,CAAC,iBAAiB,GAChC,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAKnB,aAAa,CAA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AE,MAAM,CAAA;KAAE;CAWpE"}
@@ -147,15 +147,15 @@ class AccountManager {
147
147
  }
148
148
  // Auth
149
149
  // ----------
150
- async createSession(did, appPasswordName) {
150
+ async createSession(did, appPassword) {
151
151
  const { accessJwt, refreshJwt } = await auth.createTokens({
152
152
  did,
153
153
  jwtKey: this.jwtKey,
154
154
  serviceDid: this.serviceDid,
155
- scope: appPasswordName === null ? auth_verifier_1.AuthScope.Access : auth_verifier_1.AuthScope.AppPass,
155
+ scope: auth.formatScope(appPassword),
156
156
  });
157
157
  const refreshPayload = auth.decodeRefreshToken(refreshJwt);
158
- await auth.storeRefreshToken(this.db, refreshPayload, appPasswordName);
158
+ await auth.storeRefreshToken(this.db, refreshPayload, appPassword);
159
159
  return { accessJwt, refreshJwt };
160
160
  }
161
161
  async rotateRefreshToken(id) {
@@ -182,7 +182,7 @@ class AccountManager {
182
182
  did: token.did,
183
183
  jwtKey: this.jwtKey,
184
184
  serviceDid: this.serviceDid,
185
- scope: token.appPasswordName === null ? auth_verifier_1.AuthScope.Access : auth_verifier_1.AuthScope.AppPass,
185
+ scope: auth.formatScope(token.appPassword),
186
186
  jti: nextId,
187
187
  });
188
188
  const refreshPayload = auth.decodeRefreshToken(refreshJwt);
@@ -193,7 +193,7 @@ class AccountManager {
193
193
  expiresAt: expiresAt.toISOString(),
194
194
  nextId,
195
195
  }),
196
- auth.storeRefreshToken(dbTxn, refreshPayload, token.appPasswordName),
196
+ auth.storeRefreshToken(dbTxn, refreshPayload, token.appPassword),
197
197
  ]));
198
198
  }
199
199
  catch (err) {
@@ -209,8 +209,8 @@ class AccountManager {
209
209
  }
210
210
  // Passwords
211
211
  // ----------
212
- async createAppPassword(did, name) {
213
- return password.createAppPassword(this.db, did, name);
212
+ async createAppPassword(did, name, privileged) {
213
+ return password.createAppPassword(this.db, did, name, privileged);
214
214
  }
215
215
  async listAppPasswords(did) {
216
216
  return password.listAppPasswords(this.db, did);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","s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C,IAAyC;QAC3D,MAAM,GAAG,GAAG,MAAM,UAAU,CAAC,0BAA0B,CACrD,IAAI,CAAC,EAAE,EACP,gBAAgB,EAChB,IAAI,CAAC,KAAK,CACX,CAAA;QACD,MAAM,IAAI,CAAC,qBAAqB,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAA;IACpE,CAAC;IAED,KAAK,CAAC,qBAAqB,CAAC,IAAuC;QACjE,MAAM,EAAE,GAAG,EAAE,GAAG,IAAI,CAAA;QACpB,MAAM,cAAc,GAAG,MAAM,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;QACjE,MAAM,IAAI,CAAC,EAAE,CAAC,WAAW,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CACxC,OAAO,CAAC,GAAG,CAAC;YACV,QAAQ,CAAC,kBAAkB,CAAC,KAAK,EAAE,EAAE,GAAG,EAAE,cAAc,EAAE,CAAC;YAC3D,UAAU,CAAC,gBAAgB,CAAC,KAAK,EAAE,GAAG,EAAE,gBAAgB,CAAC;YACzD,IAAI,CAAC,wBAAwB,CAAC,KAAK,EAAE,GAAG,CAAC;SAC1C,CAAC,CACH,CAAA;IACH,CAAC;CACF;AArXD,wCAqXC"}
@@ -3,85 +3,85 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const pipethrough_1 = require("../../pipethrough");
4
4
  function default_1(server, ctx) {
5
5
  server.chat.bsky.actor.deleteAccount({
6
- auth: ctx.authVerifier.accessNotAppPassword,
6
+ auth: ctx.authVerifier.accessAppPassPrivileged,
7
7
  handler: async ({ req, auth }) => {
8
8
  return (0, pipethrough_1.pipethroughProcedure)(ctx, req, auth.credentials.did);
9
9
  },
10
10
  });
11
11
  server.chat.bsky.actor.exportAccountData({
12
- auth: ctx.authVerifier.accessNotAppPassword,
12
+ auth: ctx.authVerifier.accessAppPassPrivileged,
13
13
  handler: ({ req, auth }) => {
14
14
  return (0, pipethrough_1.pipethrough)(ctx, req, auth.credentials.did);
15
15
  },
16
16
  });
17
17
  server.chat.bsky.convo.deleteMessageForSelf({
18
- auth: ctx.authVerifier.accessNotAppPassword,
18
+ auth: ctx.authVerifier.accessAppPassPrivileged,
19
19
  handler: ({ req, auth, input }) => {
20
20
  return (0, pipethrough_1.pipethroughProcedure)(ctx, req, auth.credentials.did, input.body);
21
21
  },
22
22
  });
23
23
  server.chat.bsky.convo.getConvo({
24
- auth: ctx.authVerifier.accessNotAppPassword,
24
+ auth: ctx.authVerifier.accessAppPassPrivileged,
25
25
  handler: ({ req, auth }) => {
26
26
  return (0, pipethrough_1.pipethrough)(ctx, req, auth.credentials.did);
27
27
  },
28
28
  });
29
29
  server.chat.bsky.convo.getConvoForMembers({
30
- auth: ctx.authVerifier.accessNotAppPassword,
30
+ auth: ctx.authVerifier.accessAppPassPrivileged,
31
31
  handler: ({ req, auth }) => {
32
32
  return (0, pipethrough_1.pipethrough)(ctx, req, auth.credentials.did);
33
33
  },
34
34
  });
35
35
  server.chat.bsky.convo.getLog({
36
- auth: ctx.authVerifier.accessNotAppPassword,
36
+ auth: ctx.authVerifier.accessAppPassPrivileged,
37
37
  handler: ({ req, auth }) => {
38
38
  return (0, pipethrough_1.pipethrough)(ctx, req, auth.credentials.did);
39
39
  },
40
40
  });
41
41
  server.chat.bsky.convo.getMessages({
42
- auth: ctx.authVerifier.accessNotAppPassword,
42
+ auth: ctx.authVerifier.accessAppPassPrivileged,
43
43
  handler: ({ req, auth }) => {
44
44
  return (0, pipethrough_1.pipethrough)(ctx, req, auth.credentials.did);
45
45
  },
46
46
  });
47
47
  server.chat.bsky.convo.leaveConvo({
48
- auth: ctx.authVerifier.accessNotAppPassword,
48
+ auth: ctx.authVerifier.accessAppPassPrivileged,
49
49
  handler: ({ req, auth, input }) => {
50
50
  return (0, pipethrough_1.pipethroughProcedure)(ctx, req, auth.credentials.did, input.body);
51
51
  },
52
52
  });
53
53
  server.chat.bsky.convo.listConvos({
54
- auth: ctx.authVerifier.accessNotAppPassword,
54
+ auth: ctx.authVerifier.accessAppPassPrivileged,
55
55
  handler: ({ req, auth }) => {
56
56
  return (0, pipethrough_1.pipethrough)(ctx, req, auth.credentials.did);
57
57
  },
58
58
  });
59
59
  server.chat.bsky.convo.muteConvo({
60
- auth: ctx.authVerifier.accessNotAppPassword,
60
+ auth: ctx.authVerifier.accessAppPassPrivileged,
61
61
  handler: ({ req, auth, input }) => {
62
62
  return (0, pipethrough_1.pipethroughProcedure)(ctx, req, auth.credentials.did, input.body);
63
63
  },
64
64
  });
65
65
  server.chat.bsky.convo.sendMessage({
66
- auth: ctx.authVerifier.accessNotAppPassword,
66
+ auth: ctx.authVerifier.accessAppPassPrivileged,
67
67
  handler: ({ req, auth, input }) => {
68
68
  return (0, pipethrough_1.pipethroughProcedure)(ctx, req, auth.credentials.did, input.body);
69
69
  },
70
70
  });
71
71
  server.chat.bsky.convo.sendMessageBatch({
72
- auth: ctx.authVerifier.accessNotAppPassword,
72
+ auth: ctx.authVerifier.accessAppPassPrivileged,
73
73
  handler: ({ req, auth, input }) => {
74
74
  return (0, pipethrough_1.pipethroughProcedure)(ctx, req, auth.credentials.did, input.body);
75
75
  },
76
76
  });
77
77
  server.chat.bsky.convo.unmuteConvo({
78
- auth: ctx.authVerifier.accessNotAppPassword,
78
+ auth: ctx.authVerifier.accessAppPassPrivileged,
79
79
  handler: ({ req, auth, input }) => {
80
80
  return (0, pipethrough_1.pipethroughProcedure)(ctx, req, auth.credentials.did, input.body);
81
81
  },
82
82
  });
83
83
  server.chat.bsky.convo.updateRead({
84
- auth: ctx.authVerifier.accessNotAppPassword,
84
+ auth: ctx.authVerifier.accessAppPassPrivileged,
85
85
  handler: ({ req, auth, input }) => {
86
86
  return (0, pipethrough_1.pipethroughProcedure)(ctx, req, auth.credentials.did, input.body);
87
87
  },