feat(client): expose the credential type's FAQ on CredentialDescriptor - #627
feat(client): expose the credential type's FAQ on CredentialDescriptor#627rubenhensen wants to merge 1 commit into
Conversation
|
Thanks for opening this, Ruben! I'm on it — reviewing the new |
There was a problem hiding this comment.
Reviewed by Dobby — looks good to merge.
Clean, additive change: the new faq field is omitempty, so existing frontends are unaffected, and CredentialType.ClientFaq() correctly returns nil when the scheme has no FAQ content. The four builders that hold a scheme-backed credential type all populate it; the generic EUDI DCQL path stays nil as intended. Test coverage for the all-texts, partial-texts, and no-content cases is present.
Checks passed:
- No
==/!=struct-equality traps (Go pointer-equality rule). - PR title is conventional-commit;
Closes #626uses a valid closing keyword. - Review-side findings: none; go build/test/vet/gofmt reported clean.
|
Reviewed and approved this one — clean, additive change. The new |
What
clientmodels.CredentialDescriptorgains an optionalFaq *Faq(faq,omitempty), populated by every scheme-backed descriptor builder. Frontendscan then show the credential-specific explanation content (intro + FAQ cards)
in flows that only receive a descriptor — most notably when the user obtains a
missing credential during a disclosure session, which today falls back to a
generic one-liner (privacybydesign/irmamobile#668).
Closes #626.
How
The FAQ texts live on
irma.CredentialType(FAQIntro/FAQPurpose/FAQContent/FAQHowto), and every scheme-backed builder already holds thatobject at construction time:
CredentialType.ClientFaq()(new) converts the four texts to a*clientmodels.Faq, returning nil when the scheme provides none.client/schemaless.go—GetCredentialStore(descriptor-level,the item-level
Faqstays for backwards compatibility),createCredentialDescriptor(issuance-during-disclosure bundles) andgetCredentialDescriptor(wrong-credential templates) — and ineudi/openid4vp/irma_sdjwt_dcql.buildCredentialDescriptor(OpenID4VP DCQLobtainable descriptors).
have no scheme entry, so no FAQ exists, matching the frontend's fallback
rendering.
The field is additive JSON, so existing frontends are unaffected.
CredentialStoreItem.Faqis now redundant and can be deprecated oncefrontends read the descriptor-level field.
Tests
irma/descriptions_faq_test.go—ClientFaqconverts all texts, keepsmissing texts nil, and returns nil when no FAQ content exists.
go build ./...passes,go testpasses for./irma/...,./client/...,./common/...and./eudi/openid4vp/..., andgofmt/go vetare clean.