Skip to content

OpenRAG is a comprehensive, single package Retrieval-Augmented Generation platform built on Langflow, Docling, and Opensearch.

Python

Align OpenSearch auth/token handling and defaults

Edwin Josebfb75ee270d2
diff --git a/flows/components/opensearch_multimodal.py b/flows/components/opensearch_multimodal.py
index 478e6919e..c3d42b1ca 100644
--- a/flows/components/opensearch_multimodal.py
+++ b/flows/components/opensearch_multimodal.py
@@ -317,7 +317,7 @@ class OpenSearchVectorStoreComponentMultimodalMultiEmbedding(LCVectorStoreCompon
BoolInput(
name="bearer_prefix",
display_name="Prefix 'Bearer '",
- value=True,
+ value=False,
show=False,
advanced=True,
),
diff --git a/flows/ingestion_flow.json b/flows/ingestion_flow.json
index f62f63fba..dbaddd632 100644
--- a/flows/ingestion_flow.json
+++ b/flows/ingestion_flow.json
@@ -3557,7 +3557,7 @@
"trace_as_metadata": true,
"track_in_telemetry": true,
"type": "bool",
- "value": true
+ "value": false
},
"code": {
"advanced": true,
diff --git a/flows/openrag_agent.json b/flows/openrag_agent.json
index 8a33b996f..c8811890d 100644
--- a/flows/openrag_agent.json
+++ b/flows/openrag_agent.json
@@ -2956,7 +2956,7 @@
"trace_as_metadata": true,
"track_in_telemetry": true,
"type": "bool",
- "value": true
+ "value": false
},
"code": {
"advanced": true,
diff --git a/flows/openrag_nudges.json b/flows/openrag_nudges.json
index d95ea3816..fa02dc732 100644
--- a/flows/openrag_nudges.json
+++ b/flows/openrag_nudges.json
@@ -2435,7 +2435,7 @@
"trace_as_metadata": true,
"track_in_telemetry": true,
"type": "bool",
- "value": true
+ "value": false
},
"code": {
"advanced": true,
diff --git a/flows/openrag_url_mcp.json b/flows/openrag_url_mcp.json
index 5050fa044..a57ded571 100644
--- a/flows/openrag_url_mcp.json
+++ b/flows/openrag_url_mcp.json
@@ -3842,7 +3842,7 @@
"trace_as_metadata": true,
"track_in_telemetry": true,
"type": "bool",
- "value": true
+ "value": false
},
"code": {
"advanced": true,
diff --git a/src/dependencies.py b/src/dependencies.py
index ced4861e1..8253ab4aa 100644
--- a/src/dependencies.py
+++ b/src/dependencies.py
@@ -157,10 +157,8 @@ async def _get_ibm_user(request: Request, required: bool) -> Optional["User"]:
if connections:
lh_credentials = connections[0].config.get("basic_credentials")
opensearch_username = None
- opensearch_credentials = None
if lh_credentials and lh_credentials.startswith("Basic "):
opensearch_username, _ = extract_ibm_credentials(lh_credentials)
- opensearch_credentials = lh_credentials
user = User(
user_id=user_id,
email=email,
@@ -169,7 +167,7 @@ async def _get_ibm_user(request: Request, required: bool) -> Optional["User"]:
provider="ibm_ams",
jwt_token=lh_credentials,
opensearch_username=opensearch_username,
- opensearch_credentials=opensearch_credentials,
+ opensearch_credentials=lh_credentials,
)
request.state.user = user
return user
diff --git a/src/session_manager.py b/src/session_manager.py
index 27e4e11ec..0032430bb 100644
--- a/src/session_manager.py
+++ b/src/session_manager.py
@@ -211,9 +211,8 @@ class SessionManager:
# Check for token from environment variable first
token = os.getenv("OPENSEARCH_JWT_TOKEN")
if not token:
- # If no env token, generate using JWT
token = jwt.encode(token_payload, self.private_key, algorithm=self.algorithm)
- return token
+ return f"Bearer {token}"
def verify_token(self, token: str) -> Optional[Dict[str, Any]]:
"""Verify JWT token and return user info"""