Skip to content

fix: fail startup when presentation request templates cannot be loaded#482

Open
leifj wants to merge 1 commit into
SUNET:mainfrom
sirosfoundation:fix/fatal-template-load-errors
Open

fix: fail startup when presentation request templates cannot be loaded#482
leifj wants to merge 1 commit into
SUNET:mainfrom
sirosfoundation:fix/fatal-template-load-errors

Conversation

@leifj

@leifj leifj commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Summary

Fail verifier startup when presentation_requests_dir is configured but template loading fails (e.g. duplicate scopes across templates).

Problem

When template loading failed, the verifier silently fell back to the buildDCQLQueryFromConfig() path, which requests all VCTM claims instead of the configured subset. This made configuration errors invisible — the verifier appeared to work but requested far more claims than intended.

See #480 for the full analysis and reproduction.

Changes

  • loadPresentationTemplates(): return the error instead of logging and returning nil
  • New(): propagate the error, preventing startup with broken template configuration

When no presentation_requests_dir is configured, the behavior is unchanged — the fallback path is used as before.

Testing

All existing tests pass. The scope uniqueness validation in validateNoDuplicateScopes() already catches the duplicate-scope case; this PR ensures that error actually prevents startup instead of being silently swallowed.

Fixes #480

Previously, when presentation_requests_dir was configured but template
loading failed (e.g. duplicate scopes across templates), the verifier
silently fell back to the buildDCQLQueryFromConfig() path, which
requests all VCTM claims instead of the configured subset.

This made configuration errors invisible — the verifier appeared to
work but requested far more claims than intended.

Now template loading errors propagate from loadPresentationTemplates()
through New(), preventing the verifier from starting with a broken
configuration.

Fixes SUNET#480
@sonarqubecloud

Copy link
Copy Markdown

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.

Verifier queries all credential claims in "OIDC OP" mode

1 participant