@atproto/pds 0.4.49 → 0.4.51
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +20 -0
- package/dist/api/com/atproto/server/activateAccount.js +1 -1
- package/dist/api/com/atproto/server/activateAccount.js.map +1 -1
- package/dist/api/com/atproto/server/deleteSession.js +1 -1
- package/dist/api/com/atproto/server/deleteSession.js.map +1 -1
- package/dist/api/com/atproto/server/getServiceAuth.d.ts.map +1 -1
- package/dist/api/com/atproto/server/getServiceAuth.js +16 -6
- package/dist/api/com/atproto/server/getServiceAuth.js.map +1 -1
- package/dist/auth-verifier.d.ts +4 -7
- package/dist/auth-verifier.d.ts.map +1 -1
- package/dist/auth-verifier.js +11 -7
- package/dist/auth-verifier.js.map +1 -1
- package/dist/pipethrough.d.ts.map +1 -1
- package/dist/pipethrough.js +3 -4
- package/dist/pipethrough.js.map +1 -1
- package/package.json +4 -4
- package/src/api/com/atproto/server/activateAccount.ts +1 -1
- package/src/api/com/atproto/server/deleteSession.ts +1 -1
- package/src/api/com/atproto/server/getServiceAuth.ts +23 -7
- package/src/auth-verifier.ts +22 -18
- package/src/pipethrough.ts +3 -3
- package/tests/account-migration.test.ts +2 -0
- package/tests/app-passwords.test.ts +20 -3
- package/tests/moderator-auth.test.ts +14 -7
- package/tests/proxied/notif.test.ts +1 -1
- package/tests/proxied/proxy-header.test.ts +1 -1
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,25 @@
|
|
1
1
|
# @atproto/pds
|
2
2
|
|
3
|
+
## 0.4.51
|
4
|
+
|
5
|
+
### Patch Changes
|
6
|
+
|
7
|
+
- [#2725](https://github.com/bluesky-social/atproto/pull/2725) [`f9a2f3ed1`](https://github.com/bluesky-social/atproto/commit/f9a2f3ed172ae1a8dc1cca0e893e13eac2e4955d) Thanks [@devinivy](https://github.com/devinivy)! - Fix calls from pds containing content-type but no body
|
8
|
+
|
9
|
+
- Updated dependencies [[`35a126429`](https://github.com/bluesky-social/atproto/commit/35a1264297bc22acaa6e5ed3f4aed8c351be8bbb), [`35a126429`](https://github.com/bluesky-social/atproto/commit/35a1264297bc22acaa6e5ed3f4aed8c351be8bbb), [`35a126429`](https://github.com/bluesky-social/atproto/commit/35a1264297bc22acaa6e5ed3f4aed8c351be8bbb), [`5131b027f`](https://github.com/bluesky-social/atproto/commit/5131b027f019cf9f8ec47605648063ae1857f1e3), [`3ebcd4e61`](https://github.com/bluesky-social/atproto/commit/3ebcd4e6161291d3649d7f8a9c5ee4ac26d590a2)]:
|
10
|
+
- @atproto/oauth-provider@0.1.3
|
11
|
+
|
12
|
+
## 0.4.50
|
13
|
+
|
14
|
+
### Patch Changes
|
15
|
+
|
16
|
+
- [#2711](https://github.com/bluesky-social/atproto/pull/2711) [`acbacbbd5`](https://github.com/bluesky-social/atproto/commit/acbacbbd5621473b14ee7a6a3132f675806d23b1) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Properly authenticate OAuth requests in catch all handler.
|
17
|
+
|
18
|
+
- [#2663](https://github.com/bluesky-social/atproto/pull/2663) [`50c0ec176`](https://github.com/bluesky-social/atproto/commit/50c0ec176c223c90e7c86e1e0c059455fecfa9ae) Thanks [@dholms](https://github.com/dholms)! - Validate lxm claims in service auth
|
19
|
+
|
20
|
+
- Updated dependencies [[`acbacbbd5`](https://github.com/bluesky-social/atproto/commit/acbacbbd5621473b14ee7a6a3132f675806d23b1), [`50c0ec176`](https://github.com/bluesky-social/atproto/commit/50c0ec176c223c90e7c86e1e0c059455fecfa9ae), [`50c0ec176`](https://github.com/bluesky-social/atproto/commit/50c0ec176c223c90e7c86e1e0c059455fecfa9ae)]:
|
21
|
+
- @atproto/xrpc-server@0.6.2
|
22
|
+
|
3
23
|
## 0.4.49
|
4
24
|
|
5
25
|
### Patch Changes
|
@@ -11,7 +11,7 @@ function default_1(server, ctx) {
|
|
11
11
|
handler: async ({ auth, req }) => {
|
12
12
|
// in the case of entryway, the full flow is activateAccount (PDS) -> activateAccount (Entryway) -> updateSubjectStatus(PDS)
|
13
13
|
if (ctx.entrywayAgent) {
|
14
|
-
await ctx.entrywayAgent.com.atproto.server.activateAccount(undefined, (0, proxy_1.authPassthru)(req
|
14
|
+
await ctx.entrywayAgent.com.atproto.server.activateAccount(undefined, (0, proxy_1.authPassthru)(req));
|
15
15
|
return;
|
16
16
|
}
|
17
17
|
const requester = auth.credentials.did;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"activateAccount.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/server/activateAccount.ts"],"names":[],"mappings":";;AAAA,wCAAsC;AACtC,sDAA0D;AAC1D,4CAAgD;AAGhD,iCAAyD;AACzD,0CAA6C;AAE7C,mBAAyB,MAAc,EAAE,GAAe;IACtD,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,eAAe,CAAC;QACxC,IAAI,EAAE,GAAG,CAAC,YAAY,CAAC,UAAU,EAAE;QACnC,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,EAAE;YAC/B,4HAA4H;YAC5H,IAAI,GAAG,CAAC,aAAa,EAAE,CAAC;gBACtB,MAAM,GAAG,CAAC,aAAa,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,eAAe,CACxD,SAAS,EACT,IAAA,oBAAY,EAAC,GAAG,
|
1
|
+
{"version":3,"file":"activateAccount.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/server/activateAccount.ts"],"names":[],"mappings":";;AAAA,wCAAsC;AACtC,sDAA0D;AAC1D,4CAAgD;AAGhD,iCAAyD;AACzD,0CAA6C;AAE7C,mBAAyB,MAAc,EAAE,GAAe;IACtD,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,eAAe,CAAC;QACxC,IAAI,EAAE,GAAG,CAAC,YAAY,CAAC,UAAU,EAAE;QACnC,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,EAAE;YAC/B,4HAA4H;YAC5H,IAAI,GAAG,CAAC,aAAa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C,gBAAgB,CAAC,SAAS,CAAC,CAAA;YACnE,MAAM,GAAG,CAAC,SAAS,CAAC,kBAAkB,CAAC,SAAS,EAAE,MAAM,CAAC,CAAA;YACzD,MAAM,GAAG,CAAC,SAAS,CAAC,oBAAoB,CACtC,SAAS,EACT,OAAO,CAAC,MAAM,IAAI,uBAAc,CACjC,CAAA;YACD,MAAM,GAAG,CAAC,SAAS,CAAC,cAAc,CAAC,SAAS,EAAE,UAAU,EAAE,EAAE,CAAC,CAAA;QAC/D,CAAC;KACF,CAAC,CAAA;AACJ,CAAC;AAjDD,4BAiDC"}
|
@@ -5,7 +5,7 @@ function default_1(server, ctx) {
|
|
5
5
|
const { entrywayAgent } = ctx;
|
6
6
|
if (entrywayAgent) {
|
7
7
|
server.com.atproto.server.deleteSession(async (reqCtx) => {
|
8
|
-
await entrywayAgent.com.atproto.server.deleteSession(undefined, (0, proxy_1.authPassthru)(reqCtx.req
|
8
|
+
await entrywayAgent.com.atproto.server.deleteSession(undefined, (0, proxy_1.authPassthru)(reqCtx.req));
|
9
9
|
});
|
10
10
|
}
|
11
11
|
else {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"deleteSession.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/server/deleteSession.ts"],"names":[],"mappings":";;AAEA,0CAA6C;AAE7C,mBAAyB,MAAc,EAAE,GAAe;IACtD,MAAM,EAAE,aAAa,EAAE,GAAG,GAAG,CAAA;IAC7B,IAAI,aAAa,EAAE,CAAC;QAClB,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE;YACvD,MAAM,aAAa,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,aAAa,CAClD,SAAS,EACT,IAAA,oBAAY,EAAC,MAAM,CAAC,GAAG,
|
1
|
+
{"version":3,"file":"deleteSession.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/server/deleteSession.ts"],"names":[],"mappings":";;AAEA,0CAA6C;AAE7C,mBAAyB,MAAc,EAAE,GAAe;IACtD,MAAM,EAAE,aAAa,EAAE,GAAG,GAAG,CAAA;IAC7B,IAAI,aAAa,EAAE,CAAC;QAClB,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE;YACvD,MAAM,aAAa,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,aAAa,CAClD,SAAS,EACT,IAAA,oBAAY,EAAC,MAAM,CAAC,GAAG,CAAC,CACzB,CAAA;QACH,CAAC,CAAC,CAAA;IACJ,CAAC;SAAM,CAAC;QACN,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,aAAa,CAAC;YACtC,IAAI,EAAE,GAAG,CAAC,YAAY,CAAC,cAAc;YACrC,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;gBAC1B,MAAM,GAAG,CAAC,cAAc,CAAC,kBAAkB,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAA;YACvE,CAAC;SACF,CAAC,CAAA;IACJ,CAAC;AACH,CAAC;AAjBD,4BAiBC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"getServiceAuth.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/server/getServiceAuth.ts"],"names":[],"mappings":"AAEA,OAAO,UAAU,MAAM,qBAAqB,CAAA;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;
|
1
|
+
{"version":3,"file":"getServiceAuth.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/server/getServiceAuth.ts"],"names":[],"mappings":"AAEA,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,QAoDvD"}
|
@@ -2,27 +2,37 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
const xrpc_server_1 = require("@atproto/xrpc-server");
|
4
4
|
const common_1 = require("@atproto/common");
|
5
|
+
const pipethrough_1 = require("../../../../pipethrough");
|
5
6
|
function default_1(server, ctx) {
|
6
7
|
server.com.atproto.server.getServiceAuth({
|
7
|
-
auth: ctx.authVerifier.
|
8
|
+
auth: ctx.authVerifier.accessStandard(),
|
8
9
|
handler: async ({ params, auth }) => {
|
9
10
|
const did = auth.credentials.did;
|
10
|
-
const
|
11
|
+
const { aud, lxm = null } = params;
|
11
12
|
const exp = params.exp ? params.exp * 1000 : undefined;
|
12
13
|
if (exp) {
|
13
14
|
const diff = exp - Date.now();
|
14
15
|
if (diff < 0) {
|
15
16
|
throw new xrpc_server_1.InvalidRequestError('expiration is in past', 'BadExpiration');
|
16
17
|
}
|
17
|
-
else if (diff > common_1.
|
18
|
-
throw new xrpc_server_1.InvalidRequestError('cannot request a token with an expiration more than
|
18
|
+
else if (diff > common_1.HOUR) {
|
19
|
+
throw new xrpc_server_1.InvalidRequestError('cannot request a token with an expiration more than an hour in the future', 'BadExpiration');
|
20
|
+
}
|
21
|
+
else if (!lxm && diff > common_1.MINUTE) {
|
22
|
+
throw new xrpc_server_1.InvalidRequestError('cannot request a method-less token with an expiration more than a minute in the future', 'BadExpiration');
|
19
23
|
}
|
20
24
|
}
|
25
|
+
if (!auth.credentials.isPrivileged &&
|
26
|
+
lxm &&
|
27
|
+
pipethrough_1.PRIVILEGED_METHODS.has(lxm)) {
|
28
|
+
throw new xrpc_server_1.InvalidRequestError(`cannot request a service auth token for the following method with an app password: ${lxm}`);
|
29
|
+
}
|
30
|
+
const keypair = await ctx.actorStore.keypair(did);
|
21
31
|
const token = await (0, xrpc_server_1.createServiceJwt)({
|
22
32
|
iss: did,
|
23
|
-
aud
|
24
|
-
lxm: params.lxm ?? null,
|
33
|
+
aud,
|
25
34
|
exp,
|
35
|
+
lxm,
|
26
36
|
keypair,
|
27
37
|
});
|
28
38
|
return {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"getServiceAuth.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/server/getServiceAuth.ts"],"names":[],"mappings":";;AAAA,sDAA4E;AAC5E,
|
1
|
+
{"version":3,"file":"getServiceAuth.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/server/getServiceAuth.ts"],"names":[],"mappings":";;AAAA,sDAA4E;AAC5E,4CAA8C;AAG9C,yDAA4D;AAE5D,mBAAyB,MAAc,EAAE,GAAe;IACtD,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,cAAc,CAAC;QACvC,IAAI,EAAE,GAAG,CAAC,YAAY,CAAC,cAAc,EAAE;QACvC,OAAO,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE;YAClC,MAAM,GAAG,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,CAAA;YAChC,MAAM,EAAE,GAAG,EAAE,GAAG,GAAG,IAAI,EAAE,GAAG,MAAM,CAAA;YAClC,MAAM,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,SAAS,CAAA;YACtD,IAAI,GAAG,EAAE,CAAC;gBACR,MAAM,IAAI,GAAG,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAA;gBAC7B,IAAI,IAAI,GAAG,CAAC,EAAE,CAAC;oBACb,MAAM,IAAI,iCAAmB,CAC3B,uBAAuB,EACvB,eAAe,CAChB,CAAA;gBACH,CAAC;qBAAM,IAAI,IAAI,GAAG,aAAI,EAAE,CAAC;oBACvB,MAAM,IAAI,iCAAmB,CAC3B,2EAA2E,EAC3E,eAAe,CAChB,CAAA;gBACH,CAAC;qBAAM,IAAI,CAAC,GAAG,IAAI,IAAI,GAAG,eAAM,EAAE,CAAC;oBACjC,MAAM,IAAI,iCAAmB,CAC3B,wFAAwF,EACxF,eAAe,CAChB,CAAA;gBACH,CAAC;YACH,CAAC;YACD,IACE,CAAC,IAAI,CAAC,WAAW,CAAC,YAAY;gBAC9B,GAAG;gBACH,gCAAkB,CAAC,GAAG,CAAC,GAAG,CAAC,EAC3B,CAAC;gBACD,MAAM,IAAI,iCAAmB,CAC3B,sFAAsF,GAAG,EAAE,CAC5F,CAAA;YACH,CAAC;YACD,MAAM,OAAO,GAAG,MAAM,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;YAEjD,MAAM,KAAK,GAAG,MAAM,IAAA,8BAAgB,EAAC;gBACnC,GAAG,EAAE,GAAG;gBACR,GAAG;gBACH,GAAG;gBACH,GAAG;gBACH,OAAO;aACR,CAAC,CAAA;YACF,OAAO;gBACL,QAAQ,EAAE,kBAAkB;gBAC5B,IAAI,EAAE;oBACJ,KAAK;iBACN;aACF,CAAA;QACH,CAAC;KACF,CAAC,CAAA;AACJ,CAAC;AApDD,4BAoDC"}
|
package/dist/auth-verifier.d.ts
CHANGED
@@ -1,14 +1,11 @@
|
|
1
1
|
/// <reference types="node" />
|
2
2
|
import { KeyObject } from 'node:crypto';
|
3
|
-
import { OAuthVerifier } from '@atproto/oauth-provider';
|
4
3
|
import { IdResolver } from '@atproto/identity';
|
5
|
-
import
|
4
|
+
import { OAuthVerifier } from '@atproto/oauth-provider';
|
5
|
+
import { AuthVerifierContext, StreamAuthVerifierContext } from '@atproto/xrpc-server';
|
6
6
|
import * as jose from 'jose';
|
7
7
|
import { AccountManager } from './account-manager';
|
8
|
-
type ReqCtx =
|
9
|
-
req: express.Request;
|
10
|
-
res?: express.Response;
|
11
|
-
};
|
8
|
+
type ReqCtx = AuthVerifierContext | StreamAuthVerifierContext;
|
12
9
|
export declare enum AuthScope {
|
13
10
|
Access = "com.atproto.access",
|
14
11
|
Refresh = "com.atproto.refresh",
|
@@ -128,7 +125,7 @@ export declare class AuthVerifier {
|
|
128
125
|
protected null(ctx: ReqCtx): NullOutput;
|
129
126
|
isUserOrAdmin(auth: AccessOutput | AdminTokenOutput | NullOutput, did: string): boolean;
|
130
127
|
protected jwtVerify(token: string, verifyOptions?: jose.JWTVerifyOptions): Promise<jose.JWTVerifyResult<jose.JWTPayload>>;
|
131
|
-
protected setAuthHeaders(
|
128
|
+
protected setAuthHeaders(ctx: ReqCtx): void;
|
132
129
|
}
|
133
130
|
declare enum AuthType {
|
134
131
|
BASIC = "Basic",
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"auth-verifier.d.ts","sourceRoot":"","sources":["../src/auth-verifier.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAoC,MAAM,aAAa,CAAA;
|
1
|
+
{"version":3,"file":"auth-verifier.d.ts","sourceRoot":"","sources":["../src/auth-verifier.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAoC,MAAM,aAAa,CAAA;AAIzE,OAAO,EAAE,UAAU,EAA0B,MAAM,mBAAmB,CAAA;AACtE,OAAO,EAEL,aAAa,EAEd,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAEL,mBAAmB,EAGnB,yBAAyB,EAI1B,MAAM,sBAAsB,CAAA;AAC7B,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAE5B,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAGlD,KAAK,MAAM,GAAG,mBAAmB,GAAG,yBAAyB,CAAA;AAG7D,oBAAY,SAAS;IACnB,MAAM,uBAAuB;IAC7B,OAAO,wBAAwB;IAC/B,OAAO,wBAAwB;IAC/B,iBAAiB,kCAAkC;IACnD,YAAY,6BAA6B;CAC1C;AAED,MAAM,MAAM,UAAU,GAAG;IACvB,UAAU,EAAE,SAAS,EAAE,CAAA;IACvB,aAAa,EAAE,OAAO,CAAA;IACtB,gBAAgB,EAAE,OAAO,CAAA;CAC1B,CAAA;AAED,oBAAY,UAAU;IACpB,KAAK,IAAA;IACL,OAAO,I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;KAAE;;;;IA2CpD,SAAS,CAAC,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU;IAOvC,aAAa,CACX,IAAI,EAAE,YAAY,GAAG,gBAAgB,GAAG,UAAU,EAClD,GAAG,EAAE,MAAM,GACV,OAAO;cAUM,SAAS,CACvB,KAAK,EAAE,MAAM,EACb,aAAa,CAAC,EAAE,IAAI,CAAC,gBAAgB;IAevC,SAAS,CAAC,cAAc,CAAC,GAAG,EAAE,MAAM;CAOrC;AAKD,aAAK,QAAQ;IACX,KAAK,UAAU;IACf,MAAM,WAAW;IACjB,IAAI,SAAS;CACd;AAED,eAAO,MAAM,wBAAwB,mBACnB,MAAM,KACrB,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,CAqB/C,CAAA;AAsBD,eAAO,MAAM,cAAc,yBACH,MAAM,KAC3B;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GAAG,IAc3C,CAAA;AAOD,eAAO,MAAM,qBAAqB,WAAY,MAAM,KAAG,SAEtD,CAAA;AAED,eAAO,MAAM,qBAAqB,iBAAkB,MAAM,KAAG,SAG5D,CAAA"}
|
package/dist/auth-verifier.js
CHANGED
@@ -28,13 +28,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
29
29
|
exports.createPublicKeyObject = exports.createSecretKeyObject = exports.parseBasicAuth = exports.parseAuthorizationHeader = exports.AuthVerifier = exports.RoleStatus = exports.AuthScope = void 0;
|
30
30
|
const node_crypto_1 = require("node:crypto");
|
31
|
+
const common_1 = require("@atproto/common");
|
32
|
+
const identity_1 = require("@atproto/identity");
|
31
33
|
const oauth_provider_1 = require("@atproto/oauth-provider");
|
32
34
|
const xrpc_server_1 = require("@atproto/xrpc-server");
|
33
|
-
const identity_1 = require("@atproto/identity");
|
34
35
|
const jose = __importStar(require("jose"));
|
35
36
|
const key_encoder_1 = __importDefault(require("key-encoder"));
|
36
37
|
const db_1 = require("./db");
|
37
|
-
const common_1 = require("@atproto/common");
|
38
38
|
// @TODO sync-up with current method names, consider backwards compat.
|
39
39
|
var AuthScope;
|
40
40
|
(function (AuthScope) {
|
@@ -383,7 +383,8 @@ class AuthVerifier {
|
|
383
383
|
throw new xrpc_server_1.InvalidRequestError('DPoP access token cannot be used for this request', 'InvalidToken');
|
384
384
|
}
|
385
385
|
this.setAuthHeaders(ctx);
|
386
|
-
const { req
|
386
|
+
const { req } = ctx;
|
387
|
+
const res = 'res' in ctx ? ctx.res : null;
|
387
388
|
// https://datatracker.ietf.org/doc/html/rfc9449#section-8.2
|
388
389
|
if (res) {
|
389
390
|
const dpopNonce = this.oauthVerifier.nextDpopNonce();
|
@@ -393,8 +394,9 @@ class AuthVerifier {
|
|
393
394
|
}
|
394
395
|
}
|
395
396
|
try {
|
396
|
-
const
|
397
|
-
const
|
397
|
+
const originalUrl = ('originalUrl' in req && req.originalUrl) || req.url || '/';
|
398
|
+
const url = new URL(originalUrl, this._publicUrl);
|
399
|
+
const result = await this.oauthVerifier.authenticateRequest(req.method || 'GET', url, req.headers, { audience: [this.dids.pds] });
|
398
400
|
const { sub } = result.claims;
|
399
401
|
if (typeof sub !== 'string' || !sub.startsWith('did:')) {
|
400
402
|
throw new xrpc_server_1.InvalidRequestError('Malformed token', 'InvalidToken');
|
@@ -466,7 +468,8 @@ class AuthVerifier {
|
|
466
468
|
if (!jwtStr) {
|
467
469
|
throw new xrpc_server_1.AuthRequiredError('missing jwt', 'MissingJwt');
|
468
470
|
}
|
469
|
-
const
|
471
|
+
const nsid = (0, xrpc_server_1.parseReqNsid)(ctx.req);
|
472
|
+
const payload = await (0, xrpc_server_1.verifyJwt)(jwtStr, opts.aud, nsid, getSigningKey);
|
470
473
|
return { iss: payload.iss, aud: payload.aud };
|
471
474
|
}
|
472
475
|
null(ctx) {
|
@@ -497,7 +500,8 @@ class AuthVerifier {
|
|
497
500
|
throw new xrpc_server_1.InvalidRequestError('Token could not be verified', 'InvalidToken');
|
498
501
|
}
|
499
502
|
}
|
500
|
-
setAuthHeaders(
|
503
|
+
setAuthHeaders(ctx) {
|
504
|
+
const res = 'res' in ctx ? ctx.res : null;
|
501
505
|
if (res) {
|
502
506
|
res.setHeader('Cache-Control', 'private');
|
503
507
|
vary(res, 'Authorization');
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"auth-verifier.js","sourceRoot":"","sources":["../src/auth-verifier.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAAyE;AAEzE,4DAIgC;AAChC,sDAM6B;AAC7B,gDAAsE;AAEtE,2CAA4B;AAC5B,8DAAoC;AAEpC,6BAAkC;AAClC,4CAAyD;AAQzD,sEAAsE;AACtE,IAAY,SAMX;AAND,WAAY,SAAS;IACnB,0CAA6B,CAAA;IAC7B,4CAA+B,CAAA;IAC/B,4CAA+B,CAAA;IAC/B,gEAAmD,CAAA;IACnD,sDAAyC,CAAA;AAC3C,CAAC,EANW,SAAS,yBAAT,SAAS,QAMpB;AAQD,IAAY,UAIX;AAJD,WAAY,UAAU;IACpB,6CAAK,CAAA;IACL,iDAAO,CAAA;IACP,iDAAO,CAAA;AACT,CAAC,EAJW,UAAU,0BAAV,UAAU,QAIrB;AAyED,MAAa,YAAY;IAMvB,YACS,cAA8B,EAC9B,UAAsB,EACtB,aAA4B,EACnC,IAAsB;QAHtB;;;;mBAAO,cAAc;WAAgB;QACrC;;;;mBAAO,UAAU;WAAY;QAC7B;;;;mBAAO,aAAa;WAAe;QAR7B;;;;;WAAkB;QAClB;;;;;WAAkB;QAClB;;;;;WAAkB;QACnB;;;;;WAA8B;QAcrC,0CAA0C;QAE1C;;;;mBACE,CAAC,OAA4B,EAAE,EAAE,EAAE,CACnC,CAAC,GAAW,EAAyB,EAAE;gBACrC,OAAO,IAAI,CAAC,mBAAmB,CAC7B,GAAG,EACH;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OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;QACnD,GAAG,CAAC,SAAS,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;IAC9B,CAAC;SAAM,CAAC;QACN,MAAM,eAAe,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC;YAC5C,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;YAChD,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;QAC3B,IAAI,CAAC,eAAe,EAAE,CAAC;YACrB,GAAG,CAAC,YAAY,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;QACjC,CAAC;IACH,CAAC;AACH,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"pipethrough.d.ts","sourceRoot":"","sources":["../src/pipethrough.ts"],"names":[],"mappings":";;AAAA,OAAO,OAAO,MAAM,SAAS,CAAA;AAK7B,OAAO,EAAE,QAAQ,EAA2B,MAAM,kBAAkB,CAAA;AACpE,OAAO,EACL,eAAe,EACf,kBAAkB,
|
1
|
+
{"version":3,"file":"pipethrough.d.ts","sourceRoot":"","sources":["../src/pipethrough.ts"],"names":[],"mappings":";;AAAA,OAAO,OAAO,MAAM,SAAS,CAAA;AAK7B,OAAO,EAAE,QAAQ,EAA2B,MAAM,kBAAkB,CAAA;AACpE,OAAO,EACL,eAAe,EACf,kBAAkB,EAGnB,MAAM,sBAAsB,CAAA;AAK7B,OAAO,UAAU,MAAM,WAAW,CAAA;AAElC,eAAO,MAAM,YAAY,QAAS,UAAU,KAAG,eAwB9C,CAAA;AAED,eAAO,MAAM,WAAW,QACjB,UAAU,OACV,eAAe,aACT,MAAM,GAAG,IAAI,aACd;IACR,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,GAAG,CAAC,EAAE,MAAM,CAAA;CACb,KACA,QAAQ,kBAAkB,CAO5B,CAAA;AAED,eAAO,MAAM,oBAAoB,QAC1B,UAAU,OACV,eAAe,aACT,MAAM,GAAG,IAAI,SACjB,QAAQ,KACd,QAAQ,kBAAkB,CAS5B,CAAA;AAYD,eAAO,MAAM,eAAe,QACrB,UAAU,OACV,eAAe,gBACN,MAAM,KACnB,QAAQ;IAAE,GAAG,EAAE,GAAG,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAcjD,CAAA;AAED,eAAO,MAAM,aAAa,QACnB,UAAU,OACV,eAAe,QACd;IACJ,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,EAAE,MAAM,CAAA;IACX,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;CACzB,KACA,QAAQ;IAAE,aAAa,CAAC,EAAE,MAAM,CAAA;CAAE,CAapC,CAAA;AA6BD,eAAO,MAAM,gBAAgB,QACtB,UAAU,OACV,eAAe,KACnB,QAAQ;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAgBzD,CAAA;AAKD,eAAO,MAAM,WAAW,QACjB,GAAG,WACC,WAAW,KACnB,QAAQ,QAAQ,CAoBlB,CAAA;AAYD,eAAO,MAAM,YAAY,gBACV,QAAQ,UACb,gBAAgB,kBAwBzB,CAAA;AAED,eAAO,MAAM,aAAa,QAAe,QAAQ;;;;EAWhD,CAAA;AAKD,eAAO,MAAM,kBAAkB,aAgB7B,CAAA;AA8BF,eAAO,MAAM,QAAQ,YAAa,MAAM,OAAO,kBAAkB,KAAG,CAKnE,CAAA"}
|
package/dist/pipethrough.js
CHANGED
@@ -33,16 +33,15 @@ const node_stream_1 = __importDefault(require("node:stream"));
|
|
33
33
|
const lexicon_1 = require("@atproto/lexicon");
|
34
34
|
const xrpc_server_1 = require("@atproto/xrpc-server");
|
35
35
|
const xrpc_1 = require("@atproto/xrpc");
|
36
|
+
const common_1 = require("@atproto/common");
|
36
37
|
const lexicons_1 = require("./lexicon/lexicons");
|
37
38
|
const logger_1 = require("./logger");
|
38
|
-
const common_1 = require("@atproto/common");
|
39
|
-
const xrpc_server_2 = require("@atproto/xrpc-server");
|
40
39
|
const proxyHandler = (ctx) => {
|
41
40
|
const accessStandard = ctx.authVerifier.accessStandard();
|
42
41
|
return async (req, res, next) => {
|
43
42
|
try {
|
44
43
|
const { url, aud, nsid } = await (0, exports.formatUrlAndAud)(ctx, req);
|
45
|
-
const auth = await accessStandard({ req });
|
44
|
+
const auth = await accessStandard({ req, res });
|
46
45
|
if (!auth.credentials.isPrivileged && exports.PRIVILEGED_METHODS.has(nsid)) {
|
47
46
|
throw new xrpc_server_1.InvalidRequestError('Bad token method', 'InvalidToken');
|
48
47
|
}
|
@@ -93,7 +92,7 @@ const REQ_HEADERS_TO_FORWARD = [
|
|
93
92
|
];
|
94
93
|
const formatUrlAndAud = async (ctx, req, audOverride) => {
|
95
94
|
const proxyTo = await (0, exports.parseProxyHeader)(ctx, req);
|
96
|
-
const nsid = (0,
|
95
|
+
const nsid = (0, xrpc_server_1.parseReqNsid)(req);
|
97
96
|
const defaultProxy = defaultService(ctx, nsid);
|
98
97
|
const serviceUrl = proxyTo?.serviceUrl ?? defaultProxy?.url;
|
99
98
|
const aud = audOverride ?? proxyTo?.did ?? defaultProxy?.did;
|
package/dist/pipethrough.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"pipethrough.js","sourceRoot":"","sources":["../src/pipethrough.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,iDAAkC;AAClC,wDAA0B;AAC1B,8DAAgC;AAEhC,8CAAoE;AACpE,sDAI6B;AAC7B,wCAAuD;AACvD,iDAAkD;AAClD,qCAAqC;AACrC,4CAAqE;AAErE,sDAAmD;AAE5C,MAAM,YAAY,GAAG,CAAC,GAAe,EAAmB,EAAE;IAC/D,MAAM,cAAc,GAAG,GAAG,CAAC,YAAY,CAAC,cAAc,EAAE,CAAA;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ACH,CAAC,CAAA;AAED,MAAM,aAAa,GAAG,CAAC,OAAgB,EAA0B,EAAE;IACjE,MAAM,MAAM,GAAG,EAAE,CAAA;IACjB,KAAK,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,IAAI,OAAO,EAAE,CAAC;QACjC,MAAM,CAAC,GAAG,CAAC,GAAG,GAAG,CAAA;IACnB,CAAC;IACD,OAAO,MAAM,CAAA;AACf,CAAC,CAAA"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@atproto/pds",
|
3
|
-
"version": "0.4.
|
3
|
+
"version": "0.4.51",
|
4
4
|
"license": "MIT",
|
5
5
|
"description": "Reference implementation of atproto Personal Data Server (PDS)",
|
6
6
|
"keywords": [
|
@@ -50,11 +50,11 @@
|
|
50
50
|
"@atproto/crypto": "^0.4.0",
|
51
51
|
"@atproto/identity": "^0.4.0",
|
52
52
|
"@atproto/lexicon": "^0.4.1",
|
53
|
-
"@atproto/oauth-provider": "^0.1.
|
53
|
+
"@atproto/oauth-provider": "^0.1.3",
|
54
54
|
"@atproto/repo": "^0.4.2",
|
55
55
|
"@atproto/syntax": "^0.3.0",
|
56
56
|
"@atproto/xrpc": "^0.6.0",
|
57
|
-
"@atproto/xrpc-server": "^0.6.
|
57
|
+
"@atproto/xrpc-server": "^0.6.2"
|
58
58
|
},
|
59
59
|
"devDependencies": {
|
60
60
|
"@atproto/pds-entryway": "npm:@atproto/pds@0.3.0-entryway.3",
|
@@ -72,8 +72,8 @@
|
|
72
72
|
"jest": "^28.1.2",
|
73
73
|
"ts-node": "^10.8.2",
|
74
74
|
"ws": "^8.12.0",
|
75
|
+
"@atproto/bsky": "^0.0.76",
|
75
76
|
"@atproto/api": "^0.13.1",
|
76
|
-
"@atproto/bsky": "^0.0.75",
|
77
77
|
"@atproto/lex-cli": "^0.5.0"
|
78
78
|
},
|
79
79
|
"scripts": {
|
@@ -8,7 +8,7 @@ export default function (server: Server, ctx: AppContext) {
|
|
8
8
|
server.com.atproto.server.deleteSession(async (reqCtx) => {
|
9
9
|
await entrywayAgent.com.atproto.server.deleteSession(
|
10
10
|
undefined,
|
11
|
-
authPassthru(reqCtx.req
|
11
|
+
authPassthru(reqCtx.req),
|
12
12
|
)
|
13
13
|
})
|
14
14
|
} else {
|
@@ -1,14 +1,15 @@
|
|
1
1
|
import { InvalidRequestError, createServiceJwt } from '@atproto/xrpc-server'
|
2
|
-
import { MINUTE } from '@atproto/common'
|
2
|
+
import { HOUR, MINUTE } from '@atproto/common'
|
3
3
|
import AppContext from '../../../../context'
|
4
4
|
import { Server } from '../../../../lexicon'
|
5
|
+
import { PRIVILEGED_METHODS } from '../../../../pipethrough'
|
5
6
|
|
6
7
|
export default function (server: Server, ctx: AppContext) {
|
7
8
|
server.com.atproto.server.getServiceAuth({
|
8
|
-
auth: ctx.authVerifier.
|
9
|
+
auth: ctx.authVerifier.accessStandard(),
|
9
10
|
handler: async ({ params, auth }) => {
|
10
11
|
const did = auth.credentials.did
|
11
|
-
const
|
12
|
+
const { aud, lxm = null } = params
|
12
13
|
const exp = params.exp ? params.exp * 1000 : undefined
|
13
14
|
if (exp) {
|
14
15
|
const diff = exp - Date.now()
|
@@ -17,19 +18,34 @@ export default function (server: Server, ctx: AppContext) {
|
|
17
18
|
'expiration is in past',
|
18
19
|
'BadExpiration',
|
19
20
|
)
|
20
|
-
} else if (diff >
|
21
|
+
} else if (diff > HOUR) {
|
22
|
+
throw new InvalidRequestError(
|
23
|
+
'cannot request a token with an expiration more than an hour in the future',
|
24
|
+
'BadExpiration',
|
25
|
+
)
|
26
|
+
} else if (!lxm && diff > MINUTE) {
|
21
27
|
throw new InvalidRequestError(
|
22
|
-
'cannot request a token with an expiration more than a minute in the future',
|
28
|
+
'cannot request a method-less token with an expiration more than a minute in the future',
|
23
29
|
'BadExpiration',
|
24
30
|
)
|
25
31
|
}
|
26
32
|
}
|
33
|
+
if (
|
34
|
+
!auth.credentials.isPrivileged &&
|
35
|
+
lxm &&
|
36
|
+
PRIVILEGED_METHODS.has(lxm)
|
37
|
+
) {
|
38
|
+
throw new InvalidRequestError(
|
39
|
+
`cannot request a service auth token for the following method with an app password: ${lxm}`,
|
40
|
+
)
|
41
|
+
}
|
42
|
+
const keypair = await ctx.actorStore.keypair(did)
|
27
43
|
|
28
44
|
const token = await createServiceJwt({
|
29
45
|
iss: did,
|
30
|
-
aud
|
31
|
-
lxm: params.lxm ?? null,
|
46
|
+
aud,
|
32
47
|
exp,
|
48
|
+
lxm,
|
33
49
|
keypair,
|
34
50
|
})
|
35
51
|
return {
|
package/src/auth-verifier.ts
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
import { KeyObject, createPublicKey, createSecretKey } from 'node:crypto'
|
2
|
+
import { IncomingMessage, ServerResponse } from 'node:http'
|
2
3
|
|
4
|
+
import { getVerificationMaterial } from '@atproto/common'
|
5
|
+
import { IdResolver, getDidKeyFromMultibase } from '@atproto/identity'
|
3
6
|
import {
|
4
7
|
OAuthError,
|
5
8
|
OAuthVerifier,
|
@@ -7,24 +10,20 @@ import {
|
|
7
10
|
} from '@atproto/oauth-provider'
|
8
11
|
import {
|
9
12
|
AuthRequiredError,
|
13
|
+
AuthVerifierContext,
|
10
14
|
ForbiddenError,
|
11
15
|
InvalidRequestError,
|
16
|
+
StreamAuthVerifierContext,
|
12
17
|
XRPCError,
|
18
|
+
parseReqNsid,
|
13
19
|
verifyJwt as verifyServiceJwt,
|
14
20
|
} from '@atproto/xrpc-server'
|
15
|
-
import { IdResolver, getDidKeyFromMultibase } from '@atproto/identity'
|
16
|
-
import express from 'express'
|
17
21
|
import * as jose from 'jose'
|
18
22
|
import KeyEncoder from 'key-encoder'
|
19
23
|
import { AccountManager } from './account-manager'
|
20
24
|
import { softDeleted } from './db'
|
21
|
-
import { getVerificationMaterial } from '@atproto/common'
|
22
25
|
|
23
|
-
type ReqCtx =
|
24
|
-
req: express.Request
|
25
|
-
// StreamAuthVerifier does not have "res"
|
26
|
-
res?: express.Response
|
27
|
-
}
|
26
|
+
type ReqCtx = AuthVerifierContext | StreamAuthVerifierContext
|
28
27
|
|
29
28
|
// @TODO sync-up with current method names, consider backwards compat.
|
30
29
|
export enum AuthScope {
|
@@ -462,7 +461,8 @@ export class AuthVerifier {
|
|
462
461
|
|
463
462
|
this.setAuthHeaders(ctx)
|
464
463
|
|
465
|
-
const { req
|
464
|
+
const { req } = ctx
|
465
|
+
const res = 'res' in ctx ? ctx.res : null
|
466
466
|
|
467
467
|
// https://datatracker.ietf.org/doc/html/rfc9449#section-8.2
|
468
468
|
if (res) {
|
@@ -474,9 +474,11 @@ export class AuthVerifier {
|
|
474
474
|
}
|
475
475
|
|
476
476
|
try {
|
477
|
-
const
|
477
|
+
const originalUrl =
|
478
|
+
('originalUrl' in req && req.originalUrl) || req.url || '/'
|
479
|
+
const url = new URL(originalUrl, this._publicUrl)
|
478
480
|
const result = await this.oauthVerifier.authenticateRequest(
|
479
|
-
req.method,
|
481
|
+
req.method || 'GET',
|
480
482
|
url,
|
481
483
|
req.headers,
|
482
484
|
{ audience: [this.dids.pds] },
|
@@ -573,10 +575,11 @@ export class AuthVerifier {
|
|
573
575
|
if (!jwtStr) {
|
574
576
|
throw new AuthRequiredError('missing jwt', 'MissingJwt')
|
575
577
|
}
|
578
|
+
const nsid = parseReqNsid(ctx.req)
|
576
579
|
const payload = await verifyServiceJwt(
|
577
580
|
jwtStr,
|
578
581
|
opts.aud,
|
579
|
-
|
582
|
+
nsid,
|
580
583
|
getSigningKey,
|
581
584
|
)
|
582
585
|
return { iss: payload.iss, aud: payload.aud }
|
@@ -619,7 +622,8 @@ export class AuthVerifier {
|
|
619
622
|
}
|
620
623
|
}
|
621
624
|
|
622
|
-
protected setAuthHeaders(
|
625
|
+
protected setAuthHeaders(ctx: ReqCtx) {
|
626
|
+
const res = 'res' in ctx ? ctx.res : null
|
623
627
|
if (res) {
|
624
628
|
res.setHeader('Cache-Control', 'private')
|
625
629
|
vary(res, 'Authorization')
|
@@ -661,22 +665,22 @@ export const parseAuthorizationHeader = (
|
|
661
665
|
)
|
662
666
|
}
|
663
667
|
|
664
|
-
const isAccessToken = (req:
|
668
|
+
const isAccessToken = (req: IncomingMessage): boolean => {
|
665
669
|
const [type] = parseAuthorizationHeader(req.headers.authorization)
|
666
670
|
return type === AuthType.BEARER || type === AuthType.DPOP
|
667
671
|
}
|
668
672
|
|
669
|
-
const isBearerToken = (req:
|
673
|
+
const isBearerToken = (req: IncomingMessage): boolean => {
|
670
674
|
const [type] = parseAuthorizationHeader(req.headers.authorization)
|
671
675
|
return type === AuthType.BEARER
|
672
676
|
}
|
673
677
|
|
674
|
-
const isBasicToken = (req:
|
678
|
+
const isBasicToken = (req: IncomingMessage): boolean => {
|
675
679
|
const [type] = parseAuthorizationHeader(req.headers.authorization)
|
676
680
|
return type === AuthType.BASIC
|
677
681
|
}
|
678
682
|
|
679
|
-
const bearerTokenFromReq = (req:
|
683
|
+
const bearerTokenFromReq = (req: IncomingMessage) => {
|
680
684
|
const [type, token] = parseAuthorizationHeader(req.headers.authorization)
|
681
685
|
return type === AuthType.BEARER ? token : null
|
682
686
|
}
|
@@ -715,7 +719,7 @@ export const createPublicKeyObject = (publicKeyHex: string): KeyObject => {
|
|
715
719
|
|
716
720
|
const keyEncoder = new KeyEncoder('secp256k1')
|
717
721
|
|
718
|
-
function vary(res:
|
722
|
+
function vary(res: ServerResponse, value: string) {
|
719
723
|
const current = res.getHeader('Vary')
|
720
724
|
if (current == null || typeof current === 'number') {
|
721
725
|
res.setHeader('Vary', value)
|
package/src/pipethrough.ts
CHANGED
@@ -8,20 +8,20 @@ import {
|
|
8
8
|
CatchallHandler,
|
9
9
|
HandlerPipeThrough,
|
10
10
|
InvalidRequestError,
|
11
|
+
parseReqNsid,
|
11
12
|
} from '@atproto/xrpc-server'
|
12
13
|
import { ResponseType, XRPCError } from '@atproto/xrpc'
|
14
|
+
import { getServiceEndpoint, noUndefinedVals } from '@atproto/common'
|
13
15
|
import { ids, lexicons } from './lexicon/lexicons'
|
14
16
|
import { httpLogger } from './logger'
|
15
|
-
import { getServiceEndpoint, noUndefinedVals } from '@atproto/common'
|
16
17
|
import AppContext from './context'
|
17
|
-
import { parseReqNsid } from '@atproto/xrpc-server'
|
18
18
|
|
19
19
|
export const proxyHandler = (ctx: AppContext): CatchallHandler => {
|
20
20
|
const accessStandard = ctx.authVerifier.accessStandard()
|
21
21
|
return async (req, res, next) => {
|
22
22
|
try {
|
23
23
|
const { url, aud, nsid } = await formatUrlAndAud(ctx, req)
|
24
|
-
const auth = await accessStandard({ req })
|
24
|
+
const auth = await accessStandard({ req, res })
|
25
25
|
if (!auth.credentials.isPrivileged && PRIVILEGED_METHODS.has(nsid)) {
|
26
26
|
throw new InvalidRequestError('Bad token method', 'InvalidToken')
|
27
27
|
}
|
@@ -7,6 +7,7 @@ import {
|
|
7
7
|
} from '@atproto/dev-env'
|
8
8
|
import { readCar } from '@atproto/repo'
|
9
9
|
import assert from 'assert'
|
10
|
+
import { ids } from '../src/lexicon/lexicons'
|
10
11
|
|
11
12
|
describe('account migration', () => {
|
12
13
|
let network: TestNetworkNoAppView
|
@@ -80,6 +81,7 @@ describe('account migration', () => {
|
|
80
81
|
|
81
82
|
const serviceJwtRes = await oldAgent.com.atproto.server.getServiceAuth({
|
82
83
|
aud: newServerDid,
|
84
|
+
lxm: ids.ComAtprotoServerCreateAccount,
|
83
85
|
})
|
84
86
|
const serviceJwt = serviceJwtRes.data.token
|
85
87
|
|
@@ -103,15 +103,29 @@ describe('app_passwords', () => {
|
|
103
103
|
})
|
104
104
|
|
105
105
|
it('restricts privileged app password actions', async () => {
|
106
|
+
const attempt = appAgent.api.chat.bsky.convo.listConvos({})
|
107
|
+
await expect(attempt).rejects.toThrow('Bad token method')
|
108
|
+
})
|
109
|
+
|
110
|
+
it('restricts privileged app password actions', async () => {
|
111
|
+
const attempt = appAgent.api.chat.bsky.convo.listConvos()
|
112
|
+
await expect(attempt).rejects.toThrow('Bad token method')
|
113
|
+
})
|
114
|
+
|
115
|
+
it('restricts service auth token methods for non-privileged access tokens', async () => {
|
106
116
|
const attempt = appAgent.api.com.atproto.server.getServiceAuth({
|
107
117
|
aud: 'did:example:test',
|
118
|
+
lxm: 'com.atproto.server.createAccount',
|
108
119
|
})
|
109
|
-
await expect(attempt).rejects.toThrow(
|
120
|
+
await expect(attempt).rejects.toThrow(
|
121
|
+
/cannot request a service auth token for the following method with an app password/,
|
122
|
+
)
|
110
123
|
})
|
111
124
|
|
112
|
-
it('allows privileged
|
125
|
+
it('allows privileged service auth token scopes for privileged access tokens', async () => {
|
113
126
|
await priviAgent.api.com.atproto.server.getServiceAuth({
|
114
127
|
aud: 'did:example:test',
|
128
|
+
lxm: 'com.atproto.server.createAccount',
|
115
129
|
})
|
116
130
|
})
|
117
131
|
|
@@ -142,8 +156,11 @@ describe('app_passwords', () => {
|
|
142
156
|
// allows privileged app passwords or higher
|
143
157
|
const priviAttempt = appAgent.api.com.atproto.server.getServiceAuth({
|
144
158
|
aud: 'did:example:test',
|
159
|
+
lxm: 'com.atproto.server.createAccount',
|
145
160
|
})
|
146
|
-
await expect(priviAttempt).rejects.toThrow(
|
161
|
+
await expect(priviAttempt).rejects.toThrow(
|
162
|
+
/cannot request a service auth token for the following method with an app password/,
|
163
|
+
)
|
147
164
|
|
148
165
|
// allows only full access auth
|
149
166
|
const fullAttempt = appAgent.api.com.atproto.server.createAppPassword(
|
@@ -5,6 +5,7 @@ import { createServiceAuthHeaders } from '@atproto/xrpc-server'
|
|
5
5
|
import * as plc from '@did-plc/lib'
|
6
6
|
import usersSeed from './seeds/users'
|
7
7
|
import { RepoRef } from '../src/lexicon/types/com/atproto/admin/defs'
|
8
|
+
import { ids } from '../src/lexicon/lexicons'
|
8
9
|
|
9
10
|
describe('moderator auth', () => {
|
10
11
|
let network: TestNetworkNoAppView
|
@@ -73,10 +74,10 @@ describe('moderator auth', () => {
|
|
73
74
|
})
|
74
75
|
|
75
76
|
it('allows service auth requests from the configured appview did', async () => {
|
76
|
-
const
|
77
|
+
const updateHeaders = await createServiceAuthHeaders({
|
77
78
|
iss: modServiceDid,
|
78
79
|
aud: pdsDid,
|
79
|
-
lxm:
|
80
|
+
lxm: ids.ComAtprotoAdminUpdateSubjectStatus,
|
80
81
|
keypair: modServiceKey,
|
81
82
|
})
|
82
83
|
await agent.api.com.atproto.admin.updateSubjectStatus(
|
@@ -85,16 +86,22 @@ describe('moderator auth', () => {
|
|
85
86
|
takedown: { applied: true, ref: 'test-repo' },
|
86
87
|
},
|
87
88
|
{
|
88
|
-
...
|
89
|
+
...updateHeaders,
|
89
90
|
encoding: 'application/json',
|
90
91
|
},
|
91
92
|
)
|
92
93
|
|
94
|
+
const getHeaders = await createServiceAuthHeaders({
|
95
|
+
iss: modServiceDid,
|
96
|
+
aud: pdsDid,
|
97
|
+
lxm: ids.ComAtprotoAdminGetSubjectStatus,
|
98
|
+
keypair: modServiceKey,
|
99
|
+
})
|
93
100
|
const res = await agent.api.com.atproto.admin.getSubjectStatus(
|
94
101
|
{
|
95
102
|
did: repoSubject.did,
|
96
103
|
},
|
97
|
-
|
104
|
+
getHeaders,
|
98
105
|
)
|
99
106
|
expect(res.data.subject.did).toBe(repoSubject.did)
|
100
107
|
expect(res.data.takedown?.applied).toBe(true)
|
@@ -104,7 +111,7 @@ describe('moderator auth', () => {
|
|
104
111
|
const headers = await createServiceAuthHeaders({
|
105
112
|
iss: altModDid,
|
106
113
|
aud: pdsDid,
|
107
|
-
lxm:
|
114
|
+
lxm: ids.ComAtprotoAdminUpdateSubjectStatus,
|
108
115
|
keypair: modServiceKey,
|
109
116
|
})
|
110
117
|
const attempt = agent.api.com.atproto.admin.updateSubjectStatus(
|
@@ -125,7 +132,7 @@ describe('moderator auth', () => {
|
|
125
132
|
const headers = await createServiceAuthHeaders({
|
126
133
|
iss: modServiceDid,
|
127
134
|
aud: pdsDid,
|
128
|
-
lxm:
|
135
|
+
lxm: ids.ComAtprotoAdminUpdateSubjectStatus,
|
129
136
|
keypair: badKey,
|
130
137
|
})
|
131
138
|
const attempt = agent.api.com.atproto.admin.updateSubjectStatus(
|
@@ -148,7 +155,7 @@ describe('moderator auth', () => {
|
|
148
155
|
const headers = await createServiceAuthHeaders({
|
149
156
|
iss: modServiceDid,
|
150
157
|
aud: sc.dids.alice,
|
151
|
-
lxm:
|
158
|
+
lxm: ids.ComAtprotoAdminUpdateSubjectStatus,
|
152
159
|
keypair: modServiceKey,
|
153
160
|
})
|
154
161
|
const attempt = agent.api.com.atproto.admin.updateSubjectStatus(
|
@@ -69,7 +69,7 @@ describe('notif service proxy', () => {
|
|
69
69
|
const auth = await verifyJwt(
|
70
70
|
spy.current?.['jwt'] as string,
|
71
71
|
notifDid,
|
72
|
-
|
72
|
+
'app.bsky.notification.registerPush',
|
73
73
|
async (did) => {
|
74
74
|
const keypair = await network.pds.ctx.actorStore.keypair(did)
|
75
75
|
return keypair.did()
|
@@ -66,7 +66,7 @@ describe('proxy header', () => {
|
|
66
66
|
const verified = await verifyJwt(
|
67
67
|
req.auth.replace('Bearer ', ''),
|
68
68
|
proxyServer.did,
|
69
|
-
|
69
|
+
'app.bsky.actor.getProfile',
|
70
70
|
(iss) => network.pds.ctx.idResolver.did.resolveAtprotoKey(iss, true),
|
71
71
|
)
|
72
72
|
expect(verified.aud).toBe(proxyServer.did)
|