@atproto/pds 0.4.73 → 0.4.74

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # @atproto/pds
2
2
 
3
+ ## 0.4.74
4
+
5
+ ### Patch Changes
6
+
7
+ - [#3092](https://github.com/bluesky-social/atproto/pull/3092) [`1e367cba2`](https://github.com/bluesky-social/atproto/commit/1e367cba2bd1ff5560c2ec5c2a5d348cd9342b65) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Improve email validation logic
8
+
9
+ - [#3066](https://github.com/bluesky-social/atproto/pull/3066) [`5ddd51235`](https://github.com/bluesky-social/atproto/commit/5ddd51235c7e064bddcad2dd218df05d144d18d3) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Prevent use of non https: resource uri in production environments
10
+
11
+ - [#3092](https://github.com/bluesky-social/atproto/pull/3092) [`1e367cba2`](https://github.com/bluesky-social/atproto/commit/1e367cba2bd1ff5560c2ec5c2a5d348cd9342b65) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Update list of forbidden domain names in email addresses
12
+
13
+ - Updated dependencies []:
14
+ - @atproto/oauth-provider@0.2.8
15
+
3
16
  ## 0.4.73
4
17
 
5
18
  ### Patch Changes
@@ -1 +1 @@
1
- {"version":3,"file":"createAccount.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/server/createAccount.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAE5C,OAAO,UAAU,MAAM,qBAAqB,CAAA;AAI5C,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QAiFvD"}
1
+ {"version":3,"file":"createAccount.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/server/createAccount.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAE5C,OAAO,UAAU,MAAM,qBAAqB,CAAA;AAI5C,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QAiFvD"}
@@ -22,9 +22,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
22
22
  __setModuleDefault(result, mod);
23
23
  return result;
24
24
  };
25
- var __importDefault = (this && this.__importDefault) || function (mod) {
26
- return (mod && mod.__esModule) ? mod : { "default": mod };
27
- };
28
25
  Object.defineProperty(exports, "__esModule", { value: true });
29
26
  exports.default = default_1;
30
27
  const common_1 = require("@atproto/common");
@@ -32,7 +29,8 @@ const identity_1 = require("@atproto/identity");
32
29
  const xrpc_server_1 = require("@atproto/xrpc-server");
33
30
  const crypto_1 = require("@atproto/crypto");
34
31
  const plc = __importStar(require("@did-plc/lib"));
35
- const disposable_email_1 = __importDefault(require("disposable-email"));
32
+ const address_1 = require("@hapi/address");
33
+ const disposable_email_domains_js_1 = require("disposable-email-domains-js");
36
34
  const handle_1 = require("../../../../handle");
37
35
  const util_1 = require("./util");
38
36
  const account_manager_1 = require("../../../../account-manager");
@@ -159,7 +157,7 @@ const validateInputsForLocalPds = async (ctx, input, requester) => {
159
157
  if (!email) {
160
158
  throw new xrpc_server_1.InvalidRequestError('Email is required');
161
159
  }
162
- else if (!disposable_email_1.default.validate(email)) {
160
+ else if (!(0, address_1.isEmailValid)(email) || (0, disposable_email_domains_js_1.isDisposableEmail)(email)) {
163
161
  throw new xrpc_server_1.InvalidRequestError('This email address is not supported, please use a different email.');
164
162
  }
165
163
  // normalize & ensure valid handle
@@ -1 +1 @@
1
- {"version":3,"file":"createAccount.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/server/createAccount.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgBA,4BAiFC;AAjGD,4CAA4D;AAC5D,gDAAkE;AAClE,sDAA6E;AAC7E,4CAA8E;AAC9E,kDAAmC;AACnC,wEAAyC;AACzC,+CAG2B;AAI3B,iCAA0C;AAC1C,iEAA2D;AAE3D,mBAAyB,MAAc,EAAE,GAA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AAC,GAAG,EAAE;QAC5B,YAAY;QACZ,MAAM;QACN,GAAG,EAAE,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,SAAS;QAC9B,MAAM,EAAE,GAAG,CAAC,cAAc;KAC3B,CAAC,CAAA;IACF,OAAO;QACL,GAAG,EAAE,SAAS,CAAC,GAAG;QAClB,KAAK,EAAE,SAAS,CAAC,EAAE;KACpB,CAAA;AACH,CAAC,CAAA;AACD,MAAM,mBAAmB,GAAG,CAC1B,IAAiB,EACjB,QAIC,EACD,EAAE;IACF,yCAAyC;IACzC,qEAAqE;IACrE,mEAAmE;IACnE,IAAI,IAAI,CAAC,MAAM,KAAK,QAAQ,CAAC,MAAM,EAAE,CAAC;QACpC,MAAM,IAAI,iCAAmB,CAC3B,oDAAoD,EACpD,oBAAoB,CACrB,CAAA;IACH,CAAC;SAAM,IAAI,IAAI,CAAC,GAAG,KAAK,QAAQ,CAAC,GAAG,EAAE,CAAC;QACrC,MAAM,IAAI,iCAAmB,CAC3B,2DAA2D,EAC3D,oBAAoB,CACrB,CAAA;IACH,CAAC;SAAM,IAAI,IAAI,CAAC,UAAU,KAAK,QAAQ,CAAC,UAAU,EAAE,CAAC;QACnD,MAAM,IAAI,iCAAmB,CAC3B,6DAA6D,EAC7D,oBAAoB,CACrB,CAAA;IACH,CAAC;AACH,CAAC,CAAA"}
1
+ {"version":3,"file":"createAccount.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/server/createAccount.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAkBA,4BAiFC;AAnGD,4CAA4D;AAC5D,gDAAkE;AAClE,sDAA6E;AAC7E,4CAA8E;AAC9E,kDAAmC;AACnC,2CAA4C;AAC5C,6EAA+D;AAE/D,+CAG2B;AAI3B,iCAA0C;AAC1C,iEAA2D;AAE3D,mBAAyB,MAAc,EAAE,GAAe;IACtD,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,aAAa,CAAC;QACtC,SAAS,E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AG,EAAE,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,SAAS;QAC9B,MAAM,EAAE,GAAG,CAAC,cAAc;KAC3B,CAAC,CAAA;IACF,OAAO;QACL,GAAG,EAAE,SAAS,CAAC,GAAG;QAClB,KAAK,EAAE,SAAS,CAAC,EAAE;KACpB,CAAA;AACH,CAAC,CAAA;AACD,MAAM,mBAAmB,GAAG,CAC1B,IAAiB,EACjB,QAIC,EACD,EAAE;IACF,yCAAyC;IACzC,qEAAqE;IACrE,mEAAmE;IACnE,IAAI,IAAI,CAAC,MAAM,KAAK,QAAQ,CAAC,MAAM,EAAE,CAAC;QACpC,MAAM,IAAI,iCAAmB,CAC3B,oDAAoD,EACpD,oBAAoB,CACrB,CAAA;IACH,CAAC;SAAM,IAAI,IAAI,CAAC,GAAG,KAAK,QAAQ,CAAC,GAAG,EAAE,CAAC;QACrC,MAAM,IAAI,iCAAmB,CAC3B,2DAA2D,EAC3D,oBAAoB,CACrB,CAAA;IACH,CAAC;SAAM,IAAI,IAAI,CAAC,UAAU,KAAK,QAAQ,CAAC,UAAU,EAAE,CAAC;QACnD,MAAM,IAAI,iCAAmB,CAC3B,6DAA6D,EAC7D,oBAAoB,CACrB,CAAA;IACH,CAAC;AACH,CAAC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"updateEmail.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/server/updateEmail.ts"],"names":[],"mappings":"AAMA,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,QA2DvD"}
1
+ {"version":3,"file":"updateEmail.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/server/updateEmail.ts"],"names":[],"mappings":"AAOA,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,QA2DvD"}
@@ -6,7 +6,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.default = default_1;
7
7
  const node_assert_1 = __importDefault(require("node:assert"));
8
8
  const xrpc_server_1 = require("@atproto/xrpc-server");
9
- const disposable_email_1 = __importDefault(require("disposable-email"));
9
+ const address_1 = require("@hapi/address");
10
+ const disposable_email_domains_js_1 = require("disposable-email-domains-js");
10
11
  const account_1 = require("../../../../account-manager/helpers/account");
11
12
  const lexicons_1 = require("../../../../lexicon/lexicons");
12
13
  function default_1(server, ctx) {
@@ -15,7 +16,7 @@ function default_1(server, ctx) {
15
16
  handler: async ({ auth, input }) => {
16
17
  const did = auth.credentials.did;
17
18
  const { token, email } = input.body;
18
- if (!disposable_email_1.default.validate(email)) {
19
+ if (!(0, address_1.isEmailValid)(email) || (0, disposable_email_domains_js_1.isDisposableEmail)(email)) {
19
20
  throw new xrpc_server_1.InvalidRequestError('This email address is not supported, please use a different email.');
20
21
  }
21
22
  const account = await ctx.accountManager.getAccount(did, {
@@ -1 +1 @@
1
- {"version":3,"file":"updateEmail.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/server/updateEmail.ts"],"names":[],"mappings":";;;;;AAUA,4BA2DC;AArED,8DAAgC;AAEhC,sDAA0D;AAC1D,wEAAyC;AAEzC,yEAAoF;AAGpF,2DAAkD;AAElD,mBAAyB,MAAc,EAAE,GAAe;IACtD,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,WAAW,CAAC;QACpC,IAAI,EAAE,GAAG,CAAC,YAAY,CAAC,UAAU,CAAC,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC;QAC1D,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE;YACjC,MAAM,GAAG,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,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AC,OAAO,GAAG,EAAE,CAAC;gBACb,IAAI,GAAG,YAAY,gCAAsB,EAAE,CAAC;oBAC1C,MAAM,IAAI,iCAAmB,CAC3B,qEAAqE,CACtE,CAAA;gBACH,CAAC;qBAAM,CAAC;oBACN,MAAM,GAAG,CAAA;gBACX,CAAC;YACH,CAAC;QACH,CAAC;KACF,CAAC,CAAA;AACJ,CAAC"}
1
+ {"version":3,"file":"updateEmail.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/server/updateEmail.ts"],"names":[],"mappings":";;;;;AAWA,4BA2DC;AAtED,8DAAgC;AAEhC,sDAA0D;AAC1D,2CAA4C;AAC5C,6EAA+D;AAE/D,yEAAoF;AAGpF,2DAAkD;AAElD,mBAAyB,MAAc,EAAE,GAAe;IACtD,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,WAAW,CAAC;QACpC,IAAI,EAAE,GAAG,CAAC,YAAY,CAAC,UAAU,CAAC,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC;QAC1D,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE;YACjC,MAAM,GAAG,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,CAAA;YAChC,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC,IAAI,CAAA;YACnC,IAAI,CAAC,IAAA,sBAAY,EAAC,KAAK,CAAC,IAAI,IAAA,+CAAiB,EAAC,KAAK,CAAC,EAAE,CAAC;gBACrD,MAAM,IAAI,iCAAmB,CAC3B,oEAAoE,CACrE,CAAA;YACH,CAAC;YACD,MAAM,OAAO,GAAG,MAAM,GAAG,CAAC,cAAc,CAAC,UAAU,CAAC,GAAG,EAAE;gBACvD,kBAAkB,EAAE,IAAI;aACzB,CAAC,CAAA;YACF,IAAI,CAAC,OAAO,EAAE,CAAC;gBACb,MAAM,IAAI,iCAAmB,CAAC,mBAAmB,CAAC,CAAA;YACpD,CAAC;YAED,I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AA2B,UAAU,KAAG,MAwBhE,CAAA"}
1
+ {"version":3,"file":"auth-routes.d.ts","sourceRoot":"","sources":["../src/auth-routes.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAEhC,OAAO,UAAU,MAAM,WAAW,CAAA;AAElC,eAAO,MAAM,YAAY,0BAA2B,UAAU,KAAG,MA+BhE,CAAA"}
@@ -12,6 +12,10 @@ const createRouter = ({ authProvider, cfg }) => {
12
12
  scopes_supported: [],
13
13
  resource_documentation: 'https://atproto.com',
14
14
  });
15
+ if (!cfg.service.devMode &&
16
+ !oauthProtectedResourceMetadata.resource.startsWith('https://')) {
17
+ throw new Error('Resource URL must use the https scheme');
18
+ }
15
19
  router.get('/.well-known/oauth-protected-resource', (req, res) => {
16
20
  res.setHeader('Access-Control-Allow-Origin', '*');
17
21
  res.setHeader('Access-Control-Allow-Method', '*');
@@ -1 +1 @@
1
- {"version":3,"file":"auth-routes.js","sourceRoot":"","sources":["../src/auth-routes.ts"],"names":[],"mappings":";;;AAAA,4DAA8E;AAC9E,qCAAgC;AAIzB,MAAM,YAAY,GAAG,CAAC,EAAE,YAAY,EAAE,GAAG,EAAc,EAAU,EAAE;IACxE,MAAM,MAAM,GAAG,IAAA,gBAAM,GAAE,CAAA;IAEvB,MAAM,8BAA8B,GAClC,qDAAoC,CAAC,KAAK,CAAC;QACzC,QAAQ,EAAE,GAAG,CAAC,OAAO,CAAC,SAAS;QAC/B,qBAAqB,EAAE,CAAC,GAAG,CAAC,QAAQ,EAAE,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,SAAS,CAAC;QACnE,wBAAwB,EAAE,CAAC,QAAQ,CAAC;QACpC,gBAAgB,EAAE,EAAE;QACpB,sBAAsB,EAAE,qBAAqB;KAC9C,CAAC,CAAA;IAEJ,MAAM,CAAC,GAAG,CAAC,uCAAuC,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;QAC/D,GAAG,CAAC,SAAS,C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G,EAAE,GAAG,EAAE,EAAE;QAC/D,GAAG,CAAC,SAAS,CAAC,6BAA6B,EAAE,GAAG,CAAC,CAAA;QACjD,GAAG,CAAC,SAAS,CAAC,6BAA6B,EAAE,GAAG,CAAC,CAAA;QACjD,GAAG,CAAC,SAAS,CAAC,8BAA8B,EAAE,GAAG,CAAC,CAAA;QAClD,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAA;IACtD,CAAC,CAAC,CAAA;IAEF,IAAI,YAAY,EAAE,CAAC;QACjB,MAAM,CAAC,GAAG,CAAC,YAAY,CAAC,YAAY,EAAE,CAAC,CAAA;IACzC,CAAC;IAED,OAAO,MAAM,CAAA;AACf,CAAC,CAAA;AA/BY,QAAA,YAAY,gBA+BxB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atproto/pds",
3
- "version": "0.4.73",
3
+ "version": "0.4.74",
4
4
  "license": "MIT",
5
5
  "description": "Reference implementation of atproto Personal Data Server (PDS)",
6
6
  "keywords": [
@@ -18,11 +18,12 @@
18
18
  "bin": "dist/bin.js",
19
19
  "dependencies": {
20
20
  "@did-plc/lib": "^0.0.4",
21
+ "@hapi/address": "^5.1.1",
21
22
  "better-sqlite3": "^10.0.0",
22
23
  "bytes": "^3.1.2",
23
24
  "compression": "^1.7.4",
24
25
  "cors": "^2.8.5",
25
- "disposable-email": "^0.2.3",
26
+ "disposable-email-domains-js": "^1.5.0",
26
27
  "express": "^4.17.2",
27
28
  "express-async-errors": "^3.1.1",
28
29
  "file-type": "^16.5.4",
@@ -51,7 +52,7 @@
51
52
  "@atproto/crypto": "^0.4.2",
52
53
  "@atproto/identity": "^0.4.3",
53
54
  "@atproto/lexicon": "^0.4.3",
54
- "@atproto/oauth-provider": "^0.2.7",
55
+ "@atproto/oauth-provider": "^0.2.8",
55
56
  "@atproto/repo": "^0.5.5",
56
57
  "@atproto/syntax": "^0.3.1",
57
58
  "@atproto/xrpc": "^0.6.4",
@@ -61,7 +62,6 @@
61
62
  "@atproto/pds-entryway": "npm:@atproto/pds@0.3.0-entryway.3",
62
63
  "@did-plc/server": "^0.0.1",
63
64
  "@types/cors": "^2.8.12",
64
- "@types/disposable-email": "^0.2.0",
65
65
  "@types/express": "^4.17.13",
66
66
  "@types/express-serve-static-core": "^4.17.36",
67
67
  "@types/nodemailer": "^6.4.6",
@@ -3,7 +3,9 @@ import { AtprotoData, ensureAtpDocument } from '@atproto/identity'
3
3
  import { AuthRequiredError, InvalidRequestError } from '@atproto/xrpc-server'
4
4
  import { ExportableKeypair, Keypair, Secp256k1Keypair } from '@atproto/crypto'
5
5
  import * as plc from '@did-plc/lib'
6
- import disposable from 'disposable-email'
6
+ import { isEmailValid } from '@hapi/address'
7
+ import { isDisposableEmail } from 'disposable-email-domains-js'
8
+
7
9
  import {
8
10
  baseNormalizeAndValidate,
9
11
  normalizeAndValidateHandle,
@@ -175,7 +177,7 @@ const validateInputsForLocalPds = async (
175
177
 
176
178
  if (!email) {
177
179
  throw new InvalidRequestError('Email is required')
178
- } else if (!disposable.validate(email)) {
180
+ } else if (!isEmailValid(email) || isDisposableEmail(email)) {
179
181
  throw new InvalidRequestError(
180
182
  'This email address is not supported, please use a different email.',
181
183
  )
@@ -1,7 +1,8 @@
1
1
  import assert from 'node:assert'
2
2
 
3
3
  import { InvalidRequestError } from '@atproto/xrpc-server'
4
- import disposable from 'disposable-email'
4
+ import { isEmailValid } from '@hapi/address'
5
+ import { isDisposableEmail } from 'disposable-email-domains-js'
5
6
 
6
7
  import { UserAlreadyExistsError } from '../../../../account-manager/helpers/account'
7
8
  import AppContext from '../../../../context'
@@ -14,7 +15,7 @@ export default function (server: Server, ctx: AppContext) {
14
15
  handler: async ({ auth, input }) => {
15
16
  const did = auth.credentials.did
16
17
  const { token, email } = input.body
17
- if (!disposable.validate(email)) {
18
+ if (!isEmailValid(email) || isDisposableEmail(email)) {
18
19
  throw new InvalidRequestError(
19
20
  'This email address is not supported, please use a different email.',
20
21
  )
@@ -15,6 +15,13 @@ export const createRouter = ({ authProvider, cfg }: AppContext): Router => {
15
15
  resource_documentation: 'https://atproto.com',
16
16
  })
17
17
 
18
+ if (
19
+ !cfg.service.devMode &&
20
+ !oauthProtectedResourceMetadata.resource.startsWith('https://')
21
+ ) {
22
+ throw new Error('Resource URL must use the https scheme')
23
+ }
24
+
18
25
  router.get('/.well-known/oauth-protected-resource', (req, res) => {
19
26
  res.setHeader('Access-Control-Allow-Origin', '*')
20
27
  res.setHeader('Access-Control-Allow-Method', '*')