fix(api): scope configuration lookup to authenticated owner#4161
Open
sgoel2be24-cyber wants to merge 1 commit into
Open
fix(api): scope configuration lookup to authenticated owner#4161sgoel2be24-cyber wants to merge 1 commit into
sgoel2be24-cyber wants to merge 1 commit into
Conversation
Signed-off-by: shikhar <sgoel2_be24@thapar.edu>
sgoel2be24-cyber
requested review from
LStromann,
Vasilije1990 and
dexters1
as code owners
July 20, 2026 18:27
sgoel2be24-cyber
force-pushed
the
codex/fix-principal-config-authorization
branch
from
July 20, 2026 21:27
6c86bd0 to
7e8e9e0
Compare
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.
An authenticated user could request a configuration using its UUID without verifying that the configuration belonged to them. This change passes the authenticated principal ID into the lookup and filters by both configuration ID and owner ID.
Unauthorized and nonexistent configurations continue returning the existing empty-object response, avoiding resource enumeration.
Acceptance Criteria
A configuration is returned only when it belongs to the authenticated principal.
Another user’s configuration cannot be retrieved by UUID.
Missing and unauthorized configurations return {}.
Regression tests cover both the API route and database query.
Type of Change
Check only:
Screenshots
Run this command and attach a screenshot of the result:
uv run pytest cognee/tests/unit/api/test_configuration_router_authorization.py cognee/tests/unit/modules/users/test_get_principal_configuration.py cognee/tests/unit/modules/users -q
It should show 19 passed.
Checklist
Check these:
DCO Affirmation
I affirm that all code in every commit of this pull request conforms to the terms of the Topoteretes Developer Certificate of Origin.