-
Notifications
You must be signed in to change notification settings - Fork 5.4k
17455 components veriff #17536
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
17455 components veriff #17536
Conversation
Actions - Create Verification Decision - Find A Decision
WalkthroughNew modules and actions were added to the Veriff integration, including the ability to create a verification session and retrieve a decision by session ID. Supporting utility and constants modules were introduced, and the Veriff app client was refactored to implement API calls. The package version and dependencies were also updated. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant CreateVerificationAction
participant VeriffApp
participant VeriffAPI
User->>CreateVerificationAction: Provide verification details
CreateVerificationAction->>VeriffApp: createVerificationSession(data)
VeriffApp->>VeriffAPI: POST /sessions (with data)
VeriffAPI-->>VeriffApp: Verification session response
VeriffApp-->>CreateVerificationAction: Response
CreateVerificationAction-->>User: Session info
sequenceDiagram
participant User
participant FindDecisionAction
participant VeriffApp
participant VeriffAPI
User->>FindDecisionAction: Provide session ID
FindDecisionAction->>VeriffApp: getSessionDecision({ sessionId, headers })
VeriffApp->>VeriffAPI: GET /sessions/{sessionId}/decision (with HMAC signature)
VeriffAPI-->>VeriffApp: Decision response
VeriffApp-->>FindDecisionAction: Response
FindDecisionAction-->>User: Decision info
Assessment against linked issues
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
components/veriff/actions/find-a-decision/find-a-decision.mjsOops! Something went wrong! :( ESLint: 8.57.1 Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs components/veriff/actions/create-verification/create-verification.mjsOops! Something went wrong! :( ESLint: 8.57.1 Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs components/veriff/common/constants.mjsOops! Something went wrong! :( ESLint: 8.57.1 Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 2 Skipped Deployments
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 6
🧹 Nitpick comments (1)
components/veriff/common/utils.mjs (1)
1-1
: Consider renaming for better clarity.The function name
parseObject
might be misleading since it can handle arrays and other types. Consider renaming toparseJson
orparseJsonSafely
for better clarity.-export const parseObject = (obj) => { +export const parseJson = (obj) => {
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yaml
is excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (6)
components/veriff/actions/create-verification/create-verification.mjs
(1 hunks)components/veriff/actions/find-a-decision/find-a-decision.mjs
(1 hunks)components/veriff/common/constants.mjs
(1 hunks)components/veriff/common/utils.mjs
(1 hunks)components/veriff/package.json
(2 hunks)components/veriff/veriff.app.mjs
(1 hunks)
🧰 Additional context used
🧠 Learnings (4)
components/veriff/common/constants.mjs (2)
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#12697
File: components/salesforce_rest_api/sources/common-webhook-methods.mjs:1-71
Timestamp: 2024-10-08T15:33:38.240Z
Learning: The `common-webhook-methods.mjs` object is designed to be extended, similar to an abstract class, and intentionally does not implement certain methods like `generateWebhookMeta` and `getEventType` to enforce implementation in subclasses.
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#12697
File: components/salesforce_rest_api/sources/common-webhook-methods.mjs:1-71
Timestamp: 2024-07-24T02:06:47.016Z
Learning: The `common-webhook-methods.mjs` object is designed to be extended, similar to an abstract class, and intentionally does not implement certain methods like `generateWebhookMeta` and `getEventType` to enforce implementation in subclasses.
components/veriff/package.json (1)
Learnt from: jcortes
PR: PipedreamHQ/pipedream#14935
File: components/sailpoint/package.json:15-18
Timestamp: 2024-12-12T19:23:09.039Z
Learning: When developing Pipedream components, do not add built-in Node.js modules like `fs` to `package.json` dependencies, as they are native modules provided by the Node.js runtime.
components/veriff/veriff.app.mjs (1)
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#16954
File: components/salesloft/salesloft.app.mjs:14-23
Timestamp: 2025-06-04T17:52:05.780Z
Learning: In the Salesloft API integration (components/salesloft/salesloft.app.mjs), the _makeRequest method returns response.data which directly contains arrays for list endpoints like listPeople, listCadences, listUsers, and listAccounts. The propDefinitions correctly call .map() directly on these responses without needing to destructure a nested data property.
components/veriff/actions/create-verification/create-verification.mjs (1)
Learnt from: jcortes
PR: PipedreamHQ/pipedream#14467
File: components/gainsight_px/actions/create-account/create-account.mjs:4-6
Timestamp: 2024-10-30T15:24:39.294Z
Learning: In `components/gainsight_px/actions/create-account/create-account.mjs`, the action name should be "Create Account" instead of "Create Memory".
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: pnpm publish
- GitHub Check: Lint Code Base
- GitHub Check: Verify TypeScript components
- GitHub Check: Publish TypeScript components
🔇 Additional comments (12)
components/veriff/common/constants.mjs (1)
1-66
: Well-structured constants module with good organization.The constants are properly organized with consistent naming conventions and good separation of concerns. The BASE_URL uses HTTPS which is appropriate for security.
components/veriff/package.json (2)
3-3
: Appropriate version bump for new features.The version update from
0.0.1
to0.1.0
follows semantic versioning correctly for the addition of new functionality.
15-17
: Correct dependency declaration.The
@pipedream/platform
dependency is properly declared and the version constraint^3.1.0
is appropriate for Pipedream components.components/veriff/common/utils.mjs (1)
1-24
: Well-implemented JSON parsing utility with good error handling.The function correctly handles multiple input types (arrays, strings, other types) and includes proper error handling with try-catch blocks.
components/veriff/actions/find-a-decision/find-a-decision.mjs (2)
19-22
: Correct HMAC signature implementation.The HMAC SHA-256 signature generation using the secret key and session ID is implemented correctly and follows standard authentication practices.
4-35
: Well-structured Pipedream action with proper authentication.The action follows Pipedream conventions correctly, includes appropriate prop definitions, and implements the authentication flow properly with the HMAC signature.
components/veriff/veriff.app.mjs (3)
7-25
: Well-implemented API client with proper structure.The helper methods
_baseUrl()
,_headers()
, and_makeRequest()
are well-structured and follow common API client patterns. The authentication implementation using$auth.api_key
is correct for Pipedream components.
26-40
: Clean public method implementations.The
createVerificationSession()
andgetSessionDecision()
methods are well-implemented with appropriate HTTP methods and clean parameter handling.
7-8
: Ignore BASE_URL constant suggestion for Veriff
- No
components/veriff/common/constants.mjs
orBASE_URL
definition exists for this component.components/veriff/veriff.app.mjs
intentionally usesthis.$auth.api_url
to build${this.$auth.api_url}/v1
, allowing the API endpoint to be configured via Pipedream’s auth settings.- No action required.
Likely an incorrect or invalid review comment.
components/veriff/actions/create-verification/create-verification.mjs (3)
1-3
: LGTM! Imports are properly structured.The imports correctly reference the constants, utility functions, and app client from their respective modules.
5-10
: LGTM! Action configuration follows best practices.The action configuration is well-defined with appropriate key, name, description with documentation link, version, and type.
125-161
: LGTM! Run method implementation is well-structured.The run method correctly:
- Calls the app's createVerificationSession method
- Structures the data according to the API requirements
- Uses the parseObject utility for consents
- Provides appropriate success feedback
- Returns the response
The nested data structure properly organizes personal, document, and address information as expected by the Veriff API.
ID_CARD_TYPE_OPTIONS: [ | ||
"CE", | ||
"TI", | ||
], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Verify the completeness of ID card type options.
The ID_CARD_TYPE_OPTIONS
only contains two values ("CE" and "TI"). Please verify this is complete according to the Veriff API documentation, as it seems quite limited compared to the other option arrays.
🌐 Web query:
What are the supported ID card types for the Veriff identity verification API?
💡 Result:
Veriff's identity verification API supports a wide range of government-issued identity documents from over 230 countries and territories. This includes more than 12,000 document specimens, such as passports, national ID cards, driver's licenses, and residence permits. (veriff.com)
The API is designed to automatically recognize and process various document types, including those in Latin-based, Cyrillic, Japanese, and Arabic scripts. This extensive support ensures that Veriff can verify identities globally, accommodating diverse document formats and languages. (veriff.com)
For a comprehensive list of supported document types and to ensure compatibility with specific ID cards, you can refer to Veriff's official documentation or contact their support team for detailed information.
Citations:
- 1: https://www.veriff.com/product/identity-verification?utm_source=openai
- 2: https://www.veriff.com/product/identity-verification?utm_source=openai
Ensure ID_CARD_TYPE_OPTIONS covers all supported Veriff document types
The array at components/veriff/common/constants.mjs (lines 61–64) currently only includes "CE"
and "TI"
, but Veriff’s API recognizes a broad set of ID documents (passports, national ID cards, driver’s licenses, residence permits, etc.). Please update this constant to reflect all relevant ID card types your integration needs (or consider fetching the list dynamically from Veriff’s docs/API).
• File: components/veriff/common/constants.mjs
Lines: 61–64
ID_CARD_TYPE_OPTIONS: [
// replace these two placeholders…
"CE",
"TI",
// …with the full set of required ID document codes
],
🤖 Prompt for AI Agents
In components/veriff/common/constants.mjs at lines 61 to 64, the
ID_CARD_TYPE_OPTIONS array currently only includes "CE" and "TI", which is
incomplete. Update this array to include all supported Veriff document types
required by your integration, such as passports, national ID cards, driver’s
licenses, residence permits, etc. Alternatively, implement logic to fetch this
list dynamically from Veriff’s API or documentation to ensure it stays current.
firstIssue: { | ||
type: "string", | ||
label: "First Issue", | ||
description: "Date of first issue of the document (YYYY-MM-DD)", | ||
optional: true, | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Add input validation for first issue date format.
The first issue field expects "YYYY-MM-DD" format but lacks validation to ensure users provide the correct format.
Consider adding validation to ensure the date format is correct:
firstIssue: {
type: "string",
label: "First Issue",
description: "Date of first issue of the document (YYYY-MM-DD)",
+ pattern: "^\\d{4}-\\d{2}-\\d{2}$",
optional: true,
},
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
firstIssue: { | |
type: "string", | |
label: "First Issue", | |
description: "Date of first issue of the document (YYYY-MM-DD)", | |
optional: true, | |
}, | |
firstIssue: { | |
type: "string", | |
label: "First Issue", | |
description: "Date of first issue of the document (YYYY-MM-DD)", | |
pattern: "^\\d{4}-\\d{2}-\\d{2}$", | |
optional: true, | |
}, |
🤖 Prompt for AI Agents
In components/veriff/actions/create-verification/create-verification.mjs around
lines 94 to 99, the firstIssue field lacks validation to ensure the date is in
"YYYY-MM-DD" format. Add a validation function or regex pattern to check the
input matches this date format and integrate it into the field definition to
prevent invalid date entries.
number: { | ||
type: "string", | ||
label: "Document Number", | ||
description: "Document number, [a-zA-Z0-9] characters only", | ||
optional: true, | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Add input validation for document number format.
The document number field specifies "[a-zA-Z0-9] characters only" but lacks validation to enforce this constraint.
Consider adding validation to ensure the document number format is correct:
number: {
type: "string",
label: "Document Number",
description: "Document number, [a-zA-Z0-9] characters only",
+ pattern: "^[a-zA-Z0-9]+$",
optional: true,
},
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
number: { | |
type: "string", | |
label: "Document Number", | |
description: "Document number, [a-zA-Z0-9] characters only", | |
optional: true, | |
}, | |
number: { | |
type: "string", | |
label: "Document Number", | |
description: "Document number, [a-zA-Z0-9] characters only", | |
pattern: "^[a-zA-Z0-9]+$", | |
optional: true, | |
}, |
🤖 Prompt for AI Agents
In components/veriff/actions/create-verification/create-verification.mjs around
lines 75 to 80, the document number field lacks validation to enforce the
allowed character set [a-zA-Z0-9]. Add a validation function or regex pattern to
check that the input contains only alphanumeric characters and integrate this
validation into the field definition to reject invalid inputs.
dateOfBirth: { | ||
type: "string", | ||
label: "Date of Birth", | ||
description: "Person's date of birth (YYYY-MM-DD)", | ||
optional: true, | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Add input validation for date format.
The date of birth field expects "YYYY-MM-DD" format but lacks validation to ensure users provide the correct format.
Consider adding validation to ensure the date format is correct:
dateOfBirth: {
type: "string",
label: "Date of Birth",
description: "Person's date of birth (YYYY-MM-DD)",
+ pattern: "^\\d{4}-\\d{2}-\\d{2}$",
optional: true,
},
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
dateOfBirth: { | |
type: "string", | |
label: "Date of Birth", | |
description: "Person's date of birth (YYYY-MM-DD)", | |
optional: true, | |
}, | |
dateOfBirth: { | |
type: "string", | |
label: "Date of Birth", | |
description: "Person's date of birth (YYYY-MM-DD)", | |
pattern: "^\\d{4}-\\d{2}-\\d{2}$", | |
optional: true, | |
}, |
🤖 Prompt for AI Agents
In components/veriff/actions/create-verification/create-verification.mjs around
lines 50 to 55, the dateOfBirth field lacks validation to ensure the input
matches the expected "YYYY-MM-DD" format. Add a validation function or regex
pattern to check the date string format and reject or flag inputs that do not
conform to this pattern, ensuring only correctly formatted dates are accepted.
country: { | ||
type: "string", | ||
label: "Country", | ||
description: "Document issuing country (ISO 3166-1 alpha-2)", | ||
optional: true, | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Add input validation for country code format.
The country field expects "ISO 3166-1 alpha-2" format but lacks validation to ensure users provide valid country codes.
Consider adding validation to ensure the country code format is correct:
country: {
type: "string",
label: "Country",
description: "Document issuing country (ISO 3166-1 alpha-2)",
+ pattern: "^[A-Z]{2}$",
optional: true,
},
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
country: { | |
type: "string", | |
label: "Country", | |
description: "Document issuing country (ISO 3166-1 alpha-2)", | |
optional: true, | |
}, | |
country: { | |
type: "string", | |
label: "Country", | |
description: "Document issuing country (ISO 3166-1 alpha-2)", | |
pattern: "^[A-Z]{2}$", | |
optional: true, | |
}, |
🤖 Prompt for AI Agents
In components/veriff/actions/create-verification/create-verification.mjs around
lines 81 to 86, the country field lacks validation to ensure the input matches
the ISO 3166-1 alpha-2 format. Add a validation function or regex pattern to
check that the country code is exactly two uppercase letters, and integrate this
validation into the field definition to reject invalid inputs.
consents: { | ||
type: "string[]", | ||
label: "Consents", | ||
description: "Array of objects listing the type of consent given. Optional, should be only included for features that require consent", | ||
optional: true, | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Clarify the consents data type and structure.
The consents field is defined as string[]
but is processed with parseObject()
on line 153, which suggests it might be a JSON string rather than an array.
Consider clarifying the data type and providing an example:
consents: {
- type: "string[]",
+ type: "string",
label: "Consents",
- description: "Array of objects listing the type of consent given. Optional, should be only included for features that require consent",
+ description: "JSON string representing an array of objects listing the type of consent given. Example: `[{\"type\": \"data_processing\", \"given\": true}]`. Optional, should be only included for features that require consent",
optional: true,
},
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
consents: { | |
type: "string[]", | |
label: "Consents", | |
description: "Array of objects listing the type of consent given. Optional, should be only included for features that require consent", | |
optional: true, | |
}, | |
consents: { | |
type: "string", | |
label: "Consents", | |
description: "JSON string representing an array of objects listing the type of consent given. Example: `[{\"type\": \"data_processing\", \"given\": true}]`. Optional, should be only included for features that require consent", | |
optional: true, | |
}, |
🤖 Prompt for AI Agents
In components/veriff/actions/create-verification/create-verification.mjs around
lines 118 to 123, the consents field is declared as a string array but is parsed
as an object later, indicating a mismatch. Update the consents field type to
"string" to reflect it being a JSON string, and clarify in the description that
it should be a JSON string representing an array of consent objects. Optionally,
add an example of the expected JSON string format to improve clarity.
Resolves #17455
Summary by CodeRabbit
New Features
Enhancements
Chores