Skip to content

Feat/hash way#3389

Open
qixing-jk wants to merge 4 commits into
notionnext-org:mainfrom
qixing-jk:feat/hash-way
Open

Feat/hash way#3389
qixing-jk wants to merge 4 commits into
notionnext-org:mainfrom
qixing-jk:feat/hash-way

Conversation

@qixing-jk
Copy link
Copy Markdown
Contributor

尽量按此模板PR内容,或粘贴相关的ISSUE链接。

已知问题

  1. md5已经过时,存在问题
  2. 密码使用哈希算法加密 #2620
  3. 原始写入和读取时未考虑携带查询参数和锚点的路径,导致可能会无法自动解锁

具体改动

  1. feat(更改hash方式): hash从md5改为hash256
  2. feat(文章密码): 允许使用SHA256加密后的密码
  3. fix(文章密码存储键): 原始写入和读取时未考虑携带查询参数和锚点的路径,导致可能会无法自动解锁

测试确认

  • 本地开发环境测试通过
  • 生产环境构建测试通过
  • 版本号正确显示
  • 环境变量配置正常工作

qixing-jk added 4 commits May 12, 2025 23:32
因为实现机制的缘故,hash只考虑密码,不再加上path。但也可能会存在误判问题,但应该不会有人设置刚好符合符合特征的密码,所以不增设相关标志位等额外机制

Closes notionnext-org#2620
@vercel
Copy link
Copy Markdown

vercel Bot commented May 12, 2025

@qixing-jk is attempting to deploy a commit to the tangly1024's projects Team on Vercel.

A member of the Team first needs to authorize it.

@tangly1024
Copy link
Copy Markdown
Collaborator

已在当前 main 上按原 PR 意图重做实现(避免直接合并过期分支),并单独开 PR:

要点:文章锁摘要改为 SHA256(明文);校验时 兼容旧版 md5(slug+明文);修复 localStorage 键与 query/hash 不一致导致的自动解锁失败。主题里 Gravatar 邮箱仍用 md5,未随文章锁改为 SHA256(避免破坏头像服务)。

原分支若无需保留,可在审阅 #4022 后关闭本 PR(#3389)。感谢 @qixing-jk 的贡献与思路。

tangly1024 added a commit that referenced this pull request May 9, 2026
- Notion 明文密码同步为 SHA256(hex);支持字段内直接填 64 位 SHA256;保留 32 位 md5 串视为旧摘要\n- 前台校验:同时尝试 SHA256(明文) 与 md5(slug+明文)\n- localStorage 键改为 pathname only,与 getPasswordQuery 一致\n- 新增依赖 js-sha256;Gravatar 等仍使用 md5(email),未改动

Co-authored-by: t <dev@x3game.org>
Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants