fix(rag-pipeline): mark credential-free datasources as authorized - #39772
Open
ccl125 wants to merge 1 commit into
Open
fix(rag-pipeline): mark credential-free datasources as authorized#39772ccl125 wants to merge 1 commit into
ccl125 wants to merge 1 commit into
Conversation
list_rag_pipeline_datasources treated every datasource provider alike: it only set is_authorized when saved credentials were found in the database. Built-in providers such as local file upload declare an empty credentials_schema and no oauth_schema, so they never have a DatasourceProvider row and were always returned as is_authorized=false, which made the RAG pipeline creation checklist report them as requiring authorization. Providers that declare no credentials cannot require authorization, so mark them authorized directly and skip the pointless credentials lookup.
ccl125
requested review from
JohnJyong,
QuantumGhost and
laipz8200
as code owners
July 29, 2026 16:25
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
Fixes #39724
When creating a RAG Pipeline knowledge base, the built-in local file upload data source was shown as "Please authorize first". Built-in data sources don't need OAuth-style authorization.
Root cause:
list_rag_pipeline_datasourcessetis_authorizedonly when saved credentials were found in the database. Providers whosecredentials_schemais empty and that declare nooauth_schema(e.g. local file upload) never have aDatasourceProviderrow, so they were always returned asis_authorized: false, and the creation checklist flagged them as requiring authorization.Changes
RagPipelineManageService.list_rag_pipeline_datasources: providers that declare no credentials are marked authorized directly, skipping the pointless credentials lookup.Testing
pytest tests/unit_tests/services/rag_pipeline/— 258 passedruff check/ruff format --checkclean on touched files