@atproto/pds 0.4.34 → 0.4.36
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +17 -0
- package/dist/account-manager/db/migrations/004-oauth.d.ts +4 -0
- package/dist/account-manager/db/migrations/004-oauth.d.ts.map +1 -0
- package/dist/account-manager/db/migrations/004-oauth.js +106 -0
- package/dist/account-manager/db/migrations/004-oauth.js.map +1 -0
- package/dist/account-manager/db/migrations/index.d.ts +2 -0
- package/dist/account-manager/db/migrations/index.d.ts.map +1 -1
- package/dist/account-manager/db/migrations/index.js +2 -0
- package/dist/account-manager/db/migrations/index.js.map +1 -1
- package/dist/account-manager/db/schema/authorization-request.d.ts +19 -0
- package/dist/account-manager/db/schema/authorization-request.d.ts.map +1 -0
- package/dist/account-manager/db/schema/authorization-request.js +5 -0
- package/dist/account-manager/db/schema/authorization-request.js.map +1 -0
- package/dist/account-manager/db/schema/device-account.d.ts +14 -0
- package/dist/account-manager/db/schema/device-account.d.ts.map +1 -0
- package/dist/account-manager/db/schema/device-account.js +5 -0
- package/dist/account-manager/db/schema/device-account.js.map +1 -0
- package/dist/account-manager/db/schema/device.d.ts +16 -0
- package/dist/account-manager/db/schema/device.d.ts.map +1 -0
- package/dist/account-manager/db/schema/device.js +5 -0
- package/dist/account-manager/db/schema/device.js.map +1 -0
- package/dist/account-manager/db/schema/index.d.ts +11 -1
- package/dist/account-manager/db/schema/index.d.ts.map +1 -1
- package/dist/account-manager/db/schema/token.d.ts +24 -0
- package/dist/account-manager/db/schema/token.d.ts.map +1 -0
- package/dist/account-manager/db/schema/token.js +5 -0
- package/dist/account-manager/db/schema/token.js.map +1 -0
- package/dist/account-manager/db/schema/used-refresh-token.d.ts +12 -0
- package/dist/account-manager/db/schema/used-refresh-token.d.ts.map +1 -0
- package/dist/account-manager/db/schema/used-refresh-token.js +5 -0
- package/dist/account-manager/db/schema/used-refresh-token.js.map +1 -0
- package/dist/account-manager/helpers/account.d.ts +27 -5
- package/dist/account-manager/helpers/account.d.ts.map +1 -1
- package/dist/account-manager/helpers/account.js +15 -14
- package/dist/account-manager/helpers/account.js.map +1 -1
- package/dist/account-manager/helpers/authorization-request.d.ts +12 -0
- package/dist/account-manager/helpers/authorization-request.d.ts.map +1 -0
- package/dist/account-manager/helpers/authorization-request.js +59 -0
- package/dist/account-manager/helpers/authorization-request.js.map +1 -0
- package/dist/account-manager/helpers/device-account.d.ts +108 -0
- package/dist/account-manager/helpers/device-account.d.ts.map +1 -0
- package/dist/account-manager/helpers/device-account.js +82 -0
- package/dist/account-manager/helpers/device-account.js.map +1 -0
- package/dist/account-manager/helpers/device.d.ts +9 -0
- package/dist/account-manager/helpers/device.d.ts.map +1 -0
- package/dist/account-manager/helpers/device.js +32 -0
- package/dist/account-manager/helpers/device.js.map +1 -0
- package/dist/account-manager/helpers/token.d.ts +485 -0
- package/dist/account-manager/helpers/token.d.ts.map +1 -0
- package/dist/account-manager/helpers/token.js +123 -0
- package/dist/account-manager/helpers/token.js.map +1 -0
- package/dist/account-manager/helpers/used-refresh-token.d.ts +10 -0
- package/dist/account-manager/helpers/used-refresh-token.d.ts.map +1 -0
- package/dist/account-manager/helpers/used-refresh-token.js +25 -0
- package/dist/account-manager/helpers/used-refresh-token.js.map +1 -0
- package/dist/account-manager/index.d.ts +36 -6
- package/dist/account-manager/index.d.ts.map +1 -1
- package/dist/account-manager/index.js +223 -22
- package/dist/account-manager/index.js.map +1 -1
- package/dist/actor-store/preference/reader.js.map +1 -1
- package/dist/actor-store/record/reader.d.ts +1 -1
- package/dist/api/app/bsky/util/resolver.d.ts +1 -1
- package/dist/api/com/atproto/server/createSession.d.ts.map +1 -1
- package/dist/api/com/atproto/server/createSession.js +7 -31
- package/dist/api/com/atproto/server/createSession.js.map +1 -1
- package/dist/api/com/atproto/server/deleteSession.d.ts.map +1 -1
- package/dist/api/com/atproto/server/deleteSession.js +14 -13
- package/dist/api/com/atproto/server/deleteSession.js.map +1 -1
- package/dist/api/com/atproto/server/getSession.d.ts.map +1 -1
- package/dist/api/com/atproto/server/getSession.js +4 -2
- package/dist/api/com/atproto/server/getSession.js.map +1 -1
- package/dist/api/com/atproto/server/refreshSession.d.ts.map +1 -1
- package/dist/api/com/atproto/server/refreshSession.js +4 -2
- package/dist/api/com/atproto/server/refreshSession.js.map +1 -1
- package/dist/api/com/atproto/sync/getRepoStatus.d.ts.map +1 -1
- package/dist/api/com/atproto/sync/getRepoStatus.js +2 -1
- package/dist/api/com/atproto/sync/getRepoStatus.js.map +1 -1
- package/dist/api/com/atproto/sync/listRepos.js +2 -2
- package/dist/api/com/atproto/sync/listRepos.js.map +1 -1
- package/dist/api/proxy.d.ts.map +1 -1
- package/dist/api/proxy.js +15 -2
- package/dist/api/proxy.js.map +1 -1
- package/dist/auth-routes.d.ts +4 -0
- package/dist/auth-routes.d.ts.map +1 -0
- package/dist/auth-routes.js +24 -0
- package/dist/auth-routes.js.map +1 -0
- package/dist/auth-verifier.d.ts +32 -11
- package/dist/auth-verifier.d.ts.map +1 -1
- package/dist/auth-verifier.js +238 -79
- package/dist/auth-verifier.js.map +1 -1
- package/dist/config/config.d.ts +12 -0
- package/dist/config/config.d.ts.map +1 -1
- package/dist/config/config.js +45 -0
- package/dist/config/config.js.map +1 -1
- package/dist/config/env.d.ts +8 -0
- package/dist/config/env.d.ts.map +1 -1
- package/dist/config/env.js +10 -0
- package/dist/config/env.js.map +1 -1
- package/dist/config/secrets.d.ts +1 -0
- package/dist/config/secrets.d.ts.map +1 -1
- package/dist/config/secrets.js +1 -0
- package/dist/config/secrets.js.map +1 -1
- package/dist/context.d.ts +6 -0
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js +71 -13
- package/dist/context.js.map +1 -1
- package/dist/db/cast.d.ts +15 -0
- package/dist/db/cast.d.ts.map +1 -0
- package/dist/db/cast.js +66 -0
- package/dist/db/cast.js.map +1 -0
- package/dist/db/db.d.ts +2 -2
- package/dist/db/db.d.ts.map +1 -1
- package/dist/db/db.js +9 -7
- package/dist/db/db.js.map +1 -1
- package/dist/db/index.d.ts +1 -0
- package/dist/db/index.d.ts.map +1 -1
- package/dist/db/index.js +1 -0
- package/dist/db/index.js.map +1 -1
- package/dist/error.d.ts.map +1 -1
- package/dist/error.js +5 -0
- package/dist/error.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/logger.d.ts +13 -11
- package/dist/logger.d.ts.map +1 -1
- package/dist/logger.js +80 -64
- package/dist/logger.js.map +1 -1
- package/dist/oauth/detailed-account-store.d.ts +27 -0
- package/dist/oauth/detailed-account-store.d.ts.map +1 -0
- package/dist/oauth/detailed-account-store.js +76 -0
- package/dist/oauth/detailed-account-store.js.map +1 -0
- package/dist/oauth/provider.d.ts +16 -0
- package/dist/oauth/provider.d.ts.map +1 -0
- package/dist/oauth/provider.js +45 -0
- package/dist/oauth/provider.js.map +1 -0
- package/dist/pipethrough.d.ts.map +1 -1
- package/dist/pipethrough.js.map +1 -1
- package/dist/sequencer/events.d.ts +2 -2
- package/example.env +21 -3
- package/package.json +9 -7
- package/src/account-manager/db/migrations/004-oauth.ts +122 -0
- package/src/account-manager/db/migrations/index.ts +2 -0
- package/src/account-manager/db/schema/authorization-request.ts +26 -0
- package/src/account-manager/db/schema/device-account.ts +15 -0
- package/src/account-manager/db/schema/device.ts +18 -0
- package/src/account-manager/db/schema/index.ts +15 -0
- package/src/account-manager/db/schema/token.ts +34 -0
- package/src/account-manager/db/schema/used-refresh-token.ts +13 -0
- package/src/account-manager/helpers/account.ts +16 -21
- package/src/account-manager/helpers/authorization-request.ts +82 -0
- package/src/account-manager/helpers/device-account.ts +135 -0
- package/src/account-manager/helpers/device.ts +45 -0
- package/src/account-manager/helpers/token.ts +185 -0
- package/src/account-manager/helpers/used-refresh-token.ts +30 -0
- package/src/account-manager/index.ts +325 -20
- package/src/actor-store/preference/reader.ts +1 -1
- package/src/api/com/atproto/server/createSession.ts +8 -44
- package/src/api/com/atproto/server/deleteSession.ts +14 -20
- package/src/api/com/atproto/server/getSession.ts +7 -2
- package/src/api/com/atproto/server/refreshSession.ts +6 -2
- package/src/api/com/atproto/sync/getRepoStatus.ts +3 -1
- package/src/api/com/atproto/sync/listRepos.ts +1 -1
- package/src/api/proxy.ts +18 -2
- package/src/auth-routes.ts +27 -0
- package/src/auth-verifier.ts +312 -92
- package/src/config/config.ts +66 -0
- package/src/config/env.ts +24 -0
- package/src/config/secrets.ts +2 -0
- package/src/context.ts +80 -14
- package/src/db/cast.ts +59 -0
- package/src/db/db.ts +15 -12
- package/src/db/index.ts +1 -0
- package/src/error.ts +7 -0
- package/src/index.ts +2 -0
- package/src/logger.ts +83 -38
- package/src/oauth/detailed-account-store.ts +96 -0
- package/src/oauth/provider.ts +77 -0
- package/src/pipethrough.ts +3 -2
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"token.js","sourceRoot":"","sources":["../../../src/account-manager/helpers/token.ts"],"names":[],"mappings":";;;AAUA,iCAOiB;AAEjB,uCAAyD;AACzD,qDAIyB;AAQlB,MAAM,WAAW,GAAG,CACzB,GAAsB,EACtB,QAAgB,EACL,EAAE,CAAC,CAAC;IACf,EAAE,EAAE,GAAG,CAAC,OAAO;IACf,IAAI,EAAE;QACJ,SAAS,EAAE,IAAA,gBAAW,EAAC,GAAG,CAAC,SAAS,CAAC;QACrC,SAAS,EAAE,IAAA,gBAAW,EAAC,GAAG,CAAC,SAAS,CAAC;QACrC,SAAS,EAAE,IAAA,gBAAW,EAAC,GAAG,CAAC,SAAS,CAAC;QACrC,QAAQ,EAAE,GAAG,CAAC,QAAQ;QACtB,UAAU,EAAE,IAAA,mBAAc,EAAC,GAAG,CAAC,UAAU,CAAC;QAC1C,QAAQ,EAAE,GAAG,CAAC,QAAQ;QACtB,GAAG,EAAE,GAAG,CAAC,GAAG;QACZ,UAAU,EAAE,IAAA,mBAAc,EAAC,GAAG,CAAC,UAAU,CAAC;QAC1C,OAAO,EAAE,GAAG,CAAC,OAAO;YAClB,CAAC,CAAC,IAAA,kBAAa,EA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EAC7B,OAAqB,EACrB,EAAE,CACF,EAAE,CAAC,EAAE;KACF,WAAW,CAAC,OAAO,CAAC;KACpB,GAAG,CAAC;IACH,OAAO,EAAE,UAAU;IACnB,mBAAmB,EAAE,eAAe;IAEpC,SAAS,EAAE,IAAA,cAAS,EAAC,OAAO,CAAC,SAAS,CAAC;IACvC,SAAS,EAAE,IAAA,cAAS,EAAC,OAAO,CAAC,SAAS,CAAC;IACvC,UAAU,EAAE,IAAA,iBAAY,EAAC,OAAO,CAAC,UAAU,CAAC;CAC7C,CAAC;IACF,yBAAyB;KACxB,KAAK,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE,CAAC,CAAA;AAlBZ,QAAA,QAAQ,YAkBI;AAElB,MAAM,QAAQ,GAAG,CAAC,EAAa,EAAE,OAAgB,EAAE,EAAE;AAC1D,iDAAiD;AACjD,EAAE,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC,SAAS,EAAE,GAAG,EAAE,OAAO,CAAC,CAAA;AAF7C,QAAA,QAAQ,YAEqC"}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import { RefreshToken } from '@atproto/oauth-provider';
|
2
|
+
import { AccountDb } from '../db';
|
3
|
+
/**
|
4
|
+
* Note that the used refresh tokens will be removed once the token is revoked.
|
5
|
+
* This is done through the foreign key constraint in the database.
|
6
|
+
*/
|
7
|
+
export declare const insertQB: (db: AccountDb, tokenId: number, refreshToken: RefreshToken) => import("kysely").InsertQueryBuilder<import("../db").DatabaseSchema, "used_refresh_token", import("kysely").InsertResult>;
|
8
|
+
export declare const findByTokenQB: (db: AccountDb, refreshToken: RefreshToken) => import("kysely/dist/cjs/parser/select-parser").QueryBuilderWithSelection<import("kysely/dist/cjs/parser/table-parser").From<import("../db").DatabaseSchema, "used_refresh_token">, "used_refresh_token", {}, "tokenId">;
|
9
|
+
export declare const countQB: (db: AccountDb, refreshToken: RefreshToken) => import("kysely/dist/cjs/parser/select-parser").QueryBuilderWithSelection<import("kysely/dist/cjs/parser/table-parser").From<import("../db").DatabaseSchema, "used_refresh_token">, "used_refresh_token", {}, (qb: import("kysely").ExpressionBuilder<import("kysely/dist/cjs/parser/table-parser").From<import("../db").DatabaseSchema, "used_refresh_token">, "used_refresh_token">) => import("kysely").AliasedAggregateFunctionBuilder<import("kysely/dist/cjs/parser/table-parser").From<import("../db").DatabaseSchema, "used_refresh_token">, "used_refresh_token", number, "count">>;
|
10
|
+
//# sourceMappingURL=used-refresh-token.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"used-refresh-token.d.ts","sourceRoot":"","sources":["../../../src/account-manager/helpers/used-refresh-token.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEjC;;;GAGG;AACH,eAAO,MAAM,QAAQ,2BAEV,MAAM,gBACD,YAAY,6HAKW,CAAA;AAEvC,eAAO,MAAM,aAAa,gCAAiC,YAAY,4NAKjD,CAAA;AAEtB,eAAO,MAAM,OAAO,gCAAiC,YAAY,gkBAKG,CAAA"}
|
@@ -0,0 +1,25 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.countQB = exports.findByTokenQB = exports.insertQB = void 0;
|
4
|
+
/**
|
5
|
+
* Note that the used refresh tokens will be removed once the token is revoked.
|
6
|
+
* This is done through the foreign key constraint in the database.
|
7
|
+
*/
|
8
|
+
const insertQB = (db, tokenId, refreshToken) => db.db
|
9
|
+
.insertInto('used_refresh_token')
|
10
|
+
.values({ tokenId, refreshToken })
|
11
|
+
.onConflict((oc) => oc.doNothing());
|
12
|
+
exports.insertQB = insertQB;
|
13
|
+
const findByTokenQB = (db, refreshToken) => db.db
|
14
|
+
.selectFrom('used_refresh_token')
|
15
|
+
// uses primary key index
|
16
|
+
.where('refreshToken', '=', refreshToken)
|
17
|
+
.select('tokenId');
|
18
|
+
exports.findByTokenQB = findByTokenQB;
|
19
|
+
const countQB = (db, refreshToken) => db.db
|
20
|
+
.selectFrom('used_refresh_token')
|
21
|
+
// uses primary key index
|
22
|
+
.where('refreshToken', '=', refreshToken)
|
23
|
+
.select((qb) => qb.fn.count('refreshToken').as('count'));
|
24
|
+
exports.countQB = countQB;
|
25
|
+
//# sourceMappingURL=used-refresh-token.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"used-refresh-token.js","sourceRoot":"","sources":["../../../src/account-manager/helpers/used-refresh-token.ts"],"names":[],"mappings":";;;AAGA;;;GAGG;AACI,MAAM,QAAQ,GAAG,CACtB,EAAa,EACb,OAAe,EACf,YAA0B,EAC1B,EAAE,CACF,EAAE,CAAC,EAAE;KACF,UAAU,CAAC,oBAAoB,CAAC;KAChC,MAAM,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,CAAC;KACjC,UAAU,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,SAAS,EAAE,CAAC,CAAA;AAR1B,QAAA,QAAQ,YAQkB;AAEhC,MAAM,aAAa,GAAG,CAAC,EAAa,EAAE,YAA0B,EAAE,EAAE,CACzE,EAAE,CAAC,EAAE;KACF,UAAU,CAAC,oBAAoB,CAAC;IACjC,yBAAyB;KACxB,KAAK,CAAC,cAAc,EAAE,GAAG,EAAE,YAAY,CAAC;KACxC,MAAM,CAAC,SAAS,CAAC,CAAA;AALT,QAAA,aAAa,iBAKJ;AAEf,MAAM,OAAO,GAAG,CAAC,EAAa,EAAE,YAA0B,EAAE,EAAE,CACnE,EAAE,CAAC,EAAE;KACF,UAAU,CAAC,oBAAoB,CAAC;IACjC,yBAAyB;KACxB,KAAK,CAAC,cAAc,EAAE,GAAG,EAAE,YAAY,CAAC;KACxC,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAS,cAAc,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAA;AALvD,QAAA,OAAO,WAKgD"}
|
@@ -1,19 +1,22 @@
|
|
1
1
|
/// <reference types="node" />
|
2
|
-
import {
|
2
|
+
import { AccountInfo, AccountStore, Code, DeviceData, DeviceId, DeviceStore, FoundRequestResult, LoginCredentials, NewTokenData, RefreshToken, RequestData, RequestId, RequestStore, TokenData, TokenId, TokenInfo, TokenStore, UpdateRequestData } from '@atproto/oauth-provider';
|
3
3
|
import { CID } from 'multiformats/cid';
|
4
|
+
import { KeyObject } from 'node:crypto';
|
5
|
+
import { BackgroundQueue } from '../background';
|
6
|
+
import { StatusAttr } from '../lexicon/types/com/atproto/admin/defs';
|
4
7
|
import { AccountDb, EmailTokenPurpose } from './db';
|
5
8
|
import * as account from './helpers/account';
|
6
|
-
import { AccountStatus } from './helpers/account';
|
7
|
-
import { ActorAccount } from './helpers/account';
|
9
|
+
import { AccountStatus, ActorAccount } from './helpers/account';
|
8
10
|
import * as invite from './helpers/invite';
|
9
11
|
import * as password from './helpers/password';
|
10
|
-
import { StatusAttr } from '../lexicon/types/com/atproto/admin/defs';
|
11
12
|
export { AccountStatus } from './helpers/account';
|
12
|
-
export
|
13
|
+
export { formatAccountStatus } from './helpers/account';
|
14
|
+
export declare class AccountManager implements AccountStore, RequestStore, DeviceStore, TokenStore {
|
15
|
+
private backgroundQueue;
|
13
16
|
private jwtKey;
|
14
17
|
private serviceDid;
|
15
18
|
db: AccountDb;
|
16
|
-
constructor(dbLocation: string, jwtKey: KeyObject, serviceDid: string, disableWalAutoCheckpoint?: boolean);
|
19
|
+
constructor(backgroundQueue: BackgroundQueue, dbLocation: string, jwtKey: KeyObject, serviceDid: string, disableWalAutoCheckpoint?: boolean);
|
17
20
|
migrateOrThrow(): Promise<void>;
|
18
21
|
close(): void;
|
19
22
|
getAccount(handleOrDid: string, flags?: account.AvailabilityFlags): Promise<ActorAccount | null>;
|
@@ -50,6 +53,13 @@ export declare class AccountManager {
|
|
50
53
|
}>;
|
51
54
|
rotateRefreshToken(id: string): any;
|
52
55
|
revokeRefreshToken(id: string): Promise<boolean>;
|
56
|
+
login({ identifier, password, }: {
|
57
|
+
identifier: string;
|
58
|
+
password: string;
|
59
|
+
}): Promise<{
|
60
|
+
user: ActorAccount;
|
61
|
+
appPassword: password.AppPassDescript | null;
|
62
|
+
}>;
|
53
63
|
createAppPassword(did: string, name: string, privileged: boolean): Promise<import("../lexicon/types/com/atproto/server/createAppPassword").AppPassword>;
|
54
64
|
listAppPasswords(did: string): Promise<{
|
55
65
|
name: string;
|
@@ -95,5 +105,25 @@ export declare class AccountManager {
|
|
95
105
|
did: string;
|
96
106
|
password: string;
|
97
107
|
}): Promise<void>;
|
108
|
+
authenticateAccount({ username: identifier, password, remember }: LoginCredentials, deviceId: DeviceId): Promise<AccountInfo | null>;
|
109
|
+
addAuthorizedClient(deviceId: DeviceId, sub: string, clientId: string): Promise<void>;
|
110
|
+
getDeviceAccount(deviceId: DeviceId, sub: string): Promise<AccountInfo | null>;
|
111
|
+
listDeviceAccounts(deviceId: DeviceId): Promise<AccountInfo[]>;
|
112
|
+
removeDeviceAccount(deviceId: DeviceId, sub: string): Promise<void>;
|
113
|
+
createRequest(id: RequestId, data: RequestData): Promise<void>;
|
114
|
+
readRequest(id: RequestId): Promise<RequestData | null>;
|
115
|
+
updateRequest(id: RequestId, data: UpdateRequestData): Promise<void>;
|
116
|
+
deleteRequest(id: RequestId): Promise<void>;
|
117
|
+
findRequestByCode(code: Code): Promise<FoundRequestResult | null>;
|
118
|
+
createDevice(deviceId: DeviceId, data: DeviceData): Promise<void>;
|
119
|
+
readDevice(deviceId: DeviceId): Promise<null | DeviceData>;
|
120
|
+
updateDevice(deviceId: DeviceId, data: Partial<DeviceData>): Promise<void>;
|
121
|
+
deleteDevice(deviceId: DeviceId): Promise<void>;
|
122
|
+
createToken(id: TokenId, data: TokenData, refreshToken?: RefreshToken): Promise<void>;
|
123
|
+
readToken(tokenId: TokenId): Promise<TokenInfo | null>;
|
124
|
+
deleteToken(tokenId: TokenId): Promise<void>;
|
125
|
+
rotateToken(tokenId: TokenId, newTokenId: TokenId, newRefreshToken: RefreshToken, newData: NewTokenData): Promise<void>;
|
126
|
+
findTokenByRefreshToken(refreshToken: RefreshToken): Promise<TokenInfo | null>;
|
127
|
+
findTokenByCode(code: Code): Promise<TokenInfo | null>;
|
98
128
|
}
|
99
129
|
//# sourceMappingURL=index.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/account-manager/index.ts"],"names":[],"mappings":";
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/account-manager/index.ts"],"names":[],"mappings":";AACA,OAAO,EACL,WAAW,EACX,YAAY,EACZ,IAAI,EACJ,UAAU,EACV,QAAQ,EACR,WAAW,EACX,kBAAkB,EAClB,gBAAgB,EAChB,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,SAAS,EACT,YAAY,EACZ,SAAS,EACT,OAAO,EACP,SAAS,EACT,UAAU,EACV,iBAAiB,EAClB,MAAM,yBAAyB,CAAA;AAEhC,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAA;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAGvC,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAE/C,OAAO,EAAE,UAAU,EAAE,MAAM,yCAAyC,CAAA;AACpE,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAsB,MAAM,MAAM,CAAA;AACvE,OAAO,KAAK,OAAO,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAM/D,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAA;AAC1C,OAAO,KAAK,QAAQ,MAAM,oBAAoB,CAAA;AAM9C,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,EAAE,mBAAmB,EAAE,M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,OAAO,CAAC,IAAI,CAAC;IAO/C,WAAW,CACf,EAAE,EAAE,OAAO,EACX,IAAI,EAAE,SAAS,EACf,YAAY,CAAC,EAAE,YAAY,GAC1B,OAAO,CAAC,IAAI,CAAC;IAgBV,SAAS,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC;IAKtD,WAAW,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAK5C,WAAW,CACf,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,OAAO,EACnB,eAAe,EAAE,YAAY,EAC7B,OAAO,EAAE,YAAY,GACpB,OAAO,CAAC,IAAI,CAAC;IA6BV,uBAAuB,CAC3B,YAAY,EAAE,YAAY,GACzB,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC;IAatB,eAAe,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC;CAI7D"}
|
@@ -23,22 +23,37 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
23
23
|
return result;
|
24
24
|
};
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
26
|
-
exports.AccountManager = exports.AccountStatus = void 0;
|
26
|
+
exports.AccountManager = exports.formatAccountStatus = exports.AccountStatus = void 0;
|
27
27
|
const common_1 = require("@atproto/common");
|
28
|
-
const
|
29
|
-
const
|
28
|
+
const xrpc_server_1 = require("@atproto/xrpc-server");
|
29
|
+
const auth_verifier_1 = require("../auth-verifier");
|
30
|
+
const db_1 = require("../db");
|
31
|
+
const db_2 = require("./db");
|
30
32
|
const account = __importStar(require("./helpers/account"));
|
31
33
|
const account_1 = require("./helpers/account");
|
32
|
-
const repo = __importStar(require("./helpers/repo"));
|
33
34
|
const auth = __importStar(require("./helpers/auth"));
|
35
|
+
const authRequest = __importStar(require("./helpers/authorization-request"));
|
36
|
+
const deviceAccount = __importStar(require("./helpers/device-account"));
|
37
|
+
const device = __importStar(require("./helpers/device"));
|
38
|
+
const emailToken = __importStar(require("./helpers/email-token"));
|
34
39
|
const invite = __importStar(require("./helpers/invite"));
|
35
40
|
const password = __importStar(require("./helpers/password"));
|
36
|
-
const
|
37
|
-
const
|
41
|
+
const repo = __importStar(require("./helpers/repo"));
|
42
|
+
const scrypt = __importStar(require("./helpers/scrypt"));
|
43
|
+
const token = __importStar(require("./helpers/token"));
|
44
|
+
const usedRefreshToken = __importStar(require("./helpers/used-refresh-token"));
|
38
45
|
var account_2 = require("./helpers/account");
|
39
46
|
Object.defineProperty(exports, "AccountStatus", { enumerable: true, get: function () { return account_2.AccountStatus; } });
|
47
|
+
var account_3 = require("./helpers/account");
|
48
|
+
Object.defineProperty(exports, "formatAccountStatus", { enumerable: true, get: function () { return account_3.formatAccountStatus; } });
|
40
49
|
class AccountManager {
|
41
|
-
constructor(dbLocation, jwtKey, serviceDid, disableWalAutoCheckpoint = false) {
|
50
|
+
constructor(backgroundQueue, dbLocation, jwtKey, serviceDid, disableWalAutoCheckpoint = false) {
|
51
|
+
Object.defineProperty(this, "backgroundQueue", {
|
52
|
+
enumerable: true,
|
53
|
+
configurable: true,
|
54
|
+
writable: true,
|
55
|
+
value: backgroundQueue
|
56
|
+
});
|
42
57
|
Object.defineProperty(this, "jwtKey", {
|
43
58
|
enumerable: true,
|
44
59
|
configurable: true,
|
@@ -57,11 +72,11 @@ class AccountManager {
|
|
57
72
|
writable: true,
|
58
73
|
value: void 0
|
59
74
|
});
|
60
|
-
this.db = (0,
|
75
|
+
this.db = (0, db_2.getDb)(dbLocation, disableWalAutoCheckpoint);
|
61
76
|
}
|
62
77
|
async migrateOrThrow() {
|
63
78
|
await this.db.ensureWal();
|
64
|
-
await (0,
|
79
|
+
await (0, db_2.getMigrator)(this.db).migrateToLatestOrThrow();
|
65
80
|
}
|
66
81
|
close() {
|
67
82
|
this.db.close();
|
@@ -89,18 +104,8 @@ class AccountManager {
|
|
89
104
|
includeDeactivated: true,
|
90
105
|
includeTakenDown: true,
|
91
106
|
});
|
92
|
-
|
93
|
-
|
94
|
-
}
|
95
|
-
else if (got.takedownRef) {
|
96
|
-
return account_1.AccountStatus.Takendown;
|
97
|
-
}
|
98
|
-
else if (got.deactivatedAt) {
|
99
|
-
return account_1.AccountStatus.Deactivated;
|
100
|
-
}
|
101
|
-
else {
|
102
|
-
return account_1.AccountStatus.Active;
|
103
|
-
}
|
107
|
+
const res = account.formatAccountStatus(got);
|
108
|
+
return res.active ? account_1.AccountStatus.Active : res.status;
|
104
109
|
}
|
105
110
|
async createAccount(opts) {
|
106
111
|
const { did, handle, email, password, repoCid, repoRev, inviteCode, deactivated, } = opts;
|
@@ -144,9 +149,10 @@ class AccountManager {
|
|
144
149
|
return account.deleteAccount(this.db, did);
|
145
150
|
}
|
146
151
|
async takedownAccount(did, takedown) {
|
147
|
-
await this.db.transaction((dbTxn) => Promise.all([
|
152
|
+
await this.db.transaction(async (dbTxn) => Promise.all([
|
148
153
|
account.updateAccountTakedownStatus(dbTxn, did, takedown),
|
149
154
|
auth.revokeRefreshTokensByDid(dbTxn, did),
|
155
|
+
token.removeByDidQB(dbTxn, did).execute(),
|
150
156
|
]));
|
151
157
|
}
|
152
158
|
async getAccountAdminStatus(did) {
|
@@ -223,6 +229,42 @@ class AccountManager {
|
|
223
229
|
async revokeRefreshToken(id) {
|
224
230
|
return auth.revokeRefreshToken(this.db, id);
|
225
231
|
}
|
232
|
+
// Login
|
233
|
+
// ----------
|
234
|
+
async login({ identifier, password, }) {
|
235
|
+
const start = Date.now();
|
236
|
+
try {
|
237
|
+
const identifierNormalized = identifier.toLowerCase();
|
238
|
+
const user = identifierNormalized.includes('@')
|
239
|
+
? await this.getAccountByEmail(identifierNormalized, {
|
240
|
+
includeDeactivated: true,
|
241
|
+
includeTakenDown: true,
|
242
|
+
})
|
243
|
+
: await this.getAccount(identifierNormalized, {
|
244
|
+
includeDeactivated: true,
|
245
|
+
includeTakenDown: true,
|
246
|
+
});
|
247
|
+
if (!user) {
|
248
|
+
throw new xrpc_server_1.AuthRequiredError('Invalid identifier or password');
|
249
|
+
}
|
250
|
+
let appPassword = null;
|
251
|
+
const validAccountPass = await this.verifyAccountPassword(user.did, password);
|
252
|
+
if (!validAccountPass) {
|
253
|
+
appPassword = await this.verifyAppPassword(user.did, password);
|
254
|
+
if (appPassword === null) {
|
255
|
+
throw new xrpc_server_1.AuthRequiredError('Invalid identifier or password');
|
256
|
+
}
|
257
|
+
}
|
258
|
+
if ((0, db_1.softDeleted)(user)) {
|
259
|
+
throw new xrpc_server_1.AuthRequiredError('Account has been taken down', 'AccountTakedown');
|
260
|
+
}
|
261
|
+
return { user, appPassword };
|
262
|
+
}
|
263
|
+
finally {
|
264
|
+
// Mitigate timing attacks
|
265
|
+
await (0, common_1.wait)(350 - (Date.now() - start));
|
266
|
+
}
|
267
|
+
}
|
226
268
|
// Passwords
|
227
269
|
// ----------
|
228
270
|
async createAppPassword(did, name, privileged) {
|
@@ -310,6 +352,165 @@ class AccountManager {
|
|
310
352
|
auth.revokeRefreshTokensByDid(dbTxn, did),
|
311
353
|
]));
|
312
354
|
}
|
355
|
+
// AccountStore
|
356
|
+
async authenticateAccount({ username: identifier, password, remember = false }, deviceId) {
|
357
|
+
try {
|
358
|
+
const { user, appPassword } = await this.login({ identifier, password });
|
359
|
+
if (appPassword) {
|
360
|
+
throw new xrpc_server_1.AuthRequiredError('App passwords are not allowed');
|
361
|
+
}
|
362
|
+
await this.db.executeWithRetry(deviceAccount.createOrUpdateQB(this.db, deviceId, user.did, remember));
|
363
|
+
return await this.getDeviceAccount(deviceId, user.did);
|
364
|
+
}
|
365
|
+
catch (err) {
|
366
|
+
if (err instanceof xrpc_server_1.AuthRequiredError)
|
367
|
+
return null;
|
368
|
+
throw err;
|
369
|
+
}
|
370
|
+
}
|
371
|
+
async addAuthorizedClient(deviceId, sub, clientId) {
|
372
|
+
await this.db.transaction(async (dbTxn) => {
|
373
|
+
const row = await deviceAccount
|
374
|
+
.readQB(dbTxn, deviceId, sub)
|
375
|
+
.executeTakeFirstOrThrow();
|
376
|
+
const { authorizedClients } = deviceAccount.toDeviceAccountInfo(row);
|
377
|
+
if (!authorizedClients.includes(clientId)) {
|
378
|
+
await deviceAccount
|
379
|
+
.updateQB(dbTxn, deviceId, sub, {
|
380
|
+
authorizedClients: [...authorizedClients, clientId],
|
381
|
+
})
|
382
|
+
.execute();
|
383
|
+
}
|
384
|
+
});
|
385
|
+
}
|
386
|
+
async getDeviceAccount(deviceId, sub) {
|
387
|
+
const row = await deviceAccount
|
388
|
+
.getAccountInfoQB(this.db, deviceId, sub)
|
389
|
+
.executeTakeFirst();
|
390
|
+
if (!row)
|
391
|
+
return null;
|
392
|
+
return {
|
393
|
+
account: deviceAccount.toAccount(row, this.serviceDid),
|
394
|
+
info: deviceAccount.toDeviceAccountInfo(row),
|
395
|
+
};
|
396
|
+
}
|
397
|
+
async listDeviceAccounts(deviceId) {
|
398
|
+
const rows = await deviceAccount
|
399
|
+
.listRememberedQB(this.db, deviceId)
|
400
|
+
.execute();
|
401
|
+
return rows.map((row) => ({
|
402
|
+
account: deviceAccount.toAccount(row, this.serviceDid),
|
403
|
+
info: deviceAccount.toDeviceAccountInfo(row),
|
404
|
+
}));
|
405
|
+
}
|
406
|
+
async removeDeviceAccount(deviceId, sub) {
|
407
|
+
await this.db.executeWithRetry(deviceAccount.removeQB(this.db, deviceId, sub));
|
408
|
+
}
|
409
|
+
// RequestStore
|
410
|
+
async createRequest(id, data) {
|
411
|
+
await this.db.executeWithRetry(authRequest.createQB(this.db, id, data));
|
412
|
+
}
|
413
|
+
async readRequest(id) {
|
414
|
+
try {
|
415
|
+
const row = await authRequest.readQB(this.db, id).executeTakeFirst();
|
416
|
+
if (!row)
|
417
|
+
return null;
|
418
|
+
return authRequest.rowToRequestData(row);
|
419
|
+
}
|
420
|
+
finally {
|
421
|
+
// Take the opportunity to clean up expired requests. Do this after we got
|
422
|
+
// the current (potentially expired) request data to allow the provider to
|
423
|
+
// handle expired requests.
|
424
|
+
this.backgroundQueue.add(async () => {
|
425
|
+
await this.db.executeWithRetry(authRequest.removeOldExpiredQB(this.db));
|
426
|
+
});
|
427
|
+
}
|
428
|
+
}
|
429
|
+
async updateRequest(id, data) {
|
430
|
+
await this.db.executeWithRetry(authRequest.updateQB(this.db, id, data));
|
431
|
+
}
|
432
|
+
async deleteRequest(id) {
|
433
|
+
await this.db.executeWithRetry(authRequest.removeByIdQB(this.db, id));
|
434
|
+
}
|
435
|
+
async findRequestByCode(code) {
|
436
|
+
const row = await authRequest.findByCodeQB(this.db, code).executeTakeFirst();
|
437
|
+
return row ? authRequest.rowToFoundRequestResult(row) : null;
|
438
|
+
}
|
439
|
+
// DeviceStore
|
440
|
+
async createDevice(deviceId, data) {
|
441
|
+
await this.db.executeWithRetry(device.createQB(this.db, deviceId, data));
|
442
|
+
}
|
443
|
+
async readDevice(deviceId) {
|
444
|
+
const row = await device.readQB(this.db, deviceId).executeTakeFirst();
|
445
|
+
return row ? device.rowToDeviceData(row) : null;
|
446
|
+
}
|
447
|
+
async updateDevice(deviceId, data) {
|
448
|
+
await this.db.executeWithRetry(device.updateQB(this.db, deviceId, data));
|
449
|
+
}
|
450
|
+
async deleteDevice(deviceId) {
|
451
|
+
// Will cascade to device_account (device_account_device_id_fk)
|
452
|
+
await this.db.executeWithRetry(device.removeQB(this.db, deviceId));
|
453
|
+
}
|
454
|
+
// TokenStore
|
455
|
+
async createToken(id, data, refreshToken) {
|
456
|
+
await this.db.transaction(async (dbTxn) => {
|
457
|
+
if (refreshToken) {
|
458
|
+
const { count } = await usedRefreshToken
|
459
|
+
.countQB(dbTxn, refreshToken)
|
460
|
+
.executeTakeFirstOrThrow();
|
461
|
+
if (count > 0) {
|
462
|
+
throw new Error('Refresh token already in use');
|
463
|
+
}
|
464
|
+
}
|
465
|
+
return token.createQB(dbTxn, id, data, refreshToken).execute();
|
466
|
+
});
|
467
|
+
}
|
468
|
+
async readToken(tokenId) {
|
469
|
+
const row = await token.findByQB(this.db, { tokenId }).executeTakeFirst();
|
470
|
+
return row ? token.toTokenInfo(row, this.serviceDid) : null;
|
471
|
+
}
|
472
|
+
async deleteToken(tokenId) {
|
473
|
+
// Will cascade to used_refresh_token (used_refresh_token_fk)
|
474
|
+
await this.db.executeWithRetry(token.removeQB(this.db, tokenId));
|
475
|
+
}
|
476
|
+
async rotateToken(tokenId, newTokenId, newRefreshToken, newData) {
|
477
|
+
const err = await this.db.transaction(async (dbTxn) => {
|
478
|
+
const { id, currentRefreshToken } = await token
|
479
|
+
.forRotateQB(dbTxn, tokenId)
|
480
|
+
.executeTakeFirstOrThrow();
|
481
|
+
if (currentRefreshToken) {
|
482
|
+
await usedRefreshToken
|
483
|
+
.insertQB(dbTxn, id, currentRefreshToken)
|
484
|
+
.execute();
|
485
|
+
}
|
486
|
+
const { count } = await usedRefreshToken
|
487
|
+
.countQB(dbTxn, newRefreshToken)
|
488
|
+
.executeTakeFirstOrThrow();
|
489
|
+
if (count > 0) {
|
490
|
+
// Do NOT throw (we don't want the transaction to be rolled back)
|
491
|
+
return new Error('New refresh token already in use');
|
492
|
+
}
|
493
|
+
await token
|
494
|
+
.rotateQB(dbTxn, id, newTokenId, newRefreshToken, newData)
|
495
|
+
.execute();
|
496
|
+
});
|
497
|
+
if (err)
|
498
|
+
throw err;
|
499
|
+
}
|
500
|
+
async findTokenByRefreshToken(refreshToken) {
|
501
|
+
const used = await usedRefreshToken
|
502
|
+
.findByTokenQB(this.db, refreshToken)
|
503
|
+
.executeTakeFirst();
|
504
|
+
const search = used
|
505
|
+
? { id: used.tokenId }
|
506
|
+
: { currentRefreshToken: refreshToken };
|
507
|
+
const row = await token.findByQB(this.db, search).executeTakeFirst();
|
508
|
+
return row ? token.toTokenInfo(row, this.serviceDid) : null;
|
509
|
+
}
|
510
|
+
async findTokenByCode(code) {
|
511
|
+
const row = await token.findByQB(this.db, { code }).executeTakeFirst();
|
512
|
+
return row ? token.toTokenInfo(row, this.serviceDid) : null;
|
513
|
+
}
|
313
514
|
}
|
314
515
|
exports.AccountManager = AccountManager;
|
315
516
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/account-manager/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACA,4CAAsC;AAEtC,6BAAuE;AACvE,yDAA0C;AAC1C,2DAA4C;AAC5C,+CAAiD;AAEjD,qDAAsC;AACtC,qDAAsC;AACtC,yDAA0C;AAC1C,6DAA8C;AAC9C,kEAAmD;AACnD,oDAA4C;AAG5C,6CAAiD;AAAxC,wGAAA,aAAa,OAAA;AAEtB,MAAa,cAAc;IAGzB,YACE,UAAkB,EACV,MAAiB,EACjB,UAAkB,EAC1B,wBAAwB,GAAG,KAAK;QAFhC;;;;mBAAQ,MAAM;WAAW;QACzB;;;;mBAAQ,UAAU;WAAQ;QAL5B;;;;;WAAa;QAQX,IAAI,CAAC,EAAE,GAAG,IAAA,UAAK,EAAC,UAAU,EAAE,wBAAwB,CAAC,CAAA;IACvD,CAAC;IAED,KAAK,CAAC,cAAc;QAClB,MAAM,IAAI,CAAC,EAAE,CAAC,SAAS,EAAE,CAAA;QACzB,MAAM,IAAA,gBAAW,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,sBAAsB,EAAE,CAAA;IACrD,CAAC;IAED,KAAK;QACH,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,CAAA;IACjB,CAAC;IAED,UAAU;IACV,aAAa;IAEb,KAAK,CAAC,UAAU,CACd,WAAmB,EACnB,KAAiC;QAEjC,OAAO,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,EAAE,WAAW,EAAE,KAAK,CAAC,CAAA;IACxD,CAAC;IAED,KAAK,CAAC,iBAAiB,CACrB,KAAa,EACb,KAAiC;QAEjC,OAAO,OAAO,CAAC,iBAAiB,CAAC,IAAI,CAAC,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,CAAA;IACzD,CAAC;IAED,KAAK,CAAC,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K,SAAS,IAAI,QAAQ,CAAC,UAAU,CAAC,GAAG,SAAS,GAAG,CAAC,CAAA;AACvE,CAAC,CAAA;AAFY,QAAA,kBAAkB,sBAE9B"}
|
@@ -11,7 +11,7 @@ export declare const getDidDoc: (ctx: AppContext, did: string) => Promise<{
|
|
11
11
|
service?: {
|
12
12
|
id: string;
|
13
13
|
type: string;
|
14
|
-
serviceEndpoint:
|
14
|
+
serviceEndpoint: string | Record<string, unknown>;
|
15
15
|
}[] | undefined;
|
16
16
|
}>;
|
17
17
|
//# sourceMappingURL=resolver.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"createSession.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/server/createSession.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"createSession.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/server/createSession.ts"],"names":[],"mappings":"AAIA,OAAO,UAAU,MAAM,qBAAqB,CAAA;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAI5C,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QAiDvD"}
|
@@ -2,10 +2,9 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
const common_1 = require("@atproto/common");
|
4
4
|
const syntax_1 = require("@atproto/syntax");
|
5
|
-
const
|
6
|
-
const util_1 = require("../../../../db/util");
|
7
|
-
const util_2 = require("./util");
|
5
|
+
const account_manager_1 = require("../../../../account-manager");
|
8
6
|
const proxy_1 = require("../../../proxy");
|
7
|
+
const util_1 = require("./util");
|
9
8
|
function default_1(server, ctx) {
|
10
9
|
server.com.atproto.server.createSession({
|
11
10
|
rateLimit: [
|
@@ -24,35 +23,12 @@ function default_1(server, ctx) {
|
|
24
23
|
if (ctx.entrywayAgent) {
|
25
24
|
return (0, proxy_1.resultPassthru)(await ctx.entrywayAgent.com.atproto.server.createSession(input.body, (0, proxy_1.authPassthru)(req, true)));
|
26
25
|
}
|
27
|
-
const {
|
28
|
-
const identifier = input.body.identifier.toLowerCase();
|
29
|
-
const user = identifier.includes('@')
|
30
|
-
? await ctx.accountManager.getAccountByEmail(identifier, {
|
31
|
-
includeDeactivated: true,
|
32
|
-
includeTakenDown: true,
|
33
|
-
})
|
34
|
-
: await ctx.accountManager.getAccount(identifier, {
|
35
|
-
includeDeactivated: true,
|
36
|
-
includeTakenDown: true,
|
37
|
-
});
|
38
|
-
if (!user) {
|
39
|
-
throw new xrpc_server_1.AuthRequiredError('Invalid identifier or password');
|
40
|
-
}
|
41
|
-
let appPassword = null;
|
42
|
-
const validAccountPass = await ctx.accountManager.verifyAccountPassword(user.did, password);
|
43
|
-
if (!validAccountPass) {
|
44
|
-
appPassword = await ctx.accountManager.verifyAppPassword(user.did, password);
|
45
|
-
if (appPassword === null) {
|
46
|
-
throw new xrpc_server_1.AuthRequiredError('Invalid identifier or password');
|
47
|
-
}
|
48
|
-
}
|
49
|
-
if ((0, util_1.softDeleted)(user)) {
|
50
|
-
throw new xrpc_server_1.AuthRequiredError('Account has been taken down', 'AccountTakedown');
|
51
|
-
}
|
26
|
+
const { user, appPassword } = await ctx.accountManager.login(input.body);
|
52
27
|
const [{ accessJwt, refreshJwt }, didDoc] = await Promise.all([
|
53
28
|
ctx.accountManager.createSession(user.did, appPassword),
|
54
|
-
(0,
|
29
|
+
(0, util_1.didDocForSession)(ctx, user.did),
|
55
30
|
]);
|
31
|
+
const { status, active } = (0, account_manager_1.formatAccountStatus)(user);
|
56
32
|
return {
|
57
33
|
encoding: 'application/json',
|
58
34
|
body: {
|
@@ -63,8 +39,8 @@ function default_1(server, ctx) {
|
|
63
39
|
emailConfirmed: !!user.emailConfirmedAt,
|
64
40
|
accessJwt,
|
65
41
|
refreshJwt,
|
66
|
-
active
|
67
|
-
status
|
42
|
+
active,
|
43
|
+
status,
|
68
44
|
},
|
69
45
|
};
|
70
46
|
},
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"createSession.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/server/createSession.ts"],"names":[],"mappings":";;AAAA,4CAA6C;AAC7C,4CAAgD;
|
1
|
+
{"version":3,"file":"createSession.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/server/createSession.ts"],"names":[],"mappings":";;AAAA,4CAA6C;AAC7C,4CAAgD;AAEhD,iEAAiE;AAGjE,0CAA6D;AAC7D,iCAAyC;AAEzC,mBAAyB,MAAc,EAAE,GAAe;IACtD,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,aAAa,CAAC;QACtC,SAAS,EAAE;YACT;gBACE,UAAU,EAAE,YAAG;gBACf,MAAM,EAAE,GAAG;gBACX,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,UAAU,IAAI,GAAG,CAAC,EAAE,EAAE;aAClE;YACD;gBACE,UAAU,EAAE,CAAC,GAAG,eAAM;gBACtB,MAAM,EAAE,EAAE;gBACV,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,UAAU,IAAI,GAAG,CAAC,EAAE,EAAE;aAClE;SACF;QACD,OAAO,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE,EAAE;YAChC,IAAI,GAAG,CAAC,aAAa,EAAE,CAAC;gBACtB,OAAO,IAAA,sBAAc,EACnB,MAAM,GAAG,CAAC,aAAa,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,aAAa,CACtD,KAAK,CAAC,IAAI,EACV,IAAA,oBAAY,EAAC,GAAG,EAAE,IAAI,CAAC,CACxB,CACF,CAAA;YACH,CAAC;YAED,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,GAAG,MAAM,GAAG,CAAC,cAAc,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;YAExE,MAAM,CAAC,EAAE,SAAS,EAAE,UAAU,EAAE,EAAE,MAAM,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;gBAC5D,GAAG,CAAC,cAAc,CAAC,aAAa,CAAC,IAAI,CAAC,GAAG,EAAE,WAAW,CAAC;gBACvD,IAAA,uBAAgB,EAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC;aAChC,CAAC,CAAA;YAEF,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,IAAA,qCAAmB,EAAC,IAAI,CAAC,CAAA;YAEpD,OAAO;gBACL,QAAQ,EAAE,kBAAkB;gBAC5B,IAAI,EAAE;oBACJ,GAAG,EAAE,IAAI,CAAC,GAAG;oBACb,MAAM;oBACN,MAAM,EAAE,IAAI,CAAC,MAAM,IAAI,uBAAc;oBACrC,KAAK,EAAE,IAAI,CAAC,KAAK,IAAI,SAAS;oBAC9B,cAAc,EAAE,CAAC,CAAC,IAAI,CAAC,gBAAgB;oBACvC,SAAS;oBACT,UAAU;oBACV,MAAM;oBACN,MAAM;iBACP;aACF,CAAA;QACH,CAAC;KACF,CAAC,CAAA;AACJ,CAAC;AAjDD,4BAiDC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"deleteSession.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/server/deleteSession.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"deleteSession.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/server/deleteSession.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,qBAAqB,CAAA;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAG5C,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QAiBvD"}
|