Create GraphQL service permission archtecture#838
Open
filiperochalopes wants to merge 8 commits intoOpenConceptLab:masterfrom
Open
Create GraphQL service permission archtecture#838filiperochalopes wants to merge 8 commits intoOpenConceptLab:masterfrom
filiperochalopes wants to merge 8 commits intoOpenConceptLab:masterfrom
Conversation
* Adopt a permissive base QuerySet for textual GraphQL searches to rely on Elasticsearch's version filtering logic. * Apply the same Elasticsearch filters as REST (source_version=HEAD and is_latest_version=True). * Use strict 'id = versioned_object_id' filtering only when listing without search terms. * Remove SQL fallback logic to ensure consistent ES-only behavior across REST and GraphQL search flows.
* Add reusable GraphQL permission helpers, mixin, and decorator to gate repository access and reuse existing REST visibility filters. * Update query helpers and tests to use the mixin, cache source-resolution lookups, and ensure ES and global searches respect visibility and repository permissions.
* Add shared concept search helpers (exact, wildcard, fuzzy criteria, mandatory word filters, and rescore) along with document visibility utilities so REST and GraphQL reuse the same logic. * Update BaseAPIView and the GraphQL query pipeline to call the shared helpers, including the common visibility filter, so concept text search behavior and permissions remain aligned. * Adjust GraphQL query helper tests to accommodate the new search flow and ensure the anonymous visibility filter continues to run.
* Add shared GraphQL error metadata and raise stable coded errors across permissions, queries, views, and schema logging * Align global search and mapping helpers with REST visibility rules for consistent access control * Guard Elasticsearch outages and invalid authentication paths to prevent unhandled failures * Expand tests to cover structured error responses and failure scenarios
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.
Linked Issue
Closes OpenConceptLab/ocl_issues#2356