fix: fail startup when presentation request templates cannot be loaded#482
Open
leifj wants to merge 1 commit into
Open
fix: fail startup when presentation request templates cannot be loaded#482leifj wants to merge 1 commit into
leifj wants to merge 1 commit into
Conversation
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
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
Fail verifier startup when
presentation_requests_diris 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 nilNew(): propagate the error, preventing startup with broken template configurationWhen no
presentation_requests_diris 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