@atproto/oauth-provider 0.25.6 → 0.26.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,22 @@
1
1
  # @atproto/oauth-provider
2
2
 
3
+ ## 0.26.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#5919](https://github.com/bluesky-social/atproto/pull/5919) [`8d84a6c`](https://github.com/bluesky-social/atproto/commit/8d84a6cea64c5d0aa064f291b09c3eea2eb61b65) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Upgrade `ioredis` to 6.x. By default, the Redis clients these packages create stay on RESP2 and skip `CLIENT SETINFO` on connect, as with `ioredis` 5, and take `ioredis` 6's other new defaults:
8
+
9
+ - `family` is `0` (was `4`): hostnames resolve to IPv4 or IPv6 addresses, not only IPv4.
10
+ - `retryStrategy` waits 50ms × 2^(attempt − 1), up to 5s, plus up to 200ms of jitter, between reconnection attempts (was 50ms × attempt, up to 2s).
11
+ - `keepAlive` is `30000`: TCP keepalive probes start after 30s of idle (was off).
12
+
13
+ The `redis` option of `OAuthProvider` now expects an `ioredis` 6 `Redis` instance, which is used as is, or `RedisOptions`, which can override these defaults.
14
+
15
+ ### Patch Changes
16
+
17
+ - Updated dependencies []:
18
+ - @atproto/lex-resolver@0.4.6
19
+
3
20
  ## 0.25.6
4
21
 
5
22
  ### Patch Changes
@@ -1 +1 @@
1
- {"version":3,"file":"redis.d.ts","sourceRoot":"","sources":["../../src/lib/redis.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,KAAK,YAAY,EAAE,MAAM,SAAS,CAAA;AAElD,YAAY,EAAE,KAAK,EAAE,YAAY,EAAE,CAAA;AAEnC,MAAM,MAAM,kBAAkB,GAAG,KAAK,GAAG,YAAY,GAAG,MAAM,CAAA;AAE9D,wBAAgB,WAAW,CAAC,OAAO,EAAE,kBAAkB,GAAG,KAAK,CAkB9D"}
1
+ {"version":3,"file":"redis.d.ts","sourceRoot":"","sources":["../../src/lib/redis.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,KAAK,YAAY,EAAE,MAAM,SAAS,CAAA;AAElD,YAAY,EAAE,KAAK,EAAE,YAAY,EAAE,CAAA;AAEnC,MAAM,MAAM,kBAAkB,GAAG,KAAK,GAAG,YAAY,GAAG,MAAM,CAAA;AAQ9D,wBAAgB,WAAW,CAAC,OAAO,EAAE,kBAAkB,GAAG,KAAK,CAmB9D"}
package/dist/lib/redis.js CHANGED
@@ -1,8 +1,14 @@
1
1
  import { Redis } from 'ioredis';
2
+ // @TODO Pins ioredis 5's wire behavior (RESP2, no CLIENT SETINFO on connect)
3
+ // so the ioredis 6 upgrade changes nothing for callers' Redis servers (Redis
4
+ // < 7.2 rejects CLIENT SETINFO). Callers can override it through RedisOptions.
5
+ // Drop this to use ioredis 6's defaults in the next breaking release.
6
+ const REDIS_DEFAULTS = { protocol: 2, disableClientInfo: true };
2
7
  export function createRedis(options) {
3
8
  if (typeof options === 'string') {
4
9
  const url = new URL(options.startsWith('redis://') ? options : `redis://${options}`);
5
10
  return new Redis({
11
+ ...REDIS_DEFAULTS,
6
12
  host: url.hostname,
7
13
  port: parseInt(url.port, 10),
8
14
  password: url.password,
@@ -14,7 +20,7 @@ export function createRedis(options) {
14
20
  return options;
15
21
  }
16
22
  else {
17
- return new Redis(options);
23
+ return new Redis({ ...REDIS_DEFAULTS, ...options });
18
24
  }
19
25
  }
20
26
  //# sourceMappingURL=redis.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"redis.js","sourceRoot":"","sources":["../../src/lib/redis.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAqB,MAAM,SAAS,CAAA;AAMlD,MAAM,UAAU,WAAW,CAAC,OAA2B;IACrD,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;QAChC,MAAM,GAAG,GAAG,IAAI,GAAG,CACjB,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,WAAW,OAAO,EAAE,CAChE,CAAA;QAED,OAAO,IAAI,KAAK,CAAC;YACf,IAAI,EAAE,GAAG,CAAC,QAAQ;YAClB,IAAI,EAAE,QAAQ,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC;YAC5B,QAAQ,EAAE,GAAG,CAAC,QAAQ;SACvB,CAAC,CAAA;IACJ,CAAC;SAAM,IAAI,IAAI,IAAI,OAAO,IAAI,MAAM,IAAI,OAAO,IAAI,KAAK,IAAI,OAAO,EAAE,CAAC;QACpE,4EAA4E;QAC5E,+DAA+D;QAC/D,OAAO,OAAO,CAAA;IAChB,CAAC;SAAM,CAAC;QACN,OAAO,IAAI,KAAK,CAAC,OAAO,CAAC,CAAA;IAC3B,CAAC;AACH,CAAC","sourcesContent":["import { Redis, type RedisOptions } from 'ioredis'\n\nexport type { Redis, RedisOptions }\n\nexport type CreateRedisOptions = Redis | RedisOptions | string\n\nexport function createRedis(options: CreateRedisOptions): Redis {\n if (typeof options === 'string') {\n const url = new URL(\n options.startsWith('redis://') ? options : `redis://${options}`,\n )\n\n return new Redis({\n host: url.hostname,\n port: parseInt(url.port, 10),\n password: url.password,\n })\n } else if ('on' in options && 'call' in options && 'acl' in options) {\n // Not using \"instanceof\" here in case the options is an instance of another\n // version of ioredis (Redis is both a class and an interface).\n return options\n } else {\n return new Redis(options)\n }\n}\n"]}
1
+ {"version":3,"file":"redis.js","sourceRoot":"","sources":["../../src/lib/redis.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAqB,MAAM,SAAS,CAAA;AAMlD,6EAA6E;AAC7E,6EAA6E;AAC7E,+EAA+E;AAC/E,sEAAsE;AACtE,MAAM,cAAc,GAAG,EAAE,QAAQ,EAAE,CAAC,EAAE,iBAAiB,EAAE,IAAI,EAAW,CAAA;AAExE,MAAM,UAAU,WAAW,CAAC,OAA2B;IACrD,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;QAChC,MAAM,GAAG,GAAG,IAAI,GAAG,CACjB,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,WAAW,OAAO,EAAE,CAChE,CAAA;QAED,OAAO,IAAI,KAAK,CAAC;YACf,GAAG,cAAc;YACjB,IAAI,EAAE,GAAG,CAAC,QAAQ;YAClB,IAAI,EAAE,QAAQ,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC;YAC5B,QAAQ,EAAE,GAAG,CAAC,QAAQ;SACvB,CAAC,CAAA;IACJ,CAAC;SAAM,IAAI,IAAI,IAAI,OAAO,IAAI,MAAM,IAAI,OAAO,IAAI,KAAK,IAAI,OAAO,EAAE,CAAC;QACpE,4EAA4E;QAC5E,+DAA+D;QAC/D,OAAO,OAAO,CAAA;IAChB,CAAC;SAAM,CAAC;QACN,OAAO,IAAI,KAAK,CAAC,EAAE,GAAG,cAAc,EAAE,GAAG,OAAO,EAAE,CAAC,CAAA;IACrD,CAAC;AACH,CAAC","sourcesContent":["import { Redis, type RedisOptions } from 'ioredis'\n\nexport type { Redis, RedisOptions }\n\nexport type CreateRedisOptions = Redis | RedisOptions | string\n\n// @TODO Pins ioredis 5's wire behavior (RESP2, no CLIENT SETINFO on connect)\n// so the ioredis 6 upgrade changes nothing for callers' Redis servers (Redis\n// < 7.2 rejects CLIENT SETINFO). Callers can override it through RedisOptions.\n// Drop this to use ioredis 6's defaults in the next breaking release.\nconst REDIS_DEFAULTS = { protocol: 2, disableClientInfo: true } as const\n\nexport function createRedis(options: CreateRedisOptions): Redis {\n if (typeof options === 'string') {\n const url = new URL(\n options.startsWith('redis://') ? options : `redis://${options}`,\n )\n\n return new Redis({\n ...REDIS_DEFAULTS,\n host: url.hostname,\n port: parseInt(url.port, 10),\n password: url.password,\n })\n } else if ('on' in options && 'call' in options && 'acl' in options) {\n // Not using \"instanceof\" here in case the options is an instance of another\n // version of ioredis (Redis is both a class and an interface).\n return options\n } else {\n return new Redis({ ...REDIS_DEFAULTS, ...options })\n }\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atproto/oauth-provider",
3
- "version": "0.25.6",
3
+ "version": "0.26.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": [
@@ -72,7 +72,7 @@
72
72
  "@atproto/jwk": "^0.7.4",
73
73
  "@atproto/jwk-jose": "^0.2.4",
74
74
  "@atproto/lex-document": "^0.1.16",
75
- "@atproto/lex-resolver": "^0.4.5",
75
+ "@atproto/lex-resolver": "^0.4.6",
76
76
  "@atproto/oauth-types": "^0.7.7",
77
77
  "@atproto/oauth-provider-api": "0.11.0",
78
78
  "@atproto/oauth-provider-ui": "0.11.0",
@@ -87,7 +87,7 @@
87
87
  "disposable-email-domains-js": "^1.5.0",
88
88
  "forwarded": "^0.2.0",
89
89
  "http-errors": "^2.0.0",
90
- "ioredis": "^5.3.2",
90
+ "ioredis": "^6.0.0",
91
91
  "jose": "^5.2.0",
92
92
  "zod": "^3.23.8"
93
93
  },