Affected: packages/core/src/constants.ts — functions assertSafeIri, validateAssertionName, validateSubGraphName
Verified against: main @ 13a70642
Summary
The validator functions in core/src/constants.ts enforce IRI safety constraints (no spaces, no angle brackets, no quotes, no curly braces, no pipe, no caret, no backslash, no backtick, max 256 chars, etc.). They throw on violation, and the daemon routes rethrow the message as a 400. An integration author writing assertion names or subject IRIs has no public reference for these constraints.
We hit one in passing: arXiv IDs contain . (e.g. 2604.22750). The . happens to be safe, but we second-guessed it and converted to - defensively. A documented set of allowed characters would have saved that round.
Suggested fix
- Export the constraint set as documented constants from
@origintrail-official/dkg-core (or describe them in a doc page).
- Document the allowed character class for assertion names, subgraph names, and quad-subject IRIs in the assertion-API route comments.
Affected:
packages/core/src/constants.ts— functionsassertSafeIri,validateAssertionName,validateSubGraphNameVerified against:
main@13a70642Summary
The validator functions in
core/src/constants.tsenforce IRI safety constraints (no spaces, no angle brackets, no quotes, no curly braces, no pipe, no caret, no backslash, no backtick, max 256 chars, etc.). They throw on violation, and the daemon routes rethrow the message as a 400. An integration author writing assertion names or subject IRIs has no public reference for these constraints.We hit one in passing: arXiv IDs contain
.(e.g.2604.22750). The.happens to be safe, but we second-guessed it and converted to-defensively. A documented set of allowed characters would have saved that round.Suggested fix
@origintrail-official/dkg-core(or describe them in a doc page).