VDR v1 / DIDMan v1: guard against silent subject desync when did:web is enabled
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 38/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- go
- Lĩnh vực
- api, backend, documentation, security
Hướng nghiên cứu
Bắt đầu với vdr/api/v1/api.go, didman/api/v1/api.go và vdr/vdr.go để theo dõi việc đăng ký route, các write handler và các DID method đang hoạt động. Xem xét core/server_config.go và các migration test hiện có trước khi chọn và ghi lại hành vi của guard. Công việc được xem là hoàn tất khi policy đã chọn được các test cho việc đọc và ghi v1 bao phủ, migration.rst không còn mơ hồ và release notes đã được cập nhật.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Context
Follow-up from review of #4265 (v5→v6 migration guide). Three review threads from @stevenvegt on the "Mixing VDR v1 and v2 APIs" section converge on one product question: the v1 footgun is currently handled with documentation only, and the docs themselves are ambiguous.
- r3272036014 — wording is ambiguous: reads as "v1 is fine, just don't mix v1+v2", while the deprecation note implies "don't use v1 at all".
- r3272042569 — "If this is a footgun, shouldn't we make either one available by a config param?"
- r3272058944 — "should we disable the didman api's or error/warn when did:web is enabled?"
Problem
When a subject owns more than one DID document — i.e. did:web is enabled alongside did:nuts — VDR v1 / DIDMan v1 writes only touch the did:nuts document. They never propagate to the did:web in the same subject. The two silently desync, and the startup migrations do not repair this on later restarts. Reads compound it: v1 and v2 resolve from different views, so a v1 caller and a v2 caller see different state for the same subject.
Nothing in the node prevents this today. Critically, didmethods is not a guard: it selects which DID methods the node creates and manages per subject — it does not enable or disable the v1/v2 API surface or any specific endpoint. The v1 and DIDMan v1 APIs remain fully callable no matter what didmethods is set to. So an operator on the v6 default (["web", "nuts"]) who keeps scripting against v1 silently desyncs every subject, with no error and no config knob to stop it.
| Subject composition | v1 / DIDMan v1 write | Result |
|---|---|---|
did:nuts only (didmethods=["nuts"]) |
touches the only doc | consistent — v1 use is safe |
did:nuts + did:web (default) |
touches did:nuts only |
did:web silently desyncs from subject; not repaired on restart |
Proposal
Make the node enforce the constraint instead of documenting it. When more than one DID method is active for subjects (web enabled), refuse or warn on v1/DIDMan v1 write operations rather than letting them silently desync the subject.
Options to decide between:
- Hard-disable the v1 VDR + DIDMan v1 write routes when
webis enabled — return404/501or don't register them. Strongest guarantee, but breaks any operator still scripting against v1 during a transition. - Fail writes loud — keep routes registered, but have v1/DIDMan v1 write endpoints return an error (e.g.
409/412) whenwebis enabled, while reads stay available. Lets/internal/vdr/v1/did/conflictedand other read paths keep working during migration. - Warn only — log a
warnon each v1/DIDMan write whenwebis enabled. Lowest friction, weakest protection.
Position: option 2 (fail writes loud, keep reads). Confirmed safe for the migration flow — conflict resolution only reads via v1 (did:nuts state written through v2 lands on the gRPC network, which the v1 read endpoints then surface), so blocking v1 writes doesn't break it. Open for discussion.
Whatever is chosen, also fix the migration-guide wording (r3272036014) so it is unambiguous: v1/DIDMan v1 is deprecated; it is only safe in a single-method (did:nuts-only) deployment; with did:web enabled it must not be used for writes.
Scope
vdr/api/v1/api.go—Wrapper.Routes/ write handlers (CreateDID,AddNewVerificationMethod,DeleteVerificationMethod, etc.); gate on whether more than one method is active.didman/api/v1/api.go—Wrapper.Routes/ write handlers; same gating.vdr/vdr.go:66,139—supportedDIDMethodsis the source of truth for which methods are active (slices.Contains(r.supportedDIDMethods, "web"), cf.vdr/vdr.go:453); expose a check the API wrappers can consume.core/server_config.go:62—DIDMethods(koanf:"didmethods"). Note this currently does not gate any API; a dedicated opt-out (e.g.vdr.enablev1api) could be added if keying off method count is too implicit.docs/pages/deployment/migration.rst— fix the v1 deprecation/footgun wording.- Tests + release notes.
Considerations
- v1 reads stay valid even with
webenabled: a v2 write to thedid:nutsdocument propagates over the gRPC network and is then served by the v1 read endpoints. So only v1 writes desync subjects — reads (GET /internal/vdr/v1/did/conflicted,GET /status/diagnostics) are safe to keep. This is what makes option 2 viable. - Gate implicitly on "is
webactive" vs. an explicitvdr.enablev1apitoggle — implicit needs no new config but couples two concerns; explicit is clearer but adds surface. - v1 / DIDMan v1 are already slated for removal in a future major — is a guard worth building, or just sharpen the docs and accept the footgun until removal?
Related
- Triggering PR/review: #4265 — comments r3272036014, r3272042569, r3272058944
- Migration guide issue: #4257
- Ngôn ngữ chính
- Go
- Star
- 29
- Fork
- 24
- Merge trung bình
- 2 ngày 18 giờ
- Pull request đã merge (30 ngày)
- 45
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Không có hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của nuts-foundation/nuts-node
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
nuts-foundation/nuts-node#4450 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug discuss
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
nuts-foundation/nuts-node#4436 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
auth bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
nuts-foundation/nuts-node#4435 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
nuts-foundation/nuts-node#4321 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
nuts-foundation/nuts-node#4230 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của nuts-foundation/nuts-node
Issue tương tự
-
[BUG] deploy.restart_policy without condition drops the restart policyCó thể đã có người làm @akshat-lakhera đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
docker/compose#14383 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
AvengeMedia/dank-greeter#39 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
dokku/dokku-datastore#367 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug]: ap gateway image build cannot find local policies on WindowsCó thể đã có người làm @Jayzilva đã nhận hôm nay. Đang mởAspect/Configuration Severity/Major
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
wso2/api-platform#3912 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 2 ngày