Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
4eec3e3
Add correlation ID system for unified request tracking
shoummu1 Nov 14, 2025
29c103a
replace undefined bearer_scheme with security
shoummu1 Nov 14, 2025
6bea360
lint & test fixes
shoummu1 Nov 14, 2025
9caa57f
fixes for lint
shoummu1 Nov 14, 2025
9af6c9f
pylint fixes
shoummu1 Nov 14, 2025
e7f543f
test fixes
shoummu1 Nov 14, 2025
abba8d5
Bandit fixes
shoummu1 Nov 14, 2025
220dfe8
fix for test
shoummu1 Nov 20, 2025
1f8c673
addiitonal changes for UI & middleware
shoummu1 Nov 24, 2025
fca5449
fix bug
shoummu1 Nov 24, 2025
1c5fa70
dropdown mismatch fix
shoummu1 Nov 24, 2025
8874996
fixes for UI
shoummu1 Nov 25, 2025
9e269c5
UI fixes for adding user details
shoummu1 Nov 25, 2025
46c709f
admin ui fixes
shoummu1 Nov 26, 2025
4683a98
flake8 fixes
shoummu1 Nov 26, 2025
627610e
test fixes
shoummu1 Nov 26, 2025
6a59bc3
lint fixes
shoummu1 Nov 26, 2025
99253a0
fix for doctest
shoummu1 Nov 27, 2025
f9d37e9
auth issue fixes
shoummu1 Nov 27, 2025
f8d3efb
update for failing tests
shoummu1 Nov 27, 2025
8c07712
flake8 fixes
shoummu1 Nov 27, 2025
8f3e219
flake8 issue
shoummu1 Nov 27, 2025
2bad146
prevent SQLite rollback error on validation failures
shoummu1 Nov 27, 2025
f598f22
false positive issues
shoummu1 Nov 27, 2025
293bbf1
fix lint issue
shoummu1 Nov 28, 2025
547c1f4
update alembic file
shoummu1 Dec 1, 2025
0a38f73
updated alembic revision
shoummu1 Dec 1, 2025
2284ba8
changes in table schema
shoummu1 Dec 2, 2025
9a8525e
gateway service fixes
shoummu1 Dec 3, 2025
2756856
updated tests
shoummu1 Dec 3, 2025
673f489
fix doctest coverage
shoummu1 Dec 3, 2025
0232a62
fix: resolve rebase conflicts and fix test issues for correlation ID PR
crivetimihai Dec 12, 2025
4821f0a
Linting
crivetimihai Dec 12, 2025
f2540ca
fix: ensure cross-database compatibility for migrations and update ta…
crivetimihai Dec 12, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ SECURITY_HEADERS_ENABLED=true
# null or none: Completely removes iframe restrictions (no headers sent)
# ALLOW-FROM uri: Allows specific domain (deprecated, use CSP instead)
# ALLOW-ALL uri: Allows all (*, http, https)
#
#
# Both X-Frame-Options header and CSP frame-ancestors directive are automatically synced.
# Modern browsers prioritize CSP frame-ancestors over X-Frame-Options.
X_FRAME_OPTIONS=DENY
Expand Down Expand Up @@ -659,6 +659,17 @@ LOG_MAX_SIZE_MB=1
LOG_BACKUP_COUNT=5
LOG_BUFFER_SIZE_MB=1.0

# Correlation ID / Request Tracking
# Enable automatic correlation ID tracking for unified request tracing
# Options: true (default), false
CORRELATION_ID_ENABLED=true
# HTTP header name for correlation ID (default: X-Correlation-ID)
CORRELATION_ID_HEADER=X-Correlation-ID
# Preserve incoming correlation IDs from clients (default: true)
CORRELATION_ID_PRESERVE=true
# Include correlation ID in HTTP response headers (default: true)
CORRELATION_ID_RESPONSE_HEADER=true

# Transport Protocol Configuration
# Options: all (default), sse, streamablehttp, http
# - all: Enable all transport protocols
Expand Down Expand Up @@ -1193,6 +1204,16 @@ PAGINATION_INCLUDE_LINKS=true
# Enable TLS for gRPC connections by default
# MCPGATEWAY_GRPC_TLS_ENABLED=false

#####################################
# Security Event Logging
#####################################

# Enable security event logging (authentication attempts, authorization failures, etc.)
# Options: true (default), false
# When enabled, the AuthContextMiddleware will log all authentication attempts to the database
# This is INDEPENDENT of observability settings - security logging is critical for audit trails
# SECURITY_LOGGING_ENABLED=true

#####################################
# Observability Settings
#####################################
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1619,7 +1619,7 @@ ContextForge implements **OAuth 2.0 Dynamic Client Registration (RFC 7591)** and
>
> **iframe Embedding**: The gateway controls iframe embedding through both `X-Frame-Options` header and CSP `frame-ancestors` directive (both are automatically synced). Options:
> - `X_FRAME_OPTIONS=DENY` (default): Blocks all iframe embedding
> - `X_FRAME_OPTIONS=SAMEORIGIN`: Allows embedding from same domain only
> - `X_FRAME_OPTIONS=SAMEORIGIN`: Allows embedding from same domain only
> - `X_FRAME_OPTIONS="ALLOW-ALL"`: Allows embedding from all sources (sets `frame-ancestors * file: http: https:`)
> - `X_FRAME_OPTIONS=null` or `none`: Completely removes iframe restrictions (no headers sent)
>
Expand Down
4 changes: 2 additions & 2 deletions docs/docs/deployment/container.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ docker logs mcpgateway
You can now access the UI at [http://localhost:4444/admin](http://localhost:4444/admin)

### Multi-architecture containers
Note: the container build process creates container images for 'amd64', 'arm64' and 's390x' architectures. The version `ghcr.io/ibm/mcp-context-forge:VERSION`
Note: the container build process creates container images for 'amd64', 'arm64' and 's390x' architectures. The version `ghcr.io/ibm/mcp-context-forge:VERSION`
not points to a manifest so that if all commands will pull the correct image for the architecture being used (whether that be locally or on Kubernetes or OpenShift).

If the specific image is needed for one architecture on a different architecture use the appropriate arguments for your given container execution tool:

With docker run:
With docker run:
```
docker run [... all your options...] --platform linux/arm64 ghcr.io/ibm/mcp-context-forge:VERSION
```
Expand Down
19 changes: 9 additions & 10 deletions gunicorn.config.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,37 +65,37 @@

def on_starting(server):
"""Called just before the master process is initialized.

This is where we handle passphrase-protected SSL keys by decrypting
them to a temporary file before Gunicorn workers start.
"""
global _prepared_key_file

# Check if SSL is enabled via environment variable (set by run-gunicorn.sh)
# and a passphrase is provided
ssl_enabled = os.environ.get("SSL", "false").lower() == "true"
ssl_key_password = os.environ.get("SSL_KEY_PASSWORD")

if ssl_enabled and ssl_key_password:
try:
from mcpgateway.utils.ssl_key_manager import prepare_ssl_key

# Get the key file path from environment (set by run-gunicorn.sh)
key_file = os.environ.get("KEY_FILE", "certs/key.pem")

server.log.info(f"Preparing passphrase-protected SSL key: {key_file}")

# Decrypt the key and get the temporary file path
_prepared_key_file = prepare_ssl_key(key_file, ssl_key_password)

server.log.info(f"SSL key prepared successfully: {_prepared_key_file}")

# Update the keyfile setting to use the decrypted temporary file
# This is a bit of a hack, but Gunicorn doesn't provide a better way
# to modify the keyfile after it's been set via command line
if hasattr(server, 'cfg'):
server.cfg.set('keyfile', _prepared_key_file)

except Exception as e:
server.log.error(f"Failed to prepare SSL key: {e}")
raise
Expand Down Expand Up @@ -127,4 +127,3 @@ def worker_exit(server, worker):

def child_exit(server, worker):
server.log.info("Worker child exit (pid: %s)", worker.pid)

Loading
Loading