Consider removing ES256K (secp256k1) support

未关闭
#4,399 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
52/100
Issue 类型
重构
描述清晰度
基本清楚
活跃度
冷清
技术栈
go
领域
cryptography

调研方向

先检查 crypto/jwx/jwx_es256k.go 和 crypto/jwx/jwx_es256k_test.go,然后检查 Makefile 的构建目标,以及 vdr/didkey/resolver.go、vcr/credential 和 vcr/pe 中与 ES256K 相关的分支和测试。确认是否有任何活动中的 consumer 需要带标签的路径;完成的标准是删除该路径及其 build-tag 引用并更新相关测试,或者让带标签的 CI 测试能够编译并运行。

由索引模型根据 Issue 内容生成。

描述

Summary

Consider dropping ES256K (secp256k1) support, which is gated behind the jwx_es256k build tag. It appears unused, is not built into the default binary, and carries maintenance cost.

Why

  • Opt-in only, likely unused. ES256K is only compiled when building with -tags jwx_es256k (see Makefile build target and crypto/jwx/jwx_es256k.go). The default binary does not include it. No known deployment enables it.
  • Untested / rotted. CI only builds with the tag, it never runs tests with it, so crypto/jwx/jwx_es256k_test.go has silently rotted:
    • it lives in package jwx but calls ParseJWT, which is in package crypto (would be an import cycle),
    • it passes the wrong number of arguments to ParseJWT,
    • it signs with a P-256 key (test.GenerateECKey()) for a secp256k1 algorithm.
      The test file has therefore not compiled for a long time and nobody noticed.
  • Maintenance cost. It's an extra code path that the jwx v2→v3 migration (#4383 / PR #4391) had to fix separately precisely because it's excluded from the normal build/test, so it's easy to miss.

Options

  1. Remove ES256K support entirely: delete crypto/jwx/jwx_es256k.go + _test.go, drop the jwx_es256k build tag from the Makefile, and remove the es256k/secp256k1 branches in vdr/didkey/resolver.go and the related test cases in vcr/credential, vcr/pe, vdr/didkey.
  2. Keep it but make it real: run the tagged tests in CI and fix the rotted test, so it can't silently break again.

Recommendation

Remove it (option 1) unless someone identifies an active consumer. secp256k1 is niche for did:web/IAM (our active focus), and an untested, build-tag-gated code path is a liability.

Context

Surfaced during the jwx v2→v3 migration (PR #4391): the jwa.ES256K constant→function change was missed initially because the file is excluded from the default build. The build is now fixed; the tagged test remains broken and was left as-is pending this decision.

Assisted by AI

主要语言
Go
星标
29
派生
24
平均合并
1 天 9 小时
30 天内合并 PR
48

环境准备

  • 提供 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 没有贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

nuts-foundation/nuts-node 的其他 Issue

查看 nuts-foundation/nuts-node 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。