Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Align presentation definition filter evaluation with JSON Schema semantics

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

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
35/100
Issue 类型
功能
描述清晰度
需要澄清
活跃度
冷清
技术栈
go
领域
backend

调研方向

先从 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

  1. enum shadows every other keyword: type, const and pattern are not evaluated when enum is set. JSON Schema ANDs all keywords.
  2. Filter.Const and Filter.Enum are string-typed in Go: spec-valid numeric or boolean consts fail at parse with an unmarshal error, and values compare as strings only.
  3. pattern is only evaluated when type is "string"; JSON Schema applies keywords per value type (a number trivially passes pattern).
  4. Numeric keywords (minimum, maximum, multipleOf), minLength, format and composition (allOf, anyOf, not) are not implemented. Since #4281 they are rejected by pe.Validate for own policy files instead of being silently dropped; remote PDs still parse leniently and match weaker than declared.
  5. 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/jsonschema validates 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 matchFilter is 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 模板
  • 没有贡献指南

从这里开始

  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 摘要。