fix: port orphan migration, add security model doc, and pool write scope tests#1280
Open
Ejere wants to merge 1 commit into
Open
fix: port orphan migration, add security model doc, and pool write scope tests#1280Ejere wants to merge 1 commit into
Ejere wants to merge 1 commit into
Conversation
…ope tests closes LabsCrypt#1194 closes LabsCrypt#1186 closes LabsCrypt#1179
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.
Summary
src/db/migrations/1700000000000_add-loan-events-type-index.sqlinto a realbackend/migrations/1795000000000_loan-events-type-index.jsnode-pg-migrate file so theidx_loan_events_type_created_atindex is actually applied. Deleted the orphan SQL file and its now-empty directory. Added a_migrations_noteinpackage.jsondocumentingbackend/migrations/as the single source of truth.docs/SECURITY-MODEL.mdcovering the challenge-signature-JWT flow, role-to-scope table, API-key scope namespaces, cookie attributes, and a per-route-group authorization map. Linked fromSECURITY.mdandbackend/README.md.backend/src/__tests__/poolRouteScopes.test.tswith route-layer integration tests asserting lender JWT → 403 on all four pool write routes (missingwrite:pool), borrower JWT → 403, and no token → 401.Test plan
npm run migrate:upapplies the new1795000000000migration and createsidx_loan_events_type_created_atnpm test -- --testPathPattern poolRouteScopespasses (lender/borrower 403, unauthenticated 401)docs/SECURITY-MODEL.mdrenders correctly on GitHubcloses #1194
closes #1186
closes #1179