Require a valid token to list ingestions - #656
Open
arpitjain099 wants to merge 1 commit into
Open
arpitjain099 wants to merge 1 commit into
arpitjain099 wants to merge 1 commit into
Conversation
GET /ingestions was the only ingestion route without a token dependency. The
six siblings all carry one, and GET /ingestions/{ingestion_id} gets it through
fetch_ingestion, which also scopes the read to the caller via fetch_one. The
listing queries the status index, so it returns every user's records to anyone
who asks.
Signed-off-by: Arpit Jain <arpitjain099@gmail.com>
This branch has not been deployed
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.
GET /ingestionsis the only route on the ingest API with no token dependency. Listing the dependencies the app actually builds:GET /ingestions/{ingestion_id}is protected too, throughfetch_ingestion, which also passesusernametofetch_oneso a caller only sees their own record. The listing goes tofetch_many, which queries thestatusindex with no owner predicate, so what comes back spans every user:created_by,collectionand theassetshrefs included.I added the same dependency
/auth/meuses, since this is a read and the write scopes do not fit. The test compares the GET route's dependencies against the POST route's and fails without the change.One thing I deliberately left alone: even with a token, the response still covers other users' ingestions. Scoping
fetch_manymeans changing the index query, which is your call rather than mine.