Repository navigation
Conversation
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
This PR fixes two production regressions affecting remittance access:
Root cause
SR-154: GraphQL remittance resolvers bypassed owner checks
The REST route for
/api/remittancesapplies a role-aware filter before querying the store:agentauth.userIdThe GraphQL resolvers did not use the request context at all. As a result, any authenticated caller could query arbitrary remittance history through GraphQL by setting
agentor by requesting a specificid.SR-155: default remittance store not wired in production
createApp()accepted an optionalremittanceStore, but the real process entry pointindex.tsnever passed one in. The app therefore returned503 Remittance store not configuredin runtime even though a default store factory existed and was designed for production use.Changes
createResolvers()using the requestGraphQLContext:remittancesnow respects the sameadmin ? agent : userIdrule as the REST endpointremittance(id)now returnsnullunless the user is admin or owns the remittance rowDATABASE_URLis set and no explicit store is injectedFiles touched
api/src/graphql/resolvers.tsapi/src/app.tsapi/src/__tests__/graphql.test.tsVerification
This work was updated without running broad test or lint commands, per the request to skip checks during the patch cycle.
Notes
This PR intentionally keeps the changes narrowly scoped to the reported SR-154 and SR-155 regressions.