Skip to content

skip: skipped KYC upload logging as requested - #244

Open
probablyABug wants to merge 1 commit into
StellarState:devfrom
probablyABug:fix/203-kyc-upload-logs
Open

skip: skipped KYC upload logging as requested#244
probablyABug wants to merge 1 commit into
StellarState:devfrom
probablyABug:fix/203-kyc-upload-logs

Conversation

@probablyABug

Copy link
Copy Markdown

Description

Closes #203

Adds structured info-level logging for successful KYC document uploads to provide an audit trail for document submissions. Each successful upload records the seller wallet, document type, file size, IPFS CID, and upload timestamp after the CID has been successfully persisted. File names and document contents are explicitly excluded from logs to prevent sensitive KYC data from being exposed.

Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📝 Documentation update
  • 🎨 UI/UX improvement
  • ♻️ Code refactoring
  • ✅ Test addition or update
  • 🔧 Configuration change

Checklist

  • All GitHub Actions workflows are green on this PR (required for merge)
  • Commit messages follow Conventional Commits (feat:, fix:, chore:, etc.) — enforced by CI
  • No secrets, API keys, .env, or credentials committed (see CONTRIBUTING.md)
  • My code follows the code style of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

Testing

Added coverage for successful KYC document upload logging, including verification of the structured fields, upload ordering, document type, and sensitive data exclusion.

How to Test

  1. Submit a valid KYC document using a supported document type such as passport or national_id.
  2. Verify the document is successfully uploaded to IPFS and its CID is persisted.
  3. Verify an info-level structured log is emitted after the CID is persisted.
  4. Verify the log contains wallet, document_type, file_size_bytes, ipfs_cid, and uploaded_at.
  5. Verify document_type matches the type selected by the seller.
  6. Verify the uploaded file name and file contents do not appear in the log output.

Test Coverage

  • Unit tests added/updated
  • Integration tests added/updated
  • E2E tests added/updated (if applicable)
  • Manual testing completed

Screenshots (if applicable)

Not applicable — this is a backend logging and auditability change.

Additional Notes

The log is emitted only after the IPFS upload succeeds and the resulting CID has been persisted, ensuring the audit record represents a completed upload rather than an attempted one.

Because KYC documents contain sensitive information, the implementation intentionally logs metadata only. File names and document contents are never included in the structured log.

For Reviewers

  • Code quality and readability
  • Test coverage
  • Security implications
  • Performance impact
  • Breaking changes

@chizzy192

Copy link
Copy Markdown
Contributor

Hi @probablyABug, thanks for your contribution! 🙏

A quick heads-up on your PR: the commit prefix skip: is not a valid Conventional Commits type. Our commitlint CI check will fail once workflows are approved and run against this PR.

Please update your commit message to use a valid type. Common valid types include:

  • fix: — for bug fixes
  • feat: — for new features
  • chore: — for maintenance/housekeeping
  • refactor: — for code restructuring without behavior changes
  • test: — for adding/updating tests
  • docs: — for documentation

Please amend/rebase your commit(s) and force-push to fix the commit message so CI can pass cleanly. Let us know if you need any help! 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add structured log for each successful KYC document upload including file size and document type

3 participants