Upgrade nanoid and openid-client
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
- Issue 类型
- 重构
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- javascript, node.js
- 领域
- backend
调研方向
从 app/lib/authn-oidc.js 开始,检查 openid-client 的加载方式,然后使用 npm list 查看依赖版本。确定在服务保持为 CommonJS 的情况下是否可以升级这两个依赖,或者是否需要合适的替代方案。完成的标准是所选版本能够在不出现 ERR_REQUIRE_ESM 的情况下运行,并保留现有的身份验证行为。
由索引模型根据 Issue 内容生成。
描述
The latest releases of these two dependencies default to ECMAScript syntax rather than CommonJS. We're not using a transpiler like Babel to handle converting between different JS flavors, and ideally we shouldn't have to until we're ready for a TS migration.
Figure out a way to upgrade these dependencies while still using CommonJS, or find suitable alternatives. nanoid specifies a solution for CommonJS (link below). I'm not sure about openid-client.
NanoID
After version 3, CommonJS support is mostly dropped in favor of ESM:
https://github.com/ai/nanoid?tab=readme-ov-file#commonjs
Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/ssica/Development/attack/workbench/attack-workbench-rest-api/node_modules/openid-client/build/index.js from /Users/ssica/Development/attack/workbench/attack-workbench-rest-api/app/lib/authn-oidc.js not supported.
Instead change the require of index.js in /Users/ssica/Development/attack/workbench/attack-workbench-rest-api/app/lib/authn-oidc.js to a dynamic import() which is available in all CommonJS modules.
For now, downgraded back to 3x:
❯ npm list | grep nanoid
├── [email protected]
❯ npm install nanoid@3
changed 1 package, and audited 654 packages in 667ms
89 packages are looking for funding
run `npm fund` for details
3 vulnerabilities (2 low, 1 high)
To address all issues, run:
npm audit fix
Run `npm audit` for details.
❯ npm list | grep nanoid
├── [email protected]
OpenID-Client
Same thing with openid-client -- v6 moves to ESM:
Downgraded:
❯ npm list | grep openid
├── [email protected]
❯ npm install openid-client@5
added 2 packages, removed 2 packages, changed 1 package, and audited 654 packages in 968ms
87 packages are looking for funding
run `npm fund` for details
3 vulnerabilities (2 low, 1 high)
To address all issues, run:
npm audit fix
Run `npm audit` for details.
❯ npm list | grep openid
├── [email protected]
- 主要语言
- JavaScript
- 星标
- 56
- 派生
- 18
- 平均合并
- 21 小时 30 分钟
- 30 天内合并 PR
- 8
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
mitre-attack/attack-workbench-rest-api 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 85/100
-
难度 2/5 1-3 小时 新手友好度 86/100
-
难度 2/5 1-3 小时 新手友好度 86/100
-
Add ADM validation bypass for server-controlled fields on non-compliant objects可能已有人在做 @seansica 于 8 天前认领。 未关闭
mitre-attack/attack-workbench-rest-api#517 · 已指派 1 人 ·
-
难度 3/5 1-2 天 新手友好度 74/100
mitre-attack/attack-workbench-rest-api#512 · 1 条评论 ·
查看 mitre-attack/attack-workbench-rest-api 的全部 Issue
相似的 Issue
-
routine:ci-review
难度 2/5 1-3 小时 新手友好度 66/100
harlan-zw/unlighthouse#456 · 1 条评论 ·
维护者通常 1 天内回复
-
beginner enhancement good first issue
难度 2/5 1-3 小时 新手友好度 82/100
philaconvalley/website#217 ·
维护者通常 1 天内回复
-
bug confirmed issue
难度 2/5 1-3 小时 新手友好度 70/100
open-webui/open-webui#32896 · 2 条评论 ·
维护者通常 1 天内回复
-
⚠ needs intervention document not found
难度 2/5 1-3 小时 新手友好度 68/100
OpenTermsArchive/contrib-declarations#4151 ·
维护者通常 1 天内回复
-
correction via-web
难度 2/5 1-3 小时 新手友好度 67/100
ch-bas/cctv-camera-database#416 ·
维护者通常 1 天内回复