CRUD and Tests for security_event, sesion, transaccion, risk_feature, risk_assessment, fraud_action, audit_log, otp_challenge, token_blacklist, ip_reputation#28
Conversation
…assessment, fraud_action, audit_log, otp_challenge, token_blacklist, ip_reputation
…eature, security event, sesion, token blacklist, transaccion
…risk feature, security event, sesion, token blacklist, transaccion
…s, risk_assessments, fraud_actions, audit_logs, otp_challenges, token_blacklist, ip_reputations
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.
New Files Created
entities/: security_event, sesion, transaccion, risk_feature, risk_assessment, fraud_action, audit_log, otp_challenge, token_blacklist, ip_reputation
models/: Pydantic models for all 10 entities above.
repositories/: CRUD logic for all 10 entities above.
api/: Routers for all 10 entities above.
tests/: Full test suites for all 10 new modules.
Files Modified
api/router.py: Registered all 10 new routers.
Extra Endpoints (Beyond Basic CRUD)
POST /api/sesiones/{id}/end: Stamps ended_at to now.
GET /api/token-blacklist/by-jti/{jti}: Lookup by token ID (essential for JWT validation).
GET /api/ip-reputations/by-ip/{ip}: Lookup by IP string.
ip_reputation: Auto-stamps updated_at on every update.
Summary
The entire backend is now fully scaffolded. Every table from the database design has CRUD routes, a dedicated repository, and passing tests. The infrastructure is ready for the frontend integration.