@atproto/oauth-provider 0.3.1 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @atproto/oauth-provider
2
2
 
3
+ ## 0.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#3557](https://github.com/bluesky-social/atproto/pull/3557) [`82d5a2d36`](https://github.com/bluesky-social/atproto/commit/82d5a2d3617c40caab7a18e46c709c4b3c48e7f8) Thanks [@matthieusieben](https://github.com/matthieusieben)! - DeviceManager options can now be passed as argument to the OAuthProvider constructor
8
+
9
+ - [#3557](https://github.com/bluesky-social/atproto/pull/3557) [`82d5a2d36`](https://github.com/bluesky-social/atproto/commit/82d5a2d3617c40caab7a18e46c709c4b3c48e7f8) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Update "trustProxy" options to allow function
10
+
3
11
  ## 0.3.1
4
12
 
5
13
  ### Patch Changes
package/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  Dual MIT/Apache-2.0 License
2
2
 
3
- Copyright (c) 2022-2024 Bluesky PBC, and Contributors
3
+ Copyright (c) 2022-2025 Bluesky PBC, and Contributors
4
4
 
5
5
  Except as otherwise noted in individual files, this software is licensed under the MIT license (<http://opensource.org/licenses/MIT>), or the Apache License, Version 2.0 (<http://www.apache.org/licenses/LICENSE-2.0>).
6
6
 
@@ -23,10 +23,8 @@ export declare const deviceManagerOptionsSchema: z.ZodObject<{
23
23
  /**
24
24
  * Controls whether the IP address is read from the `X-Forwarded-For` header
25
25
  * (if `true`), or from the `req.socket.remoteAddress` property (if `false`).
26
- *
27
- * @default true // (nowadays, most requests are proxied)
28
26
  */
29
- trustProxy: z.ZodDefault<z.ZodBoolean>;
27
+ trustProxy: z.ZodOptional<z.ZodFunction<z.ZodTuple<[addr: z.ZodString, i: z.ZodNumber], z.ZodUnknown>, z.ZodBoolean>>;
30
28
  /**
31
29
  * Amount of time (in ms) after which session IDs will be rotated
32
30
  *
@@ -127,8 +125,8 @@ export declare const deviceManagerOptionsSchema: z.ZodObject<{
127
125
  index: (args_0: any, args_1: string, ...args: unknown[]) => number;
128
126
  } | undefined;
129
127
  };
130
- trustProxy: boolean;
131
128
  rotationRate: number;
129
+ trustProxy?: ((addr: string, i: number, ...args: unknown[]) => boolean) | undefined;
132
130
  }, {
133
131
  cookie?: {
134
132
  path?: string | undefined;
@@ -143,7 +141,7 @@ export declare const deviceManagerOptionsSchema: z.ZodObject<{
143
141
  device?: string | undefined;
144
142
  session?: string | undefined;
145
143
  } | undefined;
146
- trustProxy?: boolean | undefined;
144
+ trustProxy?: ((addr: string, i: number, ...args: unknown[]) => boolean) | undefined;
147
145
  rotationRate?: number | undefined;
148
146
  }>;
149
147
  export type DeviceManagerOptions = z.input<typeof deviceManagerOptionsSchema>;
@@ -1 +1 @@
1
- {"version":3,"file":"device-manager.d.ts","sourceRoot":"","sources":["../../src/device/device-manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAEhE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,OAAO,EAAE,eAAe,EAA0B,MAAM,wBAAwB,CAAA;AAEhF,OAAO,EAAE,QAAQ,EAAoC,MAAM,gBAAgB,CAAA;AAC3E,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAG/C;;GAEG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;EAIxB,CAAA;AAEF,eAAO,MAAM,0BAA0B;IACrC;;;;;OAKG;;IAEH;;;;OAIG;;IAEH;;OAEG;;;;;;;;;;;;;;;QAIC;;;;WAIG;;QAEH;;;;WAIG;;QAEH;;;;WAIG;;QAEH;;;;;;WAMG;;QAKH;;;;WAIG;;QAEH;;;;WAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAIP,CAAA;AAEF,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAA;AAK7E;;;;GAIG;AACH,qBAAa,aAAa;IAItB,OAAO,CAAC,QAAQ,CAAC,KAAK;IAHxB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA4C;gBAGjD,KAAK,EAAE,WAAW,EACnC,OAAO,GAAE,oBAAyB;IAKvB,IAAI,CACf,GAAG,EAAE,eAAe,EACpB,GAAG,EAAE,cAAc,EACnB,WAAW,UAAQ,GAClB,OAAO,CAAC;QACT,QAAQ,EAAE,QAAQ,CAAA;QAClB,cAAc,EAAE,eAAe,CAAA;KAChC,CAAC;YAcY,MAAM;YA0BN,OAAO;YA4CP,MAAM;YAiBN,SAAS;IA+BvB,OAAO,CAAC,WAAW;IAuBnB,OAAO,CAAC,SAAS;IAKjB,OAAO,CAAC,WAAW;IAgCZ,kBAAkB,CAAC,GAAG,EAAE,eAAe;CAG/C"}
@@ -20,10 +20,12 @@ exports.deviceManagerOptionsSchema = zod_1.z.object({
20
20
  /**
21
21
  * Controls whether the IP address is read from the `X-Forwarded-For` header
22
22
  * (if `true`), or from the `req.socket.remoteAddress` property (if `false`).
23
- *
24
- * @default true // (nowadays, most requests are proxied)
25
23
  */
26
- trustProxy: zod_1.z.boolean().default(true),
24
+ trustProxy: zod_1.z
25
+ .function()
26
+ .args(zod_1.z.string(), zod_1.z.number())
27
+ .returns(zod_1.z.boolean())
28
+ .optional(),
27
29
  /**
28
30
  * Amount of time (in ms) after which session IDs will be rotated
29
31
  *
@@ -1 +1 @@
1
- {"version":3,"file":"device-manager.js","sourceRoot":"","sources":["../../src/device/device-manager.ts"],"names":[],"mappings":";;;AACA,mCAAqD;AACrD,6BAAuB;AACvB,kDAA0D;AAC1D,mDAAqE;AACrE,uDAAgF;AAEhF,iDAA2E;AAE3E,mDAA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M,CAAC,GAAG,GAAG,IAAI;gBAClC,CAAC,CAAC,CAAC;YACL,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI;YAC9B,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,KAAK,KAAK;YAC5C,QAAQ,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,KAAK,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ;SAC3D,CAAA;QAEV,IAAA,uBAAY,EACV,GAAG,EACH,YAAY,EACZ,IAAA,kBAAe,EAAC,IAAI,EAAE,KAAK,IAAI,EAAE,EAAE,aAAa,CAAC,CAClD,CAAA;QAED,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;YAC7B,IAAA,uBAAY,EACV,GAAG,EACH,YAAY,EACZ,IAAA,kBAAe,EACb,GAAG,IAAI,OAAO,EACd,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,EACjD,aAAa,CACd,CACF,CAAA;QACH,CAAC;IACH,CAAC;IAEM,kBAAkB,CAAC,GAAoB;QAC5C,OAAO,IAAA,mCAAsB,EAAC,GAAG,EAAE,IAAI,CAAC,OAAO,CAAC,CAAA;IAClD,CAAC;CACF;AApND,sCAoNC"}
@@ -10,7 +10,19 @@ export declare function validateSameOrigin(req: IncomingMessage, res: ServerResp
10
10
  export declare function validateCsrfToken(req: IncomingMessage, res: ServerResponse, csrfToken: string, cookieName?: string, clearCookie?: boolean): void;
11
11
  export declare function parseHttpCookies(req: IncomingMessage): null | Record<string, undefined | string>;
12
12
  export type ExtractRequestMetadataOptions = {
13
- trustProxy?: boolean;
13
+ /**
14
+ * A function that determines whether a given IP address is trusted. The
15
+ * function is called with the IP addresses and its index in the list of
16
+ * forwarded addresses (starting from 0, 0 corresponding to the ip of the
17
+ * incoming HTTP connection, and the last item being the first proxied IP
18
+ * address in the proxy chain, deduced from the `X-Forwarded-For` header). The
19
+ * function should return `true` if the IP address is trusted, and `false`
20
+ * otherwise.
21
+ *
22
+ * @see {@link https://www.npmjs.com/package/proxy-addr} for a utility that
23
+ * allows you to create a trust function.
24
+ */
25
+ trustProxy?: (addr: string, i: number) => boolean;
14
26
  };
15
27
  export type RequestMetadata = {
16
28
  userAgent?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../../../src/lib/http/request.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAIhE,OAAO,EAAE,YAAY,EAAY,MAAM,UAAU,CAAA;AAEjD,wBAAgB,mBAAmB,CACjC,GAAG,EAAE,eAAe,EACpB,IAAI,EAAE,MAAM,eAAe,CAAC,SAAS,CAAC,EACtC,aAAa,EAAE,SAAS,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,QAgB1C;AAED,wBAAgB,iBAAiB,CAC/B,GAAG,EAAE,eAAe,EACpB,GAAG,EAAE,cAAc,EACnB,YAAY,EAAE,SAAS,CACnB,IAAI,GACJ,UAAU,GACV,aAAa,GACb,SAAS,GACT,MAAM,CACT,EAAE,QAGJ;AAED,wBAAgB,iBAAiB,CAC/B,GAAG,EAAE,eAAe,EACpB,GAAG,EAAE,cAAc,EACnB,YAAY,EAAE,SAAS,CACnB,IAAI,GACJ,UAAU,GACV,OAAO,GACP,MAAM,GACN,OAAO,GACP,UAAU,GACV,OAAO,GACP,QAAQ,GACR,QAAQ,GACR,QAAQ,GACR,eAAe,GACf,cAAc,GACd,OAAO,GACP,QAAQ,GACR,MAAM,CACT,EAAE,QAGJ;AAED,wBAAgB,iBAAiB,CAC/B,GAAG,EAAE,eAAe,EACpB,GAAG,EAAE,cAAc,EACnB,YAAY,EAAE,SAAS,CACn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G,EAAE,eAAe,GACnB,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,SAAS,GAAG,MAAM,CAAC,CAM3C;AAED,MAAM,MAAM,6BAA6B,GAAG;IAC1C;;;;;;;;;;;OAWG;IACH,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,KAAK,OAAO,CAAA;CAClD,CAAA;AAED,MAAM,MAAM,eAAe,GAAG;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,EAAE,MAAM,CAAA;CACb,CAAA;AAED,wBAAgB,sBAAsB,CACpC,GAAG,EAAE,eAAe,EACpB,OAAO,CAAC,EAAE,6BAA6B,GACtC,eAAe,CAOjB"}
@@ -15,6 +15,7 @@ exports.parseHttpCookies = parseHttpCookies;
15
15
  exports.extractRequestMetadata = extractRequestMetadata;
16
16
  const node_crypto_1 = require("node:crypto");
17
17
  const cookie_1 = require("cookie");
18
+ const forwarded_1 = __importDefault(require("forwarded"));
18
19
  const http_errors_1 = __importDefault(require("http-errors"));
19
20
  const response_js_1 = require("./response.js");
20
21
  const url_js_1 = require("./url.js");
@@ -86,31 +87,45 @@ function parseHttpCookies(req) {
86
87
  : null;
87
88
  }
88
89
  function extractRequestMetadata(req, options) {
89
- const userAgent = req.headers['user-agent'] || undefined;
90
- const ipAddress = extractIpAddress(req, options) || null;
91
- const port = extractPort(req, options);
92
- if (ipAddress == null || port == null) {
93
- throw new Error('Could not determine IP address');
94
- }
95
- return { userAgent, ipAddress, port };
90
+ const ip = extractIp(req, options);
91
+ return {
92
+ userAgent: req.headers['user-agent'],
93
+ ipAddress: ip,
94
+ port: extractPort(req, ip),
95
+ };
96
96
  }
97
- function extractIpAddress(req, options) {
98
- // Express app compatibility
99
- if ('ip' in req && typeof req.ip === 'string') {
100
- return req.ip;
101
- }
102
- if (options?.trustProxy) {
103
- const forwardedFor = req.headers['x-forwarded-for'];
104
- if (typeof forwardedFor === 'string') {
105
- const firstForward = forwardedFor.split(',')[0].trim();
106
- if (firstForward)
107
- return firstForward;
97
+ function extractIp(req, options) {
98
+ const trust = options?.trustProxy;
99
+ if (trust) {
100
+ const ips = (0, forwarded_1.default)(req);
101
+ for (let i = 0; i < ips.length; i++) {
102
+ const isTrusted = trust(ips[i], i);
103
+ if (!isTrusted)
104
+ return ips[i];
108
105
  }
106
+ // Let's return the last ("furthest") IP address in the chain if all of them
107
+ // are trusted. Note that this may indicate an issue with either the trust
108
+ // function (too permissive), or the proxy configuration (one of them not
109
+ // setting the X-Forwarded-For header).
110
+ const ip = ips[ips.length - 1];
111
+ if (ip)
112
+ return ip;
113
+ }
114
+ // Express app compatibility (see "trust proxy" setting)
115
+ if ('ip' in req) {
116
+ const ip = req.ip;
117
+ if (typeof ip === 'string')
118
+ return ip;
109
119
  }
110
- return req.socket.remoteAddress;
120
+ const ip = req.socket.remoteAddress;
121
+ if (ip)
122
+ return ip;
123
+ throw new Error('Could not determine IP address');
111
124
  }
112
- function extractPort(req, options) {
113
- if (options?.trustProxy) {
125
+ function extractPort(req, ip) {
126
+ if (ip !== req.socket.remoteAddress) {
127
+ // Trust the X-Forwarded-Port header only if the IP address was a trusted
128
+ // proxied IP.
114
129
  const forwardedPort = req.headers['x-forwarded-port'];
115
130
  if (typeof forwardedPort === 'string') {
116
131
  const port = Number(forwardedPort.trim());
@@ -120,6 +135,9 @@ function extractPort(req, options) {
120
135
  return port;
121
136
  }
122
137
  }
123
- return req.socket.remotePort;
138
+ const port = req.socket.remotePort;
139
+ if (port != null)
140
+ return port;
141
+ throw new Error('Could not determine port');
124
142
  }
125
143
  //# sourceMappingURL=request.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"request.js","sourceRoot":"","sources":["../../../src/lib/http/request.ts"],"names":[],"mappings":";;;;;AAOA,kDAmBC;AAED,8CAYC;AAED,8CAsBC;AAED,8CAYC;AAED,0CAWC;AAED,wCAgBC;AAGD,gDAUC;AAED,8CA6BC;AA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AAa,EAAE,CAAC;QACpC,yEAAyE;QACzE,cAAc;QACd,MAAM,aAAa,GAAG,GAAG,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAA;QACrD,IAAI,OAAO,aAAa,KAAK,QAAQ,EAAE,CAAC;YACtC,MAAM,IAAI,GAAG,MAAM,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC,CAAA;YACzC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,IAAI,GAAG,CAAC,IAAI,IAAI,GAAG,KAAK,EAAE,CAAC;gBACxD,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAA;YAC3C,CAAC;YACD,OAAO,IAAI,CAAA;QACb,CAAC;IACH,CAAC;IAED,MAAM,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,UAAU,CAAA;IAClC,IAAI,IAAI,IAAI,IAAI;QAAE,OAAO,IAAI,CAAA;IAE7B,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAA;AAC7C,CAAC"}
@@ -12,7 +12,7 @@ import { ClientManager, LoopbackMetadataGetter } from './client/client-manager.j
12
12
  import { ClientStore } from './client/client-store.js';
13
13
  import { Client } from './client/client.js';
14
14
  import { DeviceId } from './device/device-id.js';
15
- import { DeviceManagerOptions } from './device/device-manager.js';
15
+ import { DeviceManager, DeviceManagerOptions } from './device/device-manager.js';
16
16
  import { DeviceStore } from './device/device-store.js';
17
17
  import { Handler, Router } from './lib/http/index.js';
18
18
  import { RequestMetadata } from './lib/http/request.js';
@@ -22,6 +22,7 @@ import { OAuthHooks } from './oauth-hooks.js';
22
22
  import { OAuthVerifier, OAuthVerifierOptions } from './oauth-verifier.js';
23
23
  import { AuthorizationResultAuthorize } from './output/build-authorize-data.js';
24
24
  import { Customization } from './output/customization.js';
25
+ import { OutputManager } from './output/output-manager.js';
25
26
  import { AuthorizationResultRedirect } from './output/send-authorize-redirect.js';
26
27
  import { ReplayStore } from './replay/replay-store.js';
27
28
  import { RequestManager } from './request/request-manager.js';
@@ -32,10 +33,10 @@ import { TokenStore } from './token/token-store.js';
32
33
  import { VerifyTokenClaimsOptions } from './token/verify-token-claims.js';
33
34
  export type OAuthProviderStore = Partial<ClientStore & AccountStore & DeviceStore & TokenStore & RequestStore & ReplayStore>;
34
35
  export { type CustomMetadata, type Customization, type Handler, Keyset, type OAuthAuthorizationServerMetadata, };
35
- export type RouterOptions<Req extends IncomingMessage = IncomingMessage, Res extends ServerResponse = ServerResponse> = DeviceManagerOptions & {
36
+ export type RouterOptions<Req extends IncomingMessage = IncomingMessage, Res extends ServerResponse = ServerResponse> = {
36
37
  onError?: (req: Req, res: Res, err: unknown, message: string) => void;
37
38
  };
38
- export type OAuthProviderOptions = Override<OAuthVerifierOptions & OAuthHooks, {
39
+ export type OAuthProviderOptions = Override<OAuthVerifierOptions & OAuthHooks & DeviceManagerOptions, {
39
40
  /**
40
41
  * Maximum age a device/account session can be before requiring
41
42
  * re-authentication.
@@ -106,13 +107,13 @@ export type OAuthProviderOptions = Override<OAuthVerifierOptions & OAuthHooks, {
106
107
  }>;
107
108
  export declare class OAuthProvider extends OAuthVerifier {
108
109
  readonly metadata: OAuthAuthorizationServerMetadata;
109
- readonly customization?: Customization;
110
110
  readonly authenticationMaxAge: number;
111
111
  readonly accountManager: AccountManager;
112
- readonly deviceStore: DeviceStore;
112
+ readonly deviceManager: DeviceManager;
113
113
  readonly clientManager: ClientManager;
114
114
  readonly requestManager: RequestManager;
115
115
  readonly tokenManager: TokenManager;
116
+ readonly outputManager: OutputManager;
116
117
  constructor({ metadata, customization, authenticationMaxAge, tokenMaxAge, safeFetch, redis, store, // compound store implementation
117
118
  accountStore, deviceStore, tokenStore, clientStore, replayStore, requestStore, clientJwksCache, clientMetadataCache, loopbackMetadata, ...rest }: OAuthProviderOptions);
118
119
  get jwks(): {
@@ -1 +1 @@
1
- {"version":3,"file":"oauth-provider.d.ts","sourceRoot":"","sources":["../src/oauth-provider.ts"],"names":[],"mappings":"AAAA,OAAO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,CAAC,kBAAkB,CAAC;IA6DxB,iBAAiB,CACrB,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,UAAU,EACtB,cAAc,EAAE,eAAe,EAC/B,KAAK,EAAE,kCAAkC,EACzC,OAAO,EAAE,IAAI,GAAG,MAAM,GACrB,OAAO,CAAC,kBAAkB,CAAC;IAU9B;;OAEG;cACa,MAAM,CAAC,EAAE,KAAK,EAAE,EAAE,wBAAwB;IAM1D;;OAEG;cACa,UAAU,CACxB,WAAW,EAAE,sBAAsB,EACnC,EAAE,KAAK,EAAE,EAAE,wBAAwB,GAClC,OAAO,CAAC,0BAA0B,CAAC;cAiDb,iBAAiB,CACxC,SAAS,EAAE,cAAc,EACzB,KAAK,EAAE,gBAAgB,EACvB,OAAO,EAAE,MAAM,GAAG,IAAI,EACtB,aAAa,CAAC,EAAE,wBAAwB;IAgB1C;;;OAGG;IACI,WAAW,CAChB,CAAC,GAAG,IAAI,EACR,GAAG,SAAS,eAAe,GAAG,eAAe,EAC7C,GAAG,SAAS,cAAc,GAAG,cAAc,EAC3C,OAAO,CAAC,EAAE,aAAa,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC;IAKnD,WAAW,CAChB,CAAC,GAAG,IAAI,EACR,GAAG,SAAS,eAAe,GAAG,eAAe,EAC7C,GAAG,SAAS,cAAc,GAAG,cAAc,EAC3C,OAAO,CAAC,EAAE,aAAa,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC;CAugB1D"}
@@ -53,13 +53,13 @@ const token_manager_js_1 = require("./token/token-manager.js");
53
53
  const token_store_js_1 = require("./token/token-store.js");
54
54
  class OAuthProvider extends oauth_verifier_js_1.OAuthVerifier {
55
55
  metadata;
56
- customization;
57
56
  authenticationMaxAge;
58
57
  accountManager;
59
- deviceStore;
58
+ deviceManager;
60
59
  clientManager;
61
60
  requestManager;
62
61
  tokenManager;
62
+ outputManager;
63
63
  constructor({ metadata, customization = undefined, authenticationMaxAge = constants_js_1.AUTHENTICATION_MAX_AGE, tokenMaxAge = constants_js_1.TOKEN_MAX_AGE, safeFetch = (0, fetch_node_1.safeFetchWrap)(), redis, store, // compound store implementation
64
64
  // Requires stores
65
65
  accountStore = (0, account_store_js_1.asAccountStore)(store), deviceStore = (0, device_store_js_1.asDeviceStore)(store), tokenStore = (0, token_store_js_1.asTokenStore)(store),
@@ -71,7 +71,7 @@ class OAuthProvider extends oauth_verifier_js_1.OAuthVerifier {
71
71
  maxSize: 50_000_000,
72
72
  ttl: 600e3,
73
73
  }), loopbackMetadata = oauth_types_1.atprotoLoopbackClientMetadata,
74
- // OAuthHooks & OAuthVerifierOptions
74
+ // OAuthHooks & OAuthVerifierOptions & DeviceManagerOptions
75
75
  ...rest }) {
76
76
  super({ replayStore, redis, ...rest });
77
77
  requestStore ??= redis
@@ -79,8 +79,8 @@ class OAuthProvider extends oauth_verifier_js_1.OAuthVerifier {
79
79
  : new request_store_memory_js_1.RequestStoreMemory();
80
80
  this.authenticationMaxAge = authenticationMaxAge;
81
81
  this.metadata = (0, build_metadata_js_1.buildMetadata)(this.issuer, this.keyset, metadata);
82
- this.customization = customization;
83
- this.deviceStore = deviceStore;
82
+ this.deviceManager = new device_manager_js_1.DeviceManager(deviceStore, rest);
83
+ this.outputManager = new output_manager_js_1.OutputManager(customization);
84
84
  this.accountManager = new account_manager_js_1.AccountManager(accountStore);
85
85
  this.clientManager = new client_manager_js_1.ClientManager(this.metadata, this.keyset, rest, clientStore || null, loopbackMetadata || null, safeFetch, clientJwksCache, clientMetadataCache);
86
86
  this.requestManager = new request_manager_js_1.RequestManager(requestStore, this.signer, this.metadata, rest);
@@ -478,8 +478,6 @@ class OAuthProvider extends oauth_verifier_js_1.OAuthVerifier {
478
478
  return router.buildHandler();
479
479
  }
480
480
  buildRouter(options) {
481
- const deviceManager = new device_manager_js_1.DeviceManager(this.deviceStore, options);
482
- const outputManager = new output_manager_js_1.OutputManager(this.customization);
483
481
  // eslint-disable-next-line @typescript-eslint/no-this-alias
484
482
  const server = this;
485
483
  const issuerUrl = new URL(server.issuer);
@@ -569,7 +567,7 @@ class OAuthProvider extends oauth_verifier_js_1.OAuthVerifier {
569
567
  catch (err) {
570
568
  onError?.(req, res, err, `Failed to handle navigation request to "${req.url}"`);
571
569
  if (!res.headersSent) {
572
- await outputManager.sendErrorPage(res, err);
570
+ await server.outputManager.sendErrorPage(res, err);
573
571
  }
574
572
  }
575
573
  };
@@ -642,7 +640,7 @@ class OAuthProvider extends oauth_verifier_js_1.OAuthVerifier {
642
640
  router.options('/oauth/token', corsPreflight);
643
641
  router.post('/oauth/token', jsonHandler(async function (req, _res) {
644
642
  const payload = await (0, index_js_1.parseHttpRequest)(req, ['json', 'urlencoded']);
645
- const clientMetadata = await deviceManager.getRequestMetadata(req);
643
+ const clientMetadata = await server.deviceManager.getRequestMetadata(req);
646
644
  const clientCredentials = await oauth_types_1.oauthClientCredentialsSchema
647
645
  .parseAsync(payload, { path: ['body'] })
648
646
  .catch(throwInvalidClient);
@@ -705,7 +703,7 @@ class OAuthProvider extends oauth_verifier_js_1.OAuthVerifier {
705
703
  const authorizationRequest = await oauth_types_1.oauthAuthorizationRequestQuerySchema
706
704
  .parseAsync(query, { path: ['query'] })
707
705
  .catch(throwInvalidRequest);
708
- const { deviceId, deviceMetadata } = await deviceManager.load(req, res);
706
+ const { deviceId, deviceMetadata } = await server.deviceManager.load(req, res);
709
707
  const data = await server
710
708
  .authorize(clientCredentials, authorizationRequest, deviceId, deviceMetadata)
711
709
  .catch((err) => accessDeniedToRedirectCatcher(req, res, err));
@@ -715,7 +713,7 @@ class OAuthProvider extends oauth_verifier_js_1.OAuthVerifier {
715
713
  }
716
714
  case 'authorize' in data: {
717
715
  await (0, index_js_1.setupCsrfToken)(req, res, csrfCookie(data.authorize.uri));
718
- return outputManager.sendAuthorizePage(res, data);
716
+ return server.outputManager.sendAuthorizePage(res, data);
719
717
  }
720
718
  default: {
721
719
  // Should never happen
@@ -743,7 +741,7 @@ class OAuthProvider extends oauth_verifier_js_1.OAuthVerifier {
743
741
  pathname: '/oauth/authorize',
744
742
  });
745
743
  (0, index_js_1.validateCsrfToken)(req, res, input.csrf_token, csrfCookie(input.request_uri));
746
- const { deviceId } = await deviceManager.load(req, res, true);
744
+ const { deviceId } = await server.deviceManager.load(req, res, true);
747
745
  return server.signIn(deviceId, input.request_uri, input.client_id, input.credentials);
748
746
  }));
749
747
  const acceptQuerySchema = zod_1.z.object({
@@ -776,7 +774,7 @@ class OAuthProvider extends oauth_verifier_js_1.OAuthVerifier {
776
774
  ],
777
775
  });
778
776
  (0, index_js_1.validateCsrfToken)(req, res, input.csrf_token, csrfCookie(input.request_uri), true);
779
- const { deviceId, deviceMetadata } = await deviceManager.load(req, res);
777
+ const { deviceId, deviceMetadata } = await server.deviceManager.load(req, res);
780
778
  const data = await server
781
779
  .acceptRequest(input.request_uri, input.client_id, input.account_sub, deviceId, deviceMetadata)
782
780
  .catch((err) => accessDeniedToRedirectCatcher(req, res, err));
@@ -811,7 +809,7 @@ class OAuthProvider extends oauth_verifier_js_1.OAuthVerifier {
811
809
  ],
812
810
  });
813
811
  (0, index_js_1.validateCsrfToken)(req, res, input.csrf_token, csrfCookie(input.request_uri), true);
814
- const { deviceId } = await deviceManager.load(req, res);
812
+ const { deviceId } = await server.deviceManager.load(req, res);
815
813
  const data = await server
816
814
  .rejectRequest(deviceId, input.request_uri, input.client_id)
817
815
  .catch((err) => accessDeniedToRedirectCatcher(req, res, err));
@@ -1 +1 @@
1
- {"version":3,"file":"oauth-provider.js","sourceRoot":"","sources":["../src/oauth-provider.ts"],"names":[],"mappings":";;;;;;AACA,yCAAwC;AACxC,8DAAyC;AAEzC,6BAAiC;AACjC,sCAA2C;AA4HzC,uFA5Ha,YAAM,OA4Hb;AA3HR,sDA0B6B;AAC7B,yDAAwD;AAExD,2EAAqE;AACrE,8EAAqE;AACrE,qE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- "version": "0.3.1",
3
+ "version": "0.4.0",
4
4
  "license": "MIT",
5
5
  "description": "Generic OAuth2 and OpenID Connect provider for Node.js. Currently only supports features needed for Atproto.",
6
6
  "keywords": [
@@ -35,6 +35,7 @@
35
35
  "@hapi/bourne": "^3.0.0",
36
36
  "@hapi/content": "^6.0.0",
37
37
  "cookie": "^0.6.0",
38
+ "forwarded": "^0.2.0",
38
39
  "http-errors": "^2.0.0",
39
40
  "ioredis": "^5.3.2",
40
41
  "jose": "^5.2.0",
@@ -42,9 +43,9 @@
42
43
  "zod": "^3.23.8",
43
44
  "@atproto-labs/fetch": "0.2.1",
44
45
  "@atproto-labs/fetch-node": "0.1.7",
46
+ "@atproto-labs/pipe": "0.1.0",
45
47
  "@atproto-labs/simple-store": "0.1.2",
46
48
  "@atproto-labs/simple-store-memory": "0.1.2",
47
- "@atproto-labs/pipe": "0.1.0",
48
49
  "@atproto/common": "^0.4.8",
49
50
  "@atproto/jwk": "0.1.3",
50
51
  "@atproto/jwk-jose": "0.1.4",
@@ -57,6 +58,7 @@
57
58
  "@rollup/plugin-terser": "^0.4.4",
58
59
  "@rollup/plugin-typescript": "^11.1.6",
59
60
  "@types/cookie": "^0.6.0",
61
+ "@types/forwarded": "0.1.3",
60
62
  "@types/psl": "1.1.3",
61
63
  "@types/react": "^18.2.50",
62
64
  "@types/react-dom": "^18.2.18",
@@ -22,10 +22,13 @@ export const deviceManagerOptionsSchema = z.object({
22
22
  /**
23
23
  * Controls whether the IP address is read from the `X-Forwarded-For` header
24
24
  * (if `true`), or from the `req.socket.remoteAddress` property (if `false`).
25
- *
26
- * @default true // (nowadays, most requests are proxied)
27
25
  */
28
- trustProxy: z.boolean().default(true),
26
+ trustProxy: z
27
+ .function()
28
+ .args<[addr: z.ZodString, i: z.ZodNumber]>(z.string(), z.number())
29
+ .returns(z.boolean())
30
+ .optional(),
31
+
29
32
  /**
30
33
  * Amount of time (in ms) after which session IDs will be rotated
31
34
  *
@@ -1,6 +1,7 @@
1
1
  import { randomBytes } from 'node:crypto'
2
2
  import type { IncomingMessage, ServerResponse } from 'node:http'
3
3
  import { parse as parseCookie, serialize as serializeCookie } from 'cookie'
4
+ import forwarded from 'forwarded'
4
5
  import createHttpError from 'http-errors'
5
6
  import { appendHeader } from './response.js'
6
7
  import { UrlReference, urlMatch } from './url.js'
@@ -164,7 +165,19 @@ export function parseHttpCookies(
164
165
  }
165
166
 
166
167
  export type ExtractRequestMetadataOptions = {
167
- trustProxy?: boolean
168
+ /**
169
+ * A function that determines whether a given IP address is trusted. The
170
+ * function is called with the IP addresses and its index in the list of
171
+ * forwarded addresses (starting from 0, 0 corresponding to the ip of the
172
+ * incoming HTTP connection, and the last item being the first proxied IP
173
+ * address in the proxy chain, deduced from the `X-Forwarded-For` header). The
174
+ * function should return `true` if the IP address is trusted, and `false`
175
+ * otherwise.
176
+ *
177
+ * @see {@link https://www.npmjs.com/package/proxy-addr} for a utility that
178
+ * allows you to create a trust function.
179
+ */
180
+ trustProxy?: (addr: string, i: number) => boolean
168
181
  }
169
182
 
170
183
  export type RequestMetadata = {
@@ -177,42 +190,49 @@ export function extractRequestMetadata(
177
190
  req: IncomingMessage,
178
191
  options?: ExtractRequestMetadataOptions,
179
192
  ): RequestMetadata {
180
- const userAgent = req.headers['user-agent'] || undefined
181
- const ipAddress = extractIpAddress(req, options) || null
182
- const port = extractPort(req, options)
183
-
184
- if (ipAddress == null || port == null) {
185
- throw new Error('Could not determine IP address')
193
+ const ip = extractIp(req, options)
194
+ return {
195
+ userAgent: req.headers['user-agent'],
196
+ ipAddress: ip,
197
+ port: extractPort(req, ip),
186
198
  }
187
-
188
- return { userAgent, ipAddress, port }
189
199
  }
190
200
 
191
- function extractIpAddress(
201
+ function extractIp(
192
202
  req: IncomingMessage,
193
203
  options?: ExtractRequestMetadataOptions,
194
- ): string | undefined {
195
- // Express app compatibility
196
- if ('ip' in req && typeof req.ip === 'string') {
197
- return req.ip
204
+ ): string {
205
+ const trust = options?.trustProxy
206
+ if (trust) {
207
+ const ips = forwarded(req)
208
+ for (let i = 0; i < ips.length; i++) {
209
+ const isTrusted = trust(ips[i], i)
210
+ if (!isTrusted) return ips[i]
211
+ }
212
+ // Let's return the last ("furthest") IP address in the chain if all of them
213
+ // are trusted. Note that this may indicate an issue with either the trust
214
+ // function (too permissive), or the proxy configuration (one of them not
215
+ // setting the X-Forwarded-For header).
216
+ const ip = ips[ips.length - 1]
217
+ if (ip) return ip
198
218
  }
199
219
 
200
- if (options?.trustProxy) {
201
- const forwardedFor = req.headers['x-forwarded-for']
202
- if (typeof forwardedFor === 'string') {
203
- const firstForward = forwardedFor.split(',')[0]!.trim()
204
- if (firstForward) return firstForward
205
- }
220
+ // Express app compatibility (see "trust proxy" setting)
221
+ if ('ip' in req) {
222
+ const ip = req.ip
223
+ if (typeof ip === 'string') return ip
206
224
  }
207
225
 
208
- return req.socket.remoteAddress
226
+ const ip = req.socket.remoteAddress
227
+ if (ip) return ip
228
+
229
+ throw new Error('Could not determine IP address')
209
230
  }
210
231
 
211
- function extractPort(
212
- req: IncomingMessage,
213
- options?: ExtractRequestMetadataOptions,
214
- ): number | undefined {
215
- if (options?.trustProxy) {
232
+ function extractPort(req: IncomingMessage, ip: string): number {
233
+ if (ip !== req.socket.remoteAddress) {
234
+ // Trust the X-Forwarded-Port header only if the IP address was a trusted
235
+ // proxied IP.
216
236
  const forwardedPort = req.headers['x-forwarded-port']
217
237
  if (typeof forwardedPort === 'string') {
218
238
  const port = Number(forwardedPort.trim())
@@ -223,5 +243,8 @@ function extractPort(
223
243
  }
224
244
  }
225
245
 
226
- return req.socket.remotePort
246
+ const port = req.socket.remotePort
247
+ if (port != null) return port
248
+
249
+ throw new Error('Could not determine port')
227
250
  }
@@ -134,12 +134,12 @@ export {
134
134
  export type RouterOptions<
135
135
  Req extends IncomingMessage = IncomingMessage,
136
136
  Res extends ServerResponse = ServerResponse,
137
- > = DeviceManagerOptions & {
137
+ > = {
138
138
  onError?: (req: Req, res: Res, err: unknown, message: string) => void
139
139
  }
140
140
 
141
141
  export type OAuthProviderOptions = Override<
142
- OAuthVerifierOptions & OAuthHooks,
142
+ OAuthVerifierOptions & OAuthHooks & DeviceManagerOptions,
143
143
  {
144
144
  /**
145
145
  * Maximum age a device/account session can be before requiring
@@ -223,15 +223,15 @@ export type OAuthProviderOptions = Override<
223
223
 
224
224
  export class OAuthProvider extends OAuthVerifier {
225
225
  public readonly metadata: OAuthAuthorizationServerMetadata
226
- public readonly customization?: Customization
227
226
 
228
227
  public readonly authenticationMaxAge: number
229
228
 
230
229
  public readonly accountManager: AccountManager
231
- public readonly deviceStore: DeviceStore
230
+ public readonly deviceManager: DeviceManager
232
231
  public readonly clientManager: ClientManager
233
232
  public readonly requestManager: RequestManager
234
233
  public readonly tokenManager: TokenManager
234
+ public readonly outputManager: OutputManager
235
235
 
236
236
  public constructor({
237
237
  metadata,
@@ -264,7 +264,7 @@ export class OAuthProvider extends OAuthVerifier {
264
264
 
265
265
  loopbackMetadata = atprotoLoopbackClientMetadata,
266
266
 
267
- // OAuthHooks & OAuthVerifierOptions
267
+ // OAuthHooks & OAuthVerifierOptions & DeviceManagerOptions
268
268
  ...rest
269
269
  }: OAuthProviderOptions) {
270
270
  super({ replayStore, redis, ...rest })
@@ -275,10 +275,9 @@ export class OAuthProvider extends OAuthVerifier {
275
275
 
276
276
  this.authenticationMaxAge = authenticationMaxAge
277
277
  this.metadata = buildMetadata(this.issuer, this.keyset, metadata)
278
- this.customization = customization
279
-
280
- this.deviceStore = deviceStore
281
278
 
279
+ this.deviceManager = new DeviceManager(deviceStore, rest)
280
+ this.outputManager = new OutputManager(customization)
282
281
  this.accountManager = new AccountManager(accountStore)
283
282
  this.clientManager = new ClientManager(
284
283
  this.metadata,
@@ -1025,10 +1024,7 @@ export class OAuthProvider extends OAuthVerifier {
1025
1024
  T = void,
1026
1025
  Req extends IncomingMessage = IncomingMessage,
1027
1026
  Res extends ServerResponse = ServerResponse,
1028
- >(options?: RouterOptions<Req, Res>) {
1029
- const deviceManager = new DeviceManager(this.deviceStore, options)
1030
- const outputManager = new OutputManager(this.customization)
1031
-
1027
+ >(options?: RouterOptions<Req, Res>): Router<T, Req, Res> {
1032
1028
  // eslint-disable-next-line @typescript-eslint/no-this-alias
1033
1029
  const server = this
1034
1030
  const issuerUrl = new URL(server.issuer)
@@ -1145,7 +1141,7 @@ export class OAuthProvider extends OAuthVerifier {
1145
1141
  )
1146
1142
 
1147
1143
  if (!res.headersSent) {
1148
- await outputManager.sendErrorPage(res, err)
1144
+ await server.outputManager.sendErrorPage(res, err)
1149
1145
  }
1150
1146
  }
1151
1147
  }
@@ -1252,7 +1248,8 @@ export class OAuthProvider extends OAuthVerifier {
1252
1248
  jsonHandler(async function (req, _res) {
1253
1249
  const payload = await parseHttpRequest(req, ['json', 'urlencoded'])
1254
1250
 
1255
- const clientMetadata = await deviceManager.getRequestMetadata(req)
1251
+ const clientMetadata =
1252
+ await server.deviceManager.getRequestMetadata(req)
1256
1253
 
1257
1254
  const clientCredentials = await oauthClientCredentialsSchema
1258
1255
  .parseAsync(payload, { path: ['body'] })
@@ -1360,7 +1357,10 @@ export class OAuthProvider extends OAuthVerifier {
1360
1357
  .parseAsync(query, { path: ['query'] })
1361
1358
  .catch(throwInvalidRequest)
1362
1359
 
1363
- const { deviceId, deviceMetadata } = await deviceManager.load(req, res)
1360
+ const { deviceId, deviceMetadata } = await server.deviceManager.load(
1361
+ req,
1362
+ res,
1363
+ )
1364
1364
 
1365
1365
  const data = await server
1366
1366
  .authorize(
@@ -1377,7 +1377,7 @@ export class OAuthProvider extends OAuthVerifier {
1377
1377
  }
1378
1378
  case 'authorize' in data: {
1379
1379
  await setupCsrfToken(req, res, csrfCookie(data.authorize.uri))
1380
- return outputManager.sendAuthorizePage(res, data)
1380
+ return server.outputManager.sendAuthorizePage(res, data)
1381
1381
  }
1382
1382
  default: {
1383
1383
  // Should never happen
@@ -1418,7 +1418,7 @@ export class OAuthProvider extends OAuthVerifier {
1418
1418
  csrfCookie(input.request_uri),
1419
1419
  )
1420
1420
 
1421
- const { deviceId } = await deviceManager.load(req, res, true)
1421
+ const { deviceId } = await server.deviceManager.load(req, res, true)
1422
1422
 
1423
1423
  return server.signIn(
1424
1424
  deviceId,
@@ -1471,7 +1471,10 @@ export class OAuthProvider extends OAuthVerifier {
1471
1471
  true,
1472
1472
  )
1473
1473
 
1474
- const { deviceId, deviceMetadata } = await deviceManager.load(req, res)
1474
+ const { deviceId, deviceMetadata } = await server.deviceManager.load(
1475
+ req,
1476
+ res,
1477
+ )
1475
1478
 
1476
1479
  const data = await server
1477
1480
  .acceptRequest(
@@ -1528,7 +1531,7 @@ export class OAuthProvider extends OAuthVerifier {
1528
1531
  true,
1529
1532
  )
1530
1533
 
1531
- const { deviceId } = await deviceManager.load(req, res)
1534
+ const { deviceId } = await server.deviceManager.load(req, res)
1532
1535
 
1533
1536
  const data = await server
1534
1537
  .rejectRequest(deviceId, input.request_uri, input.client_id)