fix: expectedOrigins added to intent based proof request creation API#1580
fix: expectedOrigins added to intent based proof request creation API#1580RinkalBhojani merged 1 commit intomainfrom
Conversation
Signed-off-by: RinkalBhojani <rinkal.bhojani@ayanworks.com>
📝 WalkthroughWalkthroughThis pull request extends the intent-based verification flow by adding an Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
apps/oid4vc-verification/src/oid4vc-verification.service.ts (1)
431-431: Prefer a more precise type overRecord<string, object>for query parameters.At Line 431, the cast to
Record<string, object>is broader than necessary sinceVerificationSessionQuerycontains only string and string-enum fields. While the underlying serializer usesString(value)to handle any type safely, the cast unnecessarily widens the type signature and could allow unintended object types to pass at the TypeScript level.♻️ Suggested refactor
- url = buildUrlWithQuery(url, query as Record<string, object>); + url = buildUrlWithQuery( + url, + query as Record<string, string | number | boolean | null | undefined> + );🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@apps/oid4vc-verification/src/oid4vc-verification.service.ts` at line 431, The cast to Record<string, object> is too broad—narrow the type when calling buildUrlWithQuery by converting the VerificationSessionQuery values to strings (or using Record<string, string>) so only string-valued query params are passed; for example, transform query via Object.entries(query).map/ reduce to produce a Record<string,string> (or explicitly cast to Record<string,string>) and pass that to buildUrlWithQuery, referencing the VerificationSessionQuery value being passed into buildUrlWithQuery in oid4vc-verification.service (the url variable and buildUrlWithQuery call).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@apps/oid4vc-verification/src/oid4vc-verification.service.ts`:
- Line 431: The cast to Record<string, object> is too broad—narrow the type when
calling buildUrlWithQuery by converting the VerificationSessionQuery values to
strings (or using Record<string, string>) so only string-valued query params are
passed; for example, transform query via Object.entries(query).map/ reduce to
produce a Record<string,string> (or explicitly cast to Record<string,string>)
and pass that to buildUrlWithQuery, referencing the VerificationSessionQuery
value being passed into buildUrlWithQuery in oid4vc-verification.service (the
url variable and buildUrlWithQuery call).
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 30d8cb1d-1333-4d6c-a26a-be4e600473e9
📒 Files selected for processing (5)
apps/api-gateway/src/oid4vc-verification/dtos/create-intent-based-verification.dto.tsapps/api-gateway/src/oid4vc-verification/oid4vc-verification.controller.tsapps/api-gateway/src/oid4vc-verification/oid4vc-verification.service.tsapps/oid4vc-verification/src/oid4vc-verification.controller.tsapps/oid4vc-verification/src/oid4vc-verification.service.ts



What?
Summary by CodeRabbit
New Features
Improvements