Skip to content

Conversation

@leifj
Copy link
Contributor

@leifj leifj commented Nov 25, 2025

  • Add validation package (pkg/sdjwtvc/validation.go) with comprehensive document validation against VCTM schema

  • Validate mandatory claims presence and structure

  • Support nested claim paths and array values

  • Provide detailed field-level error messages

  • Auto-allow standard JWT claims (iss, exp, vct, cnf, etc.)

  • Support strict/non-strict validation modes

  • Integrate validation into MakeSDJWT() handler before BuildCredential()

  • Prevents invalid credentials from being signed

  • Returns clear error messages to API clients

  • Add comprehensive test coverage:

    • 13 validation unit tests (success/error cases, nested claims, strict mode)
    • 4 integration tests verifying end-to-end validation
  • Update test infrastructure:

    • Add mandatory family_name claim to test VCTM
    • Update mock test data for EHIC, PID, and Diploma credentials

All tests passing (12 test suites, 0.148s execution time).

- Add validation package (pkg/sdjwtvc/validation.go) with comprehensive
  document validation against VCTM schema
- Validate mandatory claims presence and structure
- Support nested claim paths and array values
- Provide detailed field-level error messages
- Auto-allow standard JWT claims (iss, exp, vct, cnf, etc.)
- Support strict/non-strict validation modes

- Integrate validation into MakeSDJWT() handler before BuildCredential()
- Prevents invalid credentials from being signed
- Returns clear error messages to API clients

- Add comprehensive test coverage:
  * 13 validation unit tests (success/error cases, nested claims, strict mode)
  * 4 integration tests verifying end-to-end validation

- Update test infrastructure:
  * Add mandatory family_name claim to test VCTM
  * Update mock test data for EHIC, PID, and Diploma credentials

All tests passing (12 test suites, 0.148s execution time).
@masv3971 masv3971 merged commit 71634bf into dc4eu:main Nov 25, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants