From bc833c63049450c01abcfcd89f3d4cb667688bc4 Mon Sep 17 00:00:00 2001 From: Din Date: Fri, 16 Feb 2024 09:36:21 +0700 Subject: [PATCH] wip --- .npmrc | 2 +- SETUP.md | 37 ++++++++++++++++++++++++++++++ package.json | 2 +- pnpm-lock.yaml | 62 +++++++++++++++++++++++++++----------------------- 4 files changed, 73 insertions(+), 30 deletions(-) create mode 100644 SETUP.md diff --git a/.npmrc b/.npmrc index 8864fb2..568ac55 100644 --- a/.npmrc +++ b/.npmrc @@ -1,3 +1,3 @@ -use-node-version = 20.11.0 +use-node-version = 20.11.1 auto-install-peers = true shamefully-hoist = true \ No newline at end of file diff --git a/SETUP.md b/SETUP.md new file mode 100644 index 0000000..028b560 --- /dev/null +++ b/SETUP.md @@ -0,0 +1,37 @@ +# Setup + +## Clerk authentication + +1. Allow organization feature + +2. Create browser-extension JWT template + +- Name: `browser-extension` +- Token lifetime: `604800` seconds +- Claims: + +```json +{ + "org_id": "{{org.id}}", + "org_role": "{{org.role}}", + "org_slug": "{{org.slug}}", + "org_permissions": "{{org_membership.permissions}}" +} +``` + +3. Create a knock JWT template + +- Name: `knock` +- Token lifetime: `86400` seconds +- Custom signing key: `turn on` +- Signing algorithm: `RS256` +- Signing key: get it from `knock` in advanced +- Claims: + +```json +{} +``` + +## Knock notification + +1. Enable `Enhanced security mode` diff --git a/package.json b/package.json index f214a88..7b2af78 100644 --- a/package.json +++ b/package.json @@ -31,6 +31,6 @@ "tsc-alias": "^1.8.8", "turbo": "^1.11.3", "typescript": "^5.3.3", - "wrangler": "^3.23.0" + "wrangler": "^3.28.2" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index df0457a..4779029 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -51,8 +51,8 @@ importers: specifier: ^5.3.3 version: 5.3.3 wrangler: - specifier: ^3.23.0 - version: 3.23.0 + specifier: ^3.28.2 + version: 3.28.2 '@api': dependencies: @@ -2020,8 +2020,8 @@ packages: csstype: 3.1.1 dev: false - /@cloudflare/kv-asset-handler@0.2.0: - resolution: {integrity: sha512-MVbXLbTcAotOPUj0pAMhVtJ+3/kFkwJqc5qNOleOZTv6QkZZABDMS21dSrSlVswEHwrpWC03e4fWytjqKvuE2A==} + /@cloudflare/kv-asset-handler@0.3.1: + resolution: {integrity: sha512-lKN2XCfKCmpKb86a1tl4GIwsJYDy9TGuwjhDELLmpKygQhw8X2xR4dusgpC5Tg7q1pB96Eb0rBo81kxSILQMwA==} dependencies: mime: 3.0.0 dev: true @@ -2035,8 +2035,8 @@ packages: dev: true optional: true - /@cloudflare/workerd-darwin-64@1.20231218.0: - resolution: {integrity: sha512-547gOmTIVmRdDy7HNAGJUPELa+fSDm2Y0OCxqAtQOz0GLTDu1vX61xYmsb2rn91+v3xW6eMttEIpbYokKjtfJA==} + /@cloudflare/workerd-darwin-64@1.20240129.0: + resolution: {integrity: sha512-DfVVB5IsQLVcWPJwV019vY3nEtU88c2Qu2ST5SQxqcGivZ52imagLRK0RHCIP8PK4piSiq90qUC6ybppUsw8eg==} engines: {node: '>=16'} cpu: [x64] os: [darwin] @@ -2053,8 +2053,8 @@ packages: dev: true optional: true - /@cloudflare/workerd-darwin-arm64@1.20231218.0: - resolution: {integrity: sha512-b39qrU1bKolCfmKFDAnX4vXcqzISkEUVE/V8sMBsFzxrIpNAbcUHBZAQPYmS/OHIGB94KjOVokvDi7J6UNurPw==} + /@cloudflare/workerd-darwin-arm64@1.20240129.0: + resolution: {integrity: sha512-t0q8ABkmumG1zRM/MZ/vIv/Ysx0vTAXnQAPy/JW5aeQi/tqrypXkO9/NhPc0jbF/g/hIPrWEqpDgEp3CB7Da7Q==} engines: {node: '>=16'} cpu: [arm64] os: [darwin] @@ -2071,8 +2071,8 @@ packages: dev: true optional: true - /@cloudflare/workerd-linux-64@1.20231218.0: - resolution: {integrity: sha512-dMUF1wA+0mybm6hHNOCgY/WMNMwomPPs4I7vvYCgwHSkch0Q2Wb7TnxQZSt8d1PK/myibaBwadrlIxpjxmpz3w==} + /@cloudflare/workerd-linux-64@1.20240129.0: + resolution: {integrity: sha512-sFV1uobHgDI+6CKBS/ZshQvOvajgwl6BtiYaH4PSFSpvXTmRx+A9bcug+6BnD+V4WgwxTiEO2iR97E1XuwDAVw==} engines: {node: '>=16'} cpu: [x64] os: [linux] @@ -2089,8 +2089,8 @@ packages: dev: true optional: true - /@cloudflare/workerd-linux-arm64@1.20231218.0: - resolution: {integrity: sha512-2s5uc8IHt0QmWyKxAr1Fy+4b8Xy0b/oUtlPnm5MrKi2gDRlZzR7JvxENPJCpCnYENydS8lzvkMiAFECPBccmyQ==} + /@cloudflare/workerd-linux-arm64@1.20240129.0: + resolution: {integrity: sha512-O7q7htHaFRp8PgTqNJx1/fYc3+LnvAo6kWWB9a14C5OWak6AAZk42PNpKPx+DXTmGvI+8S1+futBGUeJ8NPDXg==} engines: {node: '>=16'} cpu: [arm64] os: [linux] @@ -2107,8 +2107,8 @@ packages: dev: true optional: true - /@cloudflare/workerd-windows-64@1.20231218.0: - resolution: {integrity: sha512-oN5hz6TXUDB5YKUN5N3QWAv6cYz9JjTZ9g16HVyoegVFEL6/zXU3tV19MBX2IvlE11ab/mRogEv9KXVIrHfKmA==} + /@cloudflare/workerd-windows-64@1.20240129.0: + resolution: {integrity: sha512-YqGno0XSqqqkDmNoGEX6M8kJlI2lEfWntbTPVtHaZlaXVR9sWfoD7TEno0NKC95cXFz+ioyFLbgbOdnfWwmVAA==} engines: {node: '>=16'} cpu: [x64] os: [win32] @@ -9962,8 +9962,8 @@ packages: - utf-8-validate dev: true - /miniflare@3.20231218.2: - resolution: {integrity: sha512-rCUI2OjqCf3fZVdmSX4DOZQRzSDvHp/oL2vjER/cvJEdWSYiqRxDp2oO7A7JcEo1/Y+kPa5VQ1pFfdZpjBcpFg==} + /miniflare@3.20240129.2: + resolution: {integrity: sha512-BPUg8HsPmWQlRFUeiQk274i8M9L0gOvzbkjryuTvCX+M53EwBpP0gM2wyrRr/HokQoJcxWGh3InBu6L8+0bbPw==} engines: {node: '>=16.13'} hasBin: true dependencies: @@ -9975,7 +9975,7 @@ packages: glob-to-regexp: 0.4.1 stoppable: 1.1.0 undici: 5.28.2 - workerd: 1.20231218.0 + workerd: 1.20240129.0 ws: 8.16.0 youch: 3.3.3 zod: 3.22.4 @@ -13480,6 +13480,7 @@ packages: /workbox-google-analytics@7.0.0: resolution: {integrity: sha512-MEYM1JTn/qiC3DbpvP2BVhyIH+dV/5BjHk756u9VbwuAhu0QHyKscTnisQuz21lfRpOwiS9z4XdqeVAKol0bzg==} + deprecated: It is not compatible with newer versions of GA starting with v4, as long as you are using GAv3 it should be ok, but the package is not longer being maintained dependencies: workbox-background-sync: 7.0.0 workbox-core: 7.0.0 @@ -13558,31 +13559,36 @@ packages: '@cloudflare/workerd-windows-64': 1.20231030.0 dev: true - /workerd@1.20231218.0: - resolution: {integrity: sha512-AGIsDvqCrcwhoA9kb1hxOhVAe53/xJeaGZxL4FbYI9FvO17DZwrnqGq+6eqItJ6Cfw1ZLmf3BM+QdMWaL2bFWQ==} + /workerd@1.20240129.0: + resolution: {integrity: sha512-t4pnsmjjk/u+GdVDgH2M1AFmJaBUABshYK/vT/HNrAXsHSwN6VR8Yqw0JQ845OokO34VLkuUtYQYyxHHKpdtsw==} engines: {node: '>=16'} hasBin: true requiresBuild: true optionalDependencies: - '@cloudflare/workerd-darwin-64': 1.20231218.0 - '@cloudflare/workerd-darwin-arm64': 1.20231218.0 - '@cloudflare/workerd-linux-64': 1.20231218.0 - '@cloudflare/workerd-linux-arm64': 1.20231218.0 - '@cloudflare/workerd-windows-64': 1.20231218.0 + '@cloudflare/workerd-darwin-64': 1.20240129.0 + '@cloudflare/workerd-darwin-arm64': 1.20240129.0 + '@cloudflare/workerd-linux-64': 1.20240129.0 + '@cloudflare/workerd-linux-arm64': 1.20240129.0 + '@cloudflare/workerd-windows-64': 1.20240129.0 dev: true - /wrangler@3.23.0: - resolution: {integrity: sha512-mOWPL02/popoF6jjb4TT8au4yvo8VFu6O6/IwcRN74rlgwaGS0XvlkFtbofBGAdDUHAh5DXkuoPNS871mXNuJg==} + /wrangler@3.28.2: + resolution: {integrity: sha512-hlD4f2avBZuR1+qo9Um6D1prdWrSRtGTo9h6o/AKce+bHQEJWoJgJKHeLmrpZlLtHg/gGR1Xa1xzrexhuIzeJw==} engines: {node: '>=16.17.0'} hasBin: true + peerDependencies: + '@cloudflare/workers-types': ^4.20230914.0 + peerDependenciesMeta: + '@cloudflare/workers-types': + optional: true dependencies: - '@cloudflare/kv-asset-handler': 0.2.0 + '@cloudflare/kv-asset-handler': 0.3.1 '@esbuild-plugins/node-globals-polyfill': 0.2.3(esbuild@0.17.19) '@esbuild-plugins/node-modules-polyfill': 0.2.2(esbuild@0.17.19) blake3-wasm: 2.1.5 chokidar: 3.5.3 esbuild: 0.17.19 - miniflare: 3.20231218.2 + miniflare: 3.20240129.2 nanoid: 3.3.7 path-to-regexp: 6.2.1 resolve: 1.22.8