Skip to content

The assertSafeIri constraint set is undocumented for integration authors #314

@TomazOT

Description

@TomazOT

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions