Fix/scopes erasure travelrule - #418
Open
dorismaduegbunam wants to merge 4 commits into
Open
Conversation
…dd admin erasure endpoint (Neurowealth#391)
|
@dorismaduegbunam Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
Contributor
|
pls fix ci |
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.
This PR resolves four issues:
closes #390 closes #395 closes #394 closes #391
Issue #390 - API key scopes enforcement
Added requireScope guards to all write endpoints matching their USER_SCOPES entries:
deposit.ts - requireScope('deposit:write')
goals.ts - requireScope('goals:write') on POST/PATCH/DELETE
recurring-deposits.ts - requireScope('recurring_deposits:write') on POST/PATCH/DELETE
strategies.ts - requireScope('strategies:write') on publish
webhooks.ts - requireScope('webhooks:manage') on POST/PATCH/DELETE
vault.ts - requireScope('vault:write') on build-transaction
alerts.ts - requireScope('alerts:manage') on POST/PATCH/DELETE
fiat.ts - requireScope('fiat:write') on create order
Issue #395 - Root documentation
Added README.md (project overview, quickstart, env vars, docker-compose) and CONTRIBUTING.md (local setup, test/lint/typecheck, PR conventions, issue-to-PR mapping).
Issue #394 - GDPR/CCPA erasure job
Added src/jobs/erasureJob.ts with:
Erasure policies map (DELETE/ANONYMIZE/IMMUTABLE)
erasureJob(userId, dryRun) function returning per-model results
eraseUserData(userId, dryRun) wrapper with summary
Admin endpoint POST /api/admin/erasure with erasure:write scope and dry-run mode
Issue #391 - Travel Rule records
Updated detectTravelRule to lookup user data and populate originator/beneficiary JSON fields with wallet address and display name. Status transitions to READY when data available, PENDING_DATA when missing. Added unit tests for both paths.