@atproto/oauth-provider 0.13.3 → 0.13.5

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,29 @@
1
1
  # @atproto/oauth-provider
2
2
 
3
+ ## 0.13.5
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`261968fd6`](https://github.com/bluesky-social/atproto/commit/261968fd65014ded613e2bf085d61a7864b8fba7), [`261968fd6`](https://github.com/bluesky-social/atproto/commit/261968fd65014ded613e2bf085d61a7864b8fba7), [`261968fd6`](https://github.com/bluesky-social/atproto/commit/261968fd65014ded613e2bf085d61a7864b8fba7), [`261968fd6`](https://github.com/bluesky-social/atproto/commit/261968fd65014ded613e2bf085d61a7864b8fba7)]:
8
+ - @atproto/common@0.5.0
9
+ - @atproto/did@0.2.2
10
+ - @atproto/lexicon@0.5.2
11
+ - @atproto/lexicon-resolver@0.2.4
12
+ - @atproto/oauth-scopes@0.2.2
13
+ - @atproto/oauth-types@0.5.1
14
+ - @atproto/oauth-provider-ui@0.3.5
15
+ - @atproto/oauth-provider-api@0.3.3
16
+ - @atproto/oauth-provider-frontend@0.2.4
17
+
18
+ ## 0.13.4
19
+
20
+ ### Patch Changes
21
+
22
+ - [#4301](https://github.com/bluesky-social/atproto/pull/4301) [`f496fa2c4`](https://github.com/bluesky-social/atproto/commit/f496fa2c4d9316229523454c691c75c269aba21e) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Set dark background on authorization page's `<body>` in dark mode
23
+
24
+ - Updated dependencies [[`f496fa2c4`](https://github.com/bluesky-social/atproto/commit/f496fa2c4d9316229523454c691c75c269aba21e)]:
25
+ - @atproto/oauth-provider-ui@0.3.4
26
+
3
27
  ## 0.13.3
4
28
 
5
29
  ### Patch Changes
@@ -1 +1 @@
1
- {"version":3,"file":"send-authorization-page.d.ts","sourceRoot":"","sources":["../../../src/router/assets/send-authorization-page.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAGhE,OAAO,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAA;AAMpE,OAAO,EAAE,gCAAgC,EAAE,MAAM,qDAAqD,CAAA;AAItG,wBAAgB,wBAAwB,CAAC,aAAa,EAAE,aAAa,IAgBjE,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,MAAM,gCAAgC,KACrC,OAAO,CAAC,IAAI,CAAC,CA8BjB"}
1
+ {"version":3,"file":"send-authorization-page.d.ts","sourceRoot":"","sources":["../../../src/router/assets/send-authorization-page.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAGhE,OAAO,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAA;AAMpE,OAAO,EAAE,gCAAgC,EAAE,MAAM,qDAAqD,CAAA;AAItG,wBAAgB,wBAAwB,CAAC,aAAa,EAAE,aAAa,IAgBjE,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,MAAM,gCAAgC,KACrC,OAAO,CAAC,IAAI,CAAC,CAiCjB"}
@@ -41,6 +41,9 @@ function sendAuthorizePageFactory(customization) {
41
41
  return (0, send_web_page_js_1.sendWebPage)(res, {
42
42
  meta: [{ name: 'robots', content: 'noindex' }],
43
43
  body: (0, index_js_2.html) `<div id="root"></div>`,
44
+ bodyAttrs: {
45
+ class: 'bg-white text-slate-900 dark:bg-slate-900 dark:text-slate-100',
46
+ },
44
47
  csp,
45
48
  coep,
46
49
  scripts: [script, ...scripts],
@@ -1 +1 @@
1
- {"version":3,"file":"send-authorization-page.js","sourceRoot":"","sources":["../../../src/router/assets/send-authorization-page.ts"],"names":[],"mappings":";;AAaA,4DAiDC;AA7DD,+FAAsF;AACtF,iGAAwF;AAExF,qDAAiD;AACjD,wEAAuE;AACvE,sDAAuD;AACvD,4EAA8E;AAC9E,iEAAwD;AAExD,2CAA6E;AAC7E,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,UAAU;gBACrC,cAAc,EAAE,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,cAAc,CAAC;aACxD;YACD,UAAU,EAAE,IAAI,CAAC,QAAQ;SAC1B,CAAC,CAAA;QAEF,OAAO,IAAA,8BAAW,EAAC,GAAG,EAAE;YACtB,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC;YAC9C,IAAI,EAAE,IAAA,eAAI,EAAA,uBAAuB;YACjC,GAAG;YACH,IAAI;YACJ,OAAO,EAAE,CAAC,MAAM,EAAE,GAAG,OAAO,CAAC;YAC7B,MAAM,EAAE,CAAC,GAAG,MAAM,EAAE,gBAAgB,CAAC;SACtC,CAAC,CAAA;IACJ,CAAC,CAAA;AACH,CAAC","sourcesContent":["import type { IncomingMessage, ServerResponse } from 'node:http'\nimport { buildCustomizationCss } from '../../customization/build-customization-css.js'\nimport { buildCustomizationData } from '../../customization/build-customization-data.js'\nimport { Customization } from '../../customization/customization.js'\nimport { mergeCsp } from '../../lib/csp/index.js'\nimport { declareHydrationData } from '../../lib/html/hydration-data.js'\nimport { cssCode, html } from '../../lib/html/index.js'\nimport { CrossOriginEmbedderPolicy } from '../../lib/http/security-headers.js'\nimport { sendWebPage } from '../../lib/send-web-page.js'\nimport { AuthorizationResultAuthorizePage } from '../../result/authorization-result-authorize-page.js'\nimport { HCAPTCHA_CSP, HydrationData, SPA_CSP, getAssets } from './assets.js'\nimport { setupCsrfToken } from './csrf.js'\n\nexport function sendAuthorizePageFactory(customization: Customization) {\n // Pre-computed options:\n const customizationData = buildCustomizationData(customization)\n const customizationCss = cssCode(buildCustomizationCss(customization))\n const { scripts, styles } = getAssets('authorization-page')\n const csp = mergeCsp(\n SPA_CSP,\n customization?.hcaptcha ? HCAPTCHA_CSP : undefined,\n )\n const coep = customization?.hcaptcha\n ? // https://github.com/hCaptcha/react-hcaptcha/issues/259\n // @TODO Remove the use of `unsafeNone` once the issue above is resolved\n CrossOriginEmbedderPolicy.unsafeNone\n : CrossOriginEmbedderPolicy.credentialless\n\n return async function sendAuthorizePage(\n req: IncomingMessage,\n res: ServerResponse,\n data: AuthorizationResultAuthorizePage,\n ): Promise<void> {\n await setupCsrfToken(req, res)\n\n const script = declareHydrationData<HydrationData['authorization-page']>({\n __customizationData: customizationData,\n __authorizeData: {\n requestUri: data.requestUri,\n\n clientId: data.client.id,\n clientMetadata: data.client.metadata,\n clientTrusted: data.client.info.isTrusted,\n clientFirstParty: data.client.info.isFirstParty,\n\n scope: data.parameters.scope,\n uiLocales: data.parameters.ui_locales,\n loginHint: data.parameters.login_hint,\n permissionSets: Object.fromEntries(data.permissionSets),\n },\n __sessions: data.sessions,\n })\n\n return sendWebPage(res, {\n meta: [{ name: 'robots', content: 'noindex' }],\n body: html`<div id=\"root\"></div>`,\n csp,\n coep,\n scripts: [script, ...scripts],\n styles: [...styles, customizationCss],\n })\n }\n}\n"]}
1
+ {"version":3,"file":"send-authorization-page.js","sourceRoot":"","sources":["../../../src/router/assets/send-authorization-page.ts"],"names":[],"mappings":";;AAaA,4DAoDC;AAhED,+FAAsF;AACtF,iGAAwF;AAExF,qDAAiD;AACjD,wEAAuE;AACvE,sDAAuD;AACvD,4EAA8E;AAC9E,iEAAwD;AAExD,2CAA6E;AAC7E,uCAA0C;AAE1C,SAAgB,wBAAwB,CAAC,aAA4B;IACnE,wBAAwB;IACxB,MAAM,iBAAiB,GAAG,IAAA,oDAAsB,EAAC,aAAa,CAAC,CAAA;IAC/D,MAAM,gBAAgB,GAAG,IAAA,kBAAO,EAAC,IAAA,kDAAqB,EAAC,aAAa,CAAC,CAAC,CAAA;IACtE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,IAAA,qBAAS,EAAC,oBAAoB,CAAC,CAAA;IAC3D,MAAM,GAAG,GAAG,IAAA,mBAAQ,EAClB,mBAAO,EACP,aAAa,EAAE,QAAQ,CAAC,CAAC,CAAC,wBAAY,CAAC,CAAC,CAAC,SA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AAO,CAAC;YAC7B,MAAM,EAAE,CAAC,GAAG,MAAM,EAAE,gBAAgB,CAAC;SACtC,CAAC,CAAA;IACJ,CAAC,CAAA;AACH,CAAC","sourcesContent":["import type { IncomingMessage, ServerResponse } from 'node:http'\nimport { buildCustomizationCss } from '../../customization/build-customization-css.js'\nimport { buildCustomizationData } from '../../customization/build-customization-data.js'\nimport { Customization } from '../../customization/customization.js'\nimport { mergeCsp } from '../../lib/csp/index.js'\nimport { declareHydrationData } from '../../lib/html/hydration-data.js'\nimport { cssCode, html } from '../../lib/html/index.js'\nimport { CrossOriginEmbedderPolicy } from '../../lib/http/security-headers.js'\nimport { sendWebPage } from '../../lib/send-web-page.js'\nimport { AuthorizationResultAuthorizePage } from '../../result/authorization-result-authorize-page.js'\nimport { HCAPTCHA_CSP, HydrationData, SPA_CSP, getAssets } from './assets.js'\nimport { setupCsrfToken } from './csrf.js'\n\nexport function sendAuthorizePageFactory(customization: Customization) {\n // Pre-computed options:\n const customizationData = buildCustomizationData(customization)\n const customizationCss = cssCode(buildCustomizationCss(customization))\n const { scripts, styles } = getAssets('authorization-page')\n const csp = mergeCsp(\n SPA_CSP,\n customization?.hcaptcha ? HCAPTCHA_CSP : undefined,\n )\n const coep = customization?.hcaptcha\n ? // https://github.com/hCaptcha/react-hcaptcha/issues/259\n // @TODO Remove the use of `unsafeNone` once the issue above is resolved\n CrossOriginEmbedderPolicy.unsafeNone\n : CrossOriginEmbedderPolicy.credentialless\n\n return async function sendAuthorizePage(\n req: IncomingMessage,\n res: ServerResponse,\n data: AuthorizationResultAuthorizePage,\n ): Promise<void> {\n await setupCsrfToken(req, res)\n\n const script = declareHydrationData<HydrationData['authorization-page']>({\n __customizationData: customizationData,\n __authorizeData: {\n requestUri: data.requestUri,\n\n clientId: data.client.id,\n clientMetadata: data.client.metadata,\n clientTrusted: data.client.info.isTrusted,\n clientFirstParty: data.client.info.isFirstParty,\n\n scope: data.parameters.scope,\n uiLocales: data.parameters.ui_locales,\n loginHint: data.parameters.login_hint,\n permissionSets: Object.fromEntries(data.permissionSets),\n },\n __sessions: data.sessions,\n })\n\n return sendWebPage(res, {\n meta: [{ name: 'robots', content: 'noindex' }],\n body: html`<div id=\"root\"></div>`,\n bodyAttrs: {\n class: 'bg-white text-slate-900 dark:bg-slate-900 dark:text-slate-100',\n },\n csp,\n coep,\n scripts: [script, ...scripts],\n styles: [...styles, customizationCss],\n })\n }\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atproto/oauth-provider",
3
- "version": "0.13.3",
3
+ "version": "0.13.5",
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": [
@@ -47,18 +47,18 @@
47
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/common": "^0.4.12",
51
- "@atproto/did": "0.2.1",
50
+ "@atproto/common": "^0.5.0",
51
+ "@atproto/did": "0.2.2",
52
52
  "@atproto/jwk": "0.6.0",
53
53
  "@atproto/jwk-jose": "0.1.11",
54
- "@atproto/lexicon": "0.5.1",
55
- "@atproto/lexicon-resolver": "0.2.3",
56
- "@atproto/oauth-types": "0.5.0",
57
- "@atproto/oauth-provider-api": "0.3.2",
58
- "@atproto/oauth-provider-frontend": "0.2.3",
59
- "@atproto/oauth-provider-ui": "0.3.3",
60
- "@atproto/oauth-scopes": "0.2.1",
61
- "@atproto/syntax": "0.4.1"
54
+ "@atproto/lexicon": "0.5.2",
55
+ "@atproto/oauth-types": "0.5.1",
56
+ "@atproto/oauth-provider-api": "0.3.3",
57
+ "@atproto/oauth-provider-ui": "0.3.5",
58
+ "@atproto/oauth-scopes": "0.2.2",
59
+ "@atproto/oauth-provider-frontend": "0.2.4",
60
+ "@atproto/syntax": "0.4.1",
61
+ "@atproto/lexicon-resolver": "0.2.4"
62
62
  },
63
63
  "devDependencies": {
64
64
  "@types/cookie": "^0.6.0",
@@ -54,6 +54,9 @@ export function sendAuthorizePageFactory(customization: Customization) {
54
54
  return sendWebPage(res, {
55
55
  meta: [{ name: 'robots', content: 'noindex' }],
56
56
  body: html`<div id="root"></div>`,
57
+ bodyAttrs: {
58
+ class: 'bg-white text-slate-900 dark:bg-slate-900 dark:text-slate-100',
59
+ },
57
60
  csp,
58
61
  coep,
59
62
  scripts: [script, ...scripts],