Skip to content

fix(rag-pipeline): mark credential-free datasources as authorized - #39772

Open
ccl125 wants to merge 1 commit into
langgenius:mainfrom
ccl125:fix/rag-pipeline-local-file-datasource-auth
Open

fix(rag-pipeline): mark credential-free datasources as authorized#39772
ccl125 wants to merge 1 commit into
langgenius:mainfrom
ccl125:fix/rag-pipeline-local-file-datasource-auth

Conversation

@ccl125

@ccl125 ccl125 commented Jul 29, 2026

Copy link
Copy Markdown

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_datasources set is_authorized only when saved credentials were found in the database. Providers whose credentials_schema is empty and that declare no oauth_schema (e.g. local file upload) never have a DatasourceProvider row, so they were always returned as is_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.
  • Unit test covering the credential-free path (authorized without a credentials lookup) alongside the existing credential-based behavior.

Testing

  • pytest tests/unit_tests/services/rag_pipeline/ — 258 passed
  • ruff check / ruff format --check clean on touched files

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.
@dosubot dosubot Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

When creating the RAG Pipeline knowledge base, the local file upload data source shows "Please authorize first"

1 participant