@atproto/oauth-provider 0.16.1 → 0.16.3

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,21 @@
1
1
  # @atproto/oauth-provider
2
2
 
3
+ ## 0.16.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [#4880](https://github.com/bluesky-social/atproto/pull/4880) [`5d3e248`](https://github.com/bluesky-social/atproto/commit/5d3e248c262f45e3ca471d8d2381830a4cd896ae) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Fix `/.well-known/change-password` page
8
+
9
+ - Updated dependencies [[`5d3e248`](https://github.com/bluesky-social/atproto/commit/5d3e248c262f45e3ca471d8d2381830a4cd896ae)]:
10
+ - @atproto/oauth-provider-ui@0.5.2
11
+
12
+ ## 0.16.2
13
+
14
+ ### Patch Changes
15
+
16
+ - Updated dependencies [[`84eb5ed`](https://github.com/bluesky-social/atproto/commit/84eb5ed95d145870a85ea380df3edf6c591c6310)]:
17
+ - @atproto/oauth-provider-ui@0.5.1
18
+
3
19
  ## 0.16.1
4
20
 
5
21
  ### Patch Changes
@@ -14,7 +14,7 @@ function createAccountPageMiddleware(server, { onError }) {
14
14
  const sendErrorPage = (0, send_error_page_js_1.sendErrorPageFactory)(server.customization, securityOptions);
15
15
  const router = new index_js_1.Router(issuerUrl);
16
16
  // Create password reset discovery endpoint
17
- // https://w3c.github.io/webappsec-change-password-url/
17
+ // https://www.w3.org/TR/change-password-url/
18
18
  router.get('/.well-known/change-password', (_req, res) => {
19
19
  (0, index_js_1.writeRedirect)(res, new URL('/account/reset-password', issuerUrl).toString());
20
20
  });
@@ -1 +1 @@
1
- {"version":3,"file":"create-account-page-middleware.js","sourceRoot":"","sources":["../../src/router/create-account-page-middleware.ts"],"names":[],"mappings":";;AAgBA,kEAuEC;AArFD,mDAO6B;AAG7B,wEAAsE;AACtE,oEAAkE;AAGlE,SAAgB,2BAA2B,CAKzC,MAAq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AAE,YAAY,CAAC,CAAA;YAEjC,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;YAC9D,MAAM,cAAc,GAClB,MAAM,MAAM,CAAC,cAAc,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAA;YAE1D,eAAe,CAAC,GAAG,EAAE,GAAG,EAAE;gBACxB,cAAc,EAAE,cAAc,CAAC,GAAG,CAChC,CAAC,aAAa,EAAuB,EAAE,CAAC,CAAC;oBACvC,OAAO,EAAE,aAAa,CAAC,OAAO;oBAC9B,aAAa,EAAE,MAAM,CAAC,kBAAkB,CAAC,aAAa,CAAC;iBACxD,CAAC,CACH;aACF,CAAC,CAAA;QACJ,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,EAAE,CACP,GAAG,EACH,GAAG,EACH,GAAG,EACH,2CAA2C,GAAG,CAAC,GAAG,GAAG,CACtD,CAAA;YAED,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC;gBACrB,OAAO,aAAa,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA;YACrC,CAAC;QACH,CAAC;IACH,CAAC,CAAC,CAAA;IAEF,OAAO,MAAM,CAAC,eAAe,EAAE,CAAA;AACjC,CAAC","sourcesContent":["import type { IncomingMessage, ServerResponse } from 'node:http'\nimport type { ActiveDeviceSession } from '@atproto/oauth-provider-api'\nimport {\n Middleware,\n Router,\n validateFetchDest,\n validateFetchMode,\n validateOrigin,\n writeRedirect,\n} from '../lib/http/index.js'\nimport { SecurityHeadersOptions } from '../lib/http/security-headers.js'\nimport type { OAuthProvider } from '../oauth-provider.js'\nimport { sendAccountPageFactory } from './assets/send-account-page.js'\nimport { sendErrorPageFactory } from './assets/send-error-page.js'\nimport type { MiddlewareOptions } from './middleware-options.js'\n\nexport function createAccountPageMiddleware<\n Ctx extends object | void = void,\n Req extends IncomingMessage = IncomingMessage,\n Res extends ServerResponse = ServerResponse,\n>(\n server: OAuthProvider,\n { onError }: MiddlewareOptions<Req, Res>,\n): Middleware<Ctx, Req, Res> {\n const issuerUrl = new URL(server.issuer)\n const issuerOrigin = issuerUrl.origin\n\n const securityOptions: SecurityHeadersOptions = {\n hsts: issuerUrl.protocol === 'http:' ? false : undefined,\n }\n\n const sendAccountPage = sendAccountPageFactory(\n server.customization,\n securityOptions,\n )\n const sendErrorPage = sendErrorPageFactory(\n server.customization,\n securityOptions,\n )\n\n const router = new Router<Ctx, Req, Res>(issuerUrl)\n\n // Create password reset discovery endpoint\n // https://w3c.github.io/webappsec-change-password-url/\n router.get('/.well-known/change-password', (_req, res) => {\n writeRedirect(res, new URL('/account/reset-password', issuerUrl).toString())\n })\n\n // Create frontend account pages\n router.get<never>(/^\\/account(?:\\/.*)?$/, async function (req, res) {\n try {\n res.setHeader('Referrer-Policy', 'same-origin')\n\n res.setHeader('Cache-Control', 'no-store')\n res.setHeader('Pragma', 'no-cache')\n\n validateFetchMode(req, ['navigate'])\n validateFetchDest(req, ['document'])\n validateOrigin(req, issuerOrigin)\n\n const { deviceId } = await server.deviceManager.load(req, res)\n const deviceAccounts =\n await server.accountManager.listDeviceAccounts(deviceId)\n\n sendAccountPage(req, res, {\n deviceSessions: deviceAccounts.map(\n (deviceAccount): ActiveDeviceSession => ({\n account: deviceAccount.account,\n loginRequired: server.checkLoginRequired(deviceAccount),\n }),\n ),\n })\n } catch (err) {\n onError?.(\n req,\n res,\n err,\n `Failed to handle navigation request to \"${req.url}\"`,\n )\n\n if (!res.headersSent) {\n return sendErrorPage(req, res, err)\n }\n }\n })\n\n return router.buildMiddleware()\n}\n"]}
1
+ {"version":3,"file":"create-account-page-middleware.js","sourceRoot":"","sources":["../../src/router/create-account-page-middleware.ts"],"names":[],"mappings":";;AAgBA,kEAuEC;AArFD,mDAO6B;AAG7B,wEAAsE;AACtE,oEAAkE;AAGlE,SAAgB,2BAA2B,CAKzC,MAAqB,EACrB,EAA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CAAC,CAAA;YAEjC,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;YAC9D,MAAM,cAAc,GAClB,MAAM,MAAM,CAAC,cAAc,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAA;YAE1D,eAAe,CAAC,GAAG,EAAE,GAAG,EAAE;gBACxB,cAAc,EAAE,cAAc,CAAC,GAAG,CAChC,CAAC,aAAa,EAAuB,EAAE,CAAC,CAAC;oBACvC,OAAO,EAAE,aAAa,CAAC,OAAO;oBAC9B,aAAa,EAAE,MAAM,CAAC,kBAAkB,CAAC,aAAa,CAAC;iBACxD,CAAC,CACH;aACF,CAAC,CAAA;QACJ,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,EAAE,CACP,GAAG,EACH,GAAG,EACH,GAAG,EACH,2CAA2C,GAAG,CAAC,GAAG,GAAG,CACtD,CAAA;YAED,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC;gBACrB,OAAO,aAAa,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA;YACrC,CAAC;QACH,CAAC;IACH,CAAC,CAAC,CAAA;IAEF,OAAO,MAAM,CAAC,eAAe,EAAE,CAAA;AACjC,CAAC","sourcesContent":["import type { IncomingMessage, ServerResponse } from 'node:http'\nimport type { ActiveDeviceSession } from '@atproto/oauth-provider-api'\nimport {\n Middleware,\n Router,\n validateFetchDest,\n validateFetchMode,\n validateOrigin,\n writeRedirect,\n} from '../lib/http/index.js'\nimport { SecurityHeadersOptions } from '../lib/http/security-headers.js'\nimport type { OAuthProvider } from '../oauth-provider.js'\nimport { sendAccountPageFactory } from './assets/send-account-page.js'\nimport { sendErrorPageFactory } from './assets/send-error-page.js'\nimport type { MiddlewareOptions } from './middleware-options.js'\n\nexport function createAccountPageMiddleware<\n Ctx extends object | void = void,\n Req extends IncomingMessage = IncomingMessage,\n Res extends ServerResponse = ServerResponse,\n>(\n server: OAuthProvider,\n { onError }: MiddlewareOptions<Req, Res>,\n): Middleware<Ctx, Req, Res> {\n const issuerUrl = new URL(server.issuer)\n const issuerOrigin = issuerUrl.origin\n\n const securityOptions: SecurityHeadersOptions = {\n hsts: issuerUrl.protocol === 'http:' ? false : undefined,\n }\n\n const sendAccountPage = sendAccountPageFactory(\n server.customization,\n securityOptions,\n )\n const sendErrorPage = sendErrorPageFactory(\n server.customization,\n securityOptions,\n )\n\n const router = new Router<Ctx, Req, Res>(issuerUrl)\n\n // Create password reset discovery endpoint\n // https://www.w3.org/TR/change-password-url/\n router.get('/.well-known/change-password', (_req, res) => {\n writeRedirect(res, new URL('/account/reset-password', issuerUrl).toString())\n })\n\n // Create frontend account pages\n router.get<never>(/^\\/account(?:\\/.*)?$/, async function (req, res) {\n try {\n res.setHeader('Referrer-Policy', 'same-origin')\n\n res.setHeader('Cache-Control', 'no-store')\n res.setHeader('Pragma', 'no-cache')\n\n validateFetchMode(req, ['navigate'])\n validateFetchDest(req, ['document'])\n validateOrigin(req, issuerOrigin)\n\n const { deviceId } = await server.deviceManager.load(req, res)\n const deviceAccounts =\n await server.accountManager.listDeviceAccounts(deviceId)\n\n sendAccountPage(req, res, {\n deviceSessions: deviceAccounts.map(\n (deviceAccount): ActiveDeviceSession => ({\n account: deviceAccount.account,\n loginRequired: server.checkLoginRequired(deviceAccount),\n }),\n ),\n })\n } catch (err) {\n onError?.(\n req,\n res,\n err,\n `Failed to handle navigation request to \"${req.url}\"`,\n )\n\n if (!res.headersSent) {\n return sendErrorPage(req, res, err)\n }\n }\n })\n\n return router.buildMiddleware()\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atproto/oauth-provider",
3
- "version": "0.16.1",
3
+ "version": "0.16.3",
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": [
@@ -43,19 +43,19 @@
43
43
  "jose": "^5.2.0",
44
44
  "zod": "^3.23.8",
45
45
  "@atproto-labs/fetch": "^0.2.3",
46
- "@atproto-labs/pipe": "^0.1.1",
47
46
  "@atproto-labs/fetch-node": "^0.2.0",
47
+ "@atproto-labs/pipe": "^0.1.1",
48
48
  "@atproto-labs/simple-store": "^0.3.0",
49
49
  "@atproto-labs/simple-store-memory": "^0.1.4",
50
- "@atproto/jwk": "^0.6.0",
51
50
  "@atproto/common": "^0.5.16",
51
+ "@atproto/did": "^0.3.0",
52
+ "@atproto/jwk": "^0.6.0",
52
53
  "@atproto/jwk-jose": "^0.1.11",
53
- "@atproto/oauth-types": "^0.6.3",
54
54
  "@atproto/lex-document": "^0.0.20",
55
55
  "@atproto/lex-resolver": "^0.0.22",
56
+ "@atproto/oauth-types": "^0.6.3",
56
57
  "@atproto/oauth-provider-api": "0.4.0",
57
- "@atproto/oauth-provider-ui": "0.5.0",
58
- "@atproto/did": "^0.3.0",
58
+ "@atproto/oauth-provider-ui": "0.5.2",
59
59
  "@atproto/oauth-scopes": "^0.3.2",
60
60
  "@atproto/syntax": "^0.5.4"
61
61
  },
@@ -41,7 +41,7 @@ export function createAccountPageMiddleware<
41
41
  const router = new Router<Ctx, Req, Res>(issuerUrl)
42
42
 
43
43
  // Create password reset discovery endpoint
44
- // https://w3c.github.io/webappsec-change-password-url/
44
+ // https://www.w3.org/TR/change-password-url/
45
45
  router.get('/.well-known/change-password', (_req, res) => {
46
46
  writeRedirect(res, new URL('/account/reset-password', issuerUrl).toString())
47
47
  })