feat: integrate KYC verification provider with identity provider abstraction#80
Open
Abdul-dev-creator wants to merge 2 commits into
Open
Conversation
…raction Adds the first KYC provider (mock-kyc) behind an IIdentityProvider interface, enabling provider-swappable identity verification. - IIdentityProvider abstraction (createSession, getStatus, processWebhook) - MockKycProvider implementation with full state machine - KycModule with POST /kyc/session, GET /kyc/status/:userId, POST /kyc/webhook - kyc_verifications table migration (Supabase/PostgreSQL) - Verification states: pending, in_review, verified, rejected, expired Closes Thalos-Infrastructure#72
|
@Abdul-dev-creator is attempting to deploy a commit to the ManuelJG's projects Team on Vercel. A member of the Team first needs to authorize it. |
Collaborator
Review — changes requested (do not merge yet)Thanks @Abdul-dev-creator — the sketch (abstraction + Nest module + endpoints) is in the right direction for #72. Several blockers before this can land. Blockers
Design / consistency with existing KYB
What looks good
Happy to re-review after migration rename + FK fix + auth on status/webhook + tests. |
This was referenced Jul 22, 2026
josueazc
added a commit
to josueazc/ThalosBackend
that referenced
this pull request
Jul 23, 2026
…SSoT docs) - Rename migration 002_create_verifications.sql -> 004 to clear the number collision with kyb (002, main), kyc (Thalos-Infrastructure#80) and retry-queue (Thalos-Infrastructure#103) migrations. - Tighten authorization on the compliance endpoints (IDOR fix): reads now require the caller to be the subject (users), an admin, or an internal service. Adds JwtOrInternalSecretGuard (JWT or x-thalos-internal-secret) and VerificationService.assertCanRead; unit tests cover self/admin/internal/denied. - Document the single-source-of-truth model in the README: verifications is a read-only projection that KYC/KYB writers must upsert into, so Thalos-Infrastructure#71/Thalos-Infrastructure#72/Thalos-Infrastructure#75 don't invent another status shape.
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.
Overview
This PR integrates the first KYC (Know Your Customer) verification provider into the new Identity Provider abstraction. It introduces a provider-swappable IIdentityProvider interface with a mock provider implementation, enabling individual identity verification while exposing a standardized API to the rest of the platform.
Related Issue
Closes #72
Changes
⚙️ Identity Provider Abstraction
[ADD] src/kyc/interfaces/identity-provider.interface.ts
Added the IIdentityProvider interface defining createSession, getStatus, and processWebhook.
Supports provider-swappable architecture — replace the provider implementation without changing business logic.
[ADD] src/kyc/interfaces/kyc.types.ts
Defined the KycStatus enum: pending, in_review, �erified,
ejected, �xpired.
Added shared interfaces for KYC sessions and database rows.
🤖 Mock KYC Provider
🌐 KYC API Surface
[ADD] src/kyc/kyc.controller.ts
POST /kyc/session — Create a new KYC verification session (authenticated).
GET /kyc/status/:userId — Retrieve verification status for a user.
POST /kyc/webhook — Receive verification results from the provider.
[ADD] src/kyc/kyc.service.ts
Orchestrates provider calls and persists verification metadata to Supabase.
Syncs provider-side status with the local database on status checks.
🗄️ Database
🔧 Module Registration
Verification