Align presentation definition filter evaluation with JSON Schema semantics
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
先从 vcr/pe 中的 matchFilter 和 Validate godoc 的 filter-semantics 部分开始,然后将它们与 vcr/pe/schema/v2 下的 vendored JSON Schema validator 进行比较。查看 docs/pages/deployment/policy.rst 中关于 capture-group 的文档,以及 #4253 中与 selection-engine 的关系。完成的标准是确定兼容性方案,更新 validation 和 evaluation 行为,保留或迁移 capture groups,并记录对 release 的影响。
由索引模型根据 Issue 内容生成。
描述
Context
PEX defines a field's filter as a full JSON Schema (our own wire schema declares it as a draft-07 $ref), but matchFilter in vcr/pe implements a subset with semantics that deviate from JSON Schema. The load-time validator added in #4281 documents and flags the consequences (see the filter-semantics section in the Validate godoc), but the underlying evaluation is unchanged. This issue tracks the deliberate decision whether and how to align.
Current deviations
enumshadows every other keyword:type,constandpatternare not evaluated whenenumis set. JSON Schema ANDs all keywords.Filter.ConstandFilter.Enumare string-typed in Go: spec-valid numeric or boolean consts fail at parse with an unmarshal error, and values compare as strings only.patternis only evaluated whentypeis "string"; JSON Schema applies keywords per value type (a number trivially passespattern).- Numeric keywords (
minimum,maximum,multipleOf),minLength,formatand composition (allOf,anyOf,not) are not implemented. Since #4281 they are rejected bype.Validatefor own policy files instead of being silently dropped; remote PDs still parse leniently and match weaker than declared. - Consequence of 1-4: numeric claim values cannot be value-constrained at all. Documented guidance is to issue filterable claims as strings.
Considerations
- The evaluation machinery is already vendored:
santhosh-tekuri/jsonschemavalidates the PD documents themselves (vcr/pe/schema/v2). Filter-level evaluation would be wiring, not a new dependency, and schemas can be compiled once at PD load. - The capture-group value extraction in
matchFilteris a documented feature (docs/pages/deployment/policy.rst, "Extracting substrings with regular expressions") with no JSON Schema counterpart. Any alignment must preserve it or provide a migration. - Changing filter semantics changes live matching behavior for counterparty-supplied PDs as well as own policies; this needs release notes and possibly a compatibility window.
- Ecosystem context: OpenID4VP 1.0 replaces PEX with DCQL. Decision 2026-07-16: PEX field matching stays (DCQL is less expressive for our field-binding use); eventual dual support is an option. That bounds how much to invest here.
Relates to #4253 (the selection engine consumes filter evaluation results; pe.Validate encodes the current semantics and must be updated together with any change here).
- 主要语言
- Go
- 星标
- 29
- 派生
- 24
- 平均合并
- 2 天 18 小时
- 30 天内合并 PR
- 45
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
nuts-foundation/nuts-node 的其他 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 72/100
nuts-foundation/nuts-node#4450 ·
维护者通常 1 天内回复
-
bug discuss
难度 1/5 1 小时以内 新手友好度 88/100
nuts-foundation/nuts-node#4436 ·
维护者通常 1 天内回复
-
auth bug
难度 2/5 1-3 小时 新手友好度 82/100
nuts-foundation/nuts-node#4435 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 72/100
nuts-foundation/nuts-node#4321 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 88/100
nuts-foundation/nuts-node#4230 ·
维护者通常 1 天内回复
查看 nuts-foundation/nuts-node 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 76/100
-
难度 2/5 1-3 小时 新手友好度 67/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 64/100
FiloSottile/age#758 ·
-
nginx config未关闭
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 2 天内回复
-
fix: the buttons mock cannot take back the match point -- its undo looks only for the running match未关闭bug
难度 2/5 1-3 小时 新手友好度 82/100
stuttgart-things/zaehlwerk#168 ·
维护者通常 1 天内回复