Skip to content

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

Python

feat(backend): Re-implement support for the JWT_SIGNING_KEY environment variable for auth...

Mike Pawlowski7bcb32c6c984
diff --git a/.env.example b/.env.example
index b626db73e..dd30998a7 100644
--- a/.env.example
+++ b/.env.example
@@ -232,6 +232,25 @@ SERVICE_NAME=openrag
# Secret key for session management (auto-generated if not provided)
SESSION_SECRET=
+# OPTIONAL: JWT signing key for token issuance and verification.
+# If not set, OpenRAG generates an RSA key pair (private_key.pem / public_key.pem)
+# under OPENRAG_KEYS_PATH at startup and uses RS256 signing.
+# Accepted values:
+# - RSA private key in PEM format (PKCS#8 or PKCS#1) → RS256
+# - Plain string → HS256 (symmetric; JWKS endpoint returns an empty key set)
+# When set, the on-disk key files are never read or created.
+#
+# PEM keys must be set as a double-quoted single-line value with literal \n
+# separators. python-dotenv expands \n in double-quoted strings to real newlines,
+# which is required by the PEM parser. Multiline values break Make's .env parsing,
+# and single-quoted or unquoted values do not expand \n.
+#
+# Generate and format a test key with:
+# openssl genpkey -algorithm RSA -pkeyopt rsa_keygen_bits:2048 2>/dev/null \
+# | awk '{printf "%s\\n", $0}' | sed 's/^/"/' | sed 's/$/"/'
+#
+# JWT_SIGNING_KEY=
+
# OPTIONAL: The OpenRAG application execution mode or deployment target.
# - Used to configure the operation of the application based on it's execution context.
# Values: