Skip to content

Conversation

@shoummu1
Copy link
Collaborator

@shoummu1 shoummu1 commented Nov 14, 2025

πŸ“‹ Summary

This PR delivers a comprehensive structured JSON logging pipeline that captures correlation IDs end-to-end (ingress middleware β†’ services β†’ persistence) while maintaining backward compatibility with legacy console/file logs. It introduces:

  • Correlation ID tracking: Extract, preserve, and generate unique request identifiers across the entire request lifecycle
  • Structured logging: Persist enriched logs to database with user context, performance metrics, and security indicators
  • Security & audit trails: Specialized loggers for authentication events, suspicious activity, and CRUD operations
  • Performance aggregation: Automatic rollup of logs into time-windowed metrics with percentiles
  • Admin UI enhancement: Rebuilt System Logs tab with search, correlation tracing, security events, and performance analytics

πŸ”— Related Issues

#300


πŸ”§ Changes Made

Core Implementation

Correlation ID Infrastructure

  • New utility module (mcpgateway/utils/correlation_id.py): ContextVar-based correlation ID storage for async-safe request tracking across the entire request lifecycle
  • New middleware (mcpgateway/middleware/correlation_id.py): HTTP middleware for X-Correlation-ID header extraction, validation, generation, and injection into responses
  • Enhanced logging (mcpgateway/services/logging_service.py): CorrelationIdJsonFormatter for automatic correlation ID injection into JSON logs with OpenTelemetry trace context

Structured Logging & Observability

  • New structured logger (mcpgateway/services/structured_logger.py): Central logging facade that persists to database (StructuredLogEntry) with enriched metadata (user, component, operation type, duration)
  • New log aggregator (mcpgateway/services/log_aggregator.py): Aggregates structured logs into PerformanceMetric windows with percentiles (p50/p95/p99) and error rates
  • New security logger (mcpgateway/services/security_logger.py): Specialized logger for authentication attempts, suspicious activity, and threat scoring
  • New audit trail service (mcpgateway/services/audit_trail_service.py): CRUD operation tracking with change sets, data classification, and review flags

API & Admin UI

  • New log search router (mcpgateway/routers/log_search.py): RESTful endpoints for log search, correlation tracing, security events, audit trails, and performance metrics
  • Enhanced Admin UI (mcpgateway/static/admin.js, mcpgateway/templates/admin.html): System Logs tab rebuilt with quick actions, correlation trace modal, unified timeline view, and dynamic filters

Database Schema

  • New Alembic migration (mcpgateway/alembic/versions/k5e6f7g8h9i0_add_structured_logging_tables.py): Creates 4 new tables:
    • structured_log_entries: Comprehensive log storage with correlation IDs, user context, performance data, security indicators
    • performance_metrics: Time-windowed aggregations with percentile calculations
    • security_events: Threat analysis, failed attempt tracking, alert management
    • audit_trails: CRUD tracking with change detection and compliance metadata

βš™οΈ Configuration

New Settings in config.py:

  1. Correlation ID Settings (4 new fields):

    • correlation_id_enabled: Enable/disable correlation ID tracking (default: True)
    • correlation_id_header: Configurable header name (default: X-Correlation-ID)
    • correlation_id_preserve: Preserve client-provided IDs (default: True)
    • correlation_id_response_header: Echo correlation ID in responses (default: True)
  2. Structured Logging Settings (3 new fields):

    • structured_logging_enabled: Enable JSON logging with DB persistence (default: True)
    • structured_logging_database_enabled: Persist logs to database (default: True)
    • structured_logging_external_enabled: Send to external systems (default: False)
  3. Performance Tracking Settings (6 new fields):

    • performance_tracking_enabled: Enable performance metrics (default: True)
    • performance_threshold_*_ms: Alert thresholds for database queries, tool invocations, resource reads, HTTP requests
    • performance_degradation_multiplier: Alert threshold vs baseline (default: 1.5)
  4. Security Logging Settings (4 new fields):

    • security_logging_enabled: Enable security event logging (default: True)
    • security_failed_auth_threshold: Failed attempts before high severity (default: 5)
    • security_threat_score_alert: Threat score alert threshold (default: 0.7)
    • security_rate_limit_window_minutes: Rate limit check window (default: 5)
  5. Metrics Aggregation Settings (4 new fields):

    • metrics_aggregation_enabled: Enable automatic log aggregation (default: True)
    • metrics_aggregation_backfill_hours: Historical data to backfill on startup (default: 6)
    • metrics_aggregation_window_minutes: Aggregation window size (default: 5)
    • metrics_aggregation_auto_start: Auto-run aggregation loop (default: False)
  6. Log Search Settings (2 new fields):

    • log_search_max_results: Maximum results per query (default: 1000)
    • log_retention_days: Days to retain logs in database (default: 30)

Updated .env.example:

  • Added 4 new active Correlation ID settings (CORRELATION_ID_ENABLED, CORRELATION_ID_HEADER, CORRELATION_ID_PRESERVE, CORRELATION_ID_RESPONSE_HEADER)
  • Added 17 new commented examples for Structured Logging, Performance Tracking, Security Logging, Metrics Aggregation, and Log Search settings
  • All 21 settings are fully documented in config.py with Pydantic Field definitions and defaults

πŸ”Œ Integration Points

Middleware Stack (main.py):

  1. Registered CorrelationIDMiddleware after RequestLoggingMiddleware (execution order: RequestLogging β†’ CorrelationID β†’ Auth β†’ Observability)
  2. Added background tasks for metrics aggregation backfill + continuous loop when metrics_aggregation_auto_start=True
  3. Included log_search router when structured_logging_enabled=True

Authentication & Security:

  1. auth.py: Enhanced JWT validation with correlation ID context
  2. middleware/auth_middleware.py: AuthContextMiddleware now logs successful/failed authentication attempts via SecurityLogger
  3. middleware/http_auth_middleware.py: Unified correlation ID usage across plugin auth hooks

Service Layer:

  1. services/tool_service.py: Integrated correlation ID fallback chain and structured logging for tool invocations
  2. services/resource_service.py: Added user context and audit logging for resource operations
  3. services/prompt_service.py: Enhanced with structured logging and performance tracking
  4. services/server_service.py: Integrated audit trails for server lifecycle events
  5. services/gateway_service.py: Added correlation ID propagation for federated requests
  6. services/a2a_service.py: Added correlation ID and user context to agent invocations

Observability:

  1. observability.py: Auto-inject correlation_id into OpenTelemetry spans as request.id attribute
  2. middleware/request_logging_middleware.py: Gateway boundary logging (request_started/completed) with correlation IDs, user resolution, and duration tracking
  3. admin.py: Plugin marketplace endpoints emit structured logs + audit trails for compliance

πŸ“ New Files

  • mcpgateway/middleware/correlation_id.py – FastAPI middleware that extracts/preserves correlation IDs and injects them into responses
  • mcpgateway/utils/correlation_id.py – ContextVar utilities for generating, validating, and retrieving correlation IDs across async scopes
  • mcpgateway/services/structured_logger.py – Central structured logging facade that writes to JSON, DB, and optional external sinks
  • mcpgateway/services/log_aggregator.py – Aggregates StructuredLogEntry rows into PerformanceMetric windows and exposes helper APIs
  • mcpgateway/services/security_logger.py – Specialized logger for auth/suspicious events, computing threat scores and security audit entries
  • mcpgateway/services/audit_trail_service.py – Shared audit trail writer that records CRUD/data-access operations with change tracking
  • mcpgateway/routers/log_search.py – FastAPI router exposing /api/logs/search, /trace, /security-events, /audit-trails, /performance-metrics endpoints
  • mcpgateway/alembic/versions/k5e6f7g8h9i0_add_structured_logging_tables.py – Migration that creates structured_log_entries, performance_metrics, security_events, and audit_trails tables plus supporting indexes

Example Usage

curl -v http://localhost:4444/health

Full Response:

*   Trying 127.0.0.1:4444...
* Connected to localhost (127.0.0.1) port 4444 (#0)
> GET /health HTTP/1.1
> Host: localhost:4444
> User-Agent: curl/7.81.0
> Accept: */*
> 
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< date: Thu, 27 Nov 2025 15:00:29 GMT
< server: uvicorn
< content-length: 20
< content-type: application/json
< x-content-type-options: nosniff
< x-frame-options: DENY
< x-xss-protection: 0
< x-download-options: noopen
< referrer-policy: strict-origin-when-cross-origin
< content-security-policy: default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval' https://cdnjs.cloudflare.com https://cdn.tailwindcss.com https://cdn.jsdelivr.net https://unpkg.com; style-src 'self' 'unsafe-inline' https://cdnjs.cloudflare.com https://cdn.jsdelivr.net; img-src 'self' data: https:; font-src 'self' data: https://cdnjs.cloudflare.com; connect-src 'self' ws: wss: https:; frame-ancestors 'none';
< x-correlation-id: 6930e1f1a8b84beb904e18594bbf15dd
<
* Connection #0 to host localhost left intact
{"status":"healthy"}
  • Response header: x-correlation-id: 6930e1f1a8b84beb904e18594bbf15dd
  • Server logs: {"request_id": "6930e1f1a8b84beb904e18594bbf15dd", ...}

Correlation trace in Admin UI:

  1. Navigate to Admin UI β†’ System Logs tab
  2. Click on correlation ID to Trace the correlation ID
  3. Enter correlation ID or paste from search box
  4. View unified timeline with all logs, security events, audit trails, and performance metrics for that request

@shoummu1 shoummu1 marked this pull request as ready for review November 14, 2025 13:46
@shoummu1 shoummu1 force-pushed the feat/correlation-id-logging branch from d0712be to a17e408 Compare November 20, 2025 07:48
@shoummu1 shoummu1 marked this pull request as draft November 20, 2025 11:18
@shoummu1 shoummu1 force-pushed the feat/correlation-id-logging branch 2 times, most recently from dd94c98 to cb9e60a Compare November 26, 2025 11:42
@shoummu1 shoummu1 marked this pull request as ready for review November 27, 2025 15:25
@shoummu1 shoummu1 force-pushed the feat/correlation-id-logging branch 5 times, most recently from 7552ba9 to 95be3a2 Compare December 3, 2025 09:33
@crivetimihai crivetimihai self-assigned this Dec 12, 2025
Signed-off-by: Shoumi <shoumimukherjee@gmail.com>
Signed-off-by: Shoumi <shoumimukherjee@gmail.com>
Signed-off-by: Shoumi <shoumimukherjee@gmail.com>
Signed-off-by: Shoumi <shoumimukherjee@gmail.com>
Signed-off-by: Shoumi <shoumimukherjee@gmail.com>
Signed-off-by: Shoumi <shoumimukherjee@gmail.com>
Signed-off-by: Shoumi <shoumimukherjee@gmail.com>
Signed-off-by: Shoumi <shoumimukherjee@gmail.com>
Signed-off-by: Shoumi <shoumimukherjee@gmail.com>
Signed-off-by: Shoumi <shoumimukherjee@gmail.com>
Signed-off-by: Shoumi <shoumimukherjee@gmail.com>
Signed-off-by: Shoumi <shoumimukherjee@gmail.com>
Signed-off-by: Shoumi <shoumimukherjee@gmail.com>
Signed-off-by: Shoumi <shoumimukherjee@gmail.com>
Signed-off-by: Shoumi <shoumimukherjee@gmail.com>
shoummu1 and others added 18 commits December 12, 2025 09:05
Signed-off-by: Shoumi <shoumimukherjee@gmail.com>
Signed-off-by: Shoumi <shoumimukherjee@gmail.com>
Signed-off-by: Shoumi <shoumimukherjee@gmail.com>
Signed-off-by: Shoumi <shoumimukherjee@gmail.com>
Signed-off-by: Shoumi <shoumimukherjee@gmail.com>
Signed-off-by: Shoumi <shoumimukherjee@gmail.com>
Signed-off-by: Shoumi <shoumimukherjee@gmail.com>
Signed-off-by: Shoumi <shoumimukherjee@gmail.com>
Signed-off-by: Shoumi <shoumimukherjee@gmail.com>
Signed-off-by: Shoumi <shoumimukherjee@gmail.com>
Signed-off-by: Shoumi <shoumimukherjee@gmail.com>
Signed-off-by: Shoumi <shoumimukherjee@gmail.com>
Signed-off-by: Shoumi <shoumimukherjee@gmail.com>
Signed-off-by: Shoumi <shoumimukherjee@gmail.com>
Signed-off-by: Shoumi <shoumimukherjee@gmail.com>
Signed-off-by: Shoumi <shoumimukherjee@gmail.com>
- Fix Alembic migration to chain after main branch head (356a2d4eed6f)
- Fix is_active/enabled attribute access in services (server, prompt, resource, export)
- Update export_service to use getattr with fallback for backwards compatibility
- Add db.refresh before return in tool_service.register_tool to handle
  session expiry after audit/logging commits
- Add SessionLocal patches in conftest.py for audit_trail_service and log_aggregator
- Update test assertions for expected db.refresh call count
- Apply isort import ordering fixes across service files

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
@crivetimihai crivetimihai force-pushed the feat/correlation-id-logging branch from 8a69950 to 4821f0a Compare December 12, 2025 09:45
…g fuzz test

- Use sa.false() instead of string literals for Boolean server_defaults
  in migration (SQLite uses 0/1, not "false"/"true")
- Use sa.text("'{}'") for JSON server_defaults to ensure proper quoting
- Update fuzz test to expect dict tags format {id, label} instead of strings

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
@crivetimihai crivetimihai merged commit 1af08db into main Dec 12, 2025
52 checks passed
@crivetimihai crivetimihai deleted the feat/correlation-id-logging branch December 12, 2025 11:23
crivetimihai added a commit that referenced this pull request Dec 12, 2025
* mTLS support

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* feat: added mTLS support to plugin mcp servers.

Signed-off-by: Teryl Taylor <terylt@ibm.com>

* fix: added streamable http support to runtime_mtls.py

Signed-off-by: Teryl Taylor <terylt@ibm.com>

* fix: updated plugin server runtime.py to support mTLS. removed chuck-mcp-runtime

Signed-off-by: Teryl Taylor <terylt@ibm.com>

* fix: switched chuk-mcp-runtime with mcp python sdk to support mTLS.

Signed-off-by: Teryl Taylor <terylt@ibm.com>

* fix: updated llmguard and opa plugins to install the mcp official sdk.

Signed-off-by: Teryl Taylor <terylt@ibm.com>

* feat: added health check to plugin server runtimes.

Signed-off-by: Teryl Taylor <terylt@ibm.com>

* fix: added health check for mtls plugin server

Signed-off-by: Teryl Taylor <terylt@ibm.com>

* fix: removed chuk-mcp-runtime, replaced with official mcp library.

Signed-off-by: Teryl Taylor <terylt@ibm.com>

* fix: runtime tests.

Signed-off-by: Teryl Taylor <terylt@ibm.com>

* feat: initial revision of configurable plugin builds.

Signed-off-by: Teryl Taylor <terylt@ibm.com>

* docs: added mtls plugin documentation.

Signed-off-by: Teryl Taylor <terylt@ibm.com>

* fix: linting issues.

Signed-off-by: Teryl Taylor <terylt@ibm.com>

* fix: install templates with cli, fix error messages.

Signed-off-by: Teryl Taylor <terylt@ibm.com>

* fix: mtls and stdio test cases.

Signed-off-by: Teryl Taylor <terylt@ibm.com>

* fix: remove commented code.

Signed-off-by: Teryl Taylor <terylt@ibm.com>

* docs: and examples

Signed-off-by: Teryl Taylor <terylt@ibm.com>

* fix: docstring issues

Signed-off-by: Teryl Taylor <terylt@ibm.com>

* tests: added unit tests and more commenting.

Signed-off-by: Teryl Taylor <terylt@ibm.com>

* tests: add tests. Fix doc tests.

Signed-off-by: Teryl Taylor <terylt@ibm.com>

* fix: change to make python the default.

Signed-off-by: Teryl Taylor <terylt@ibm.com>

* fix: bandit issue.

Signed-off-by: Teryl Taylor <terylt@ibm.com>

* fix: updated key length to 4096

Signed-off-by: Teryl Taylor <terylt@ibm.com>

* fix: utility function for verifying certificates.

Signed-off-by: Teryl Taylor <terylt@ibm.com>

* fix: added utility class for ssl certificate verification.

Signed-off-by: Teryl Taylor <terylt@ibm.com>

* test: added certificate validation tests.

Signed-off-by: Teryl Taylor <terylt@ibm.com>

* feat: added support for cert-manager in k8s.

Signed-off-by: Teryl Taylor <terylt@ibm.com>

* tests: skipped tls doctest.

Signed-off-by: Teryl Taylor <terylt@ibm.com>

* test: fix doctests.

Signed-off-by: Teryl Taylor <terylt@ibm.com>

* fix: added example cert-manager issuer file.

Signed-off-by: Teryl Taylor <terylt@ibm.com>

* docs: updated mtls documentation to point to plugins mtls documentation.

Signed-off-by: Teryl Taylor <terylt@ibm.com>

* fix: forgot to add deploy-k8s-cert-manager.yaml

Signed-off-by: Teryl Taylor <terylt@ibm.com>

* feat: add registry pushing support. clean up pydantics.

Signed-off-by: Teryl Taylor <terylt@ibm.com>

* fix: fixes to support Openshift, and support enabling plugins in k8s.

Signed-off-by: Teryl Taylor <terylt@ibm.com>

* feat: added openshift route file for installing route to mcpgateway admin site.

Signed-off-by: Teryl Taylor <terylt@ibm.com>

* chore: fix vulture issues

Signed-off-by: Frederico Araujo <frederico.araujo@ibm.com>

* chore: fix yamlint issues

Signed-off-by: Frederico Araujo <frederico.araujo@ibm.com>

* test: add unit tests

Signed-off-by: Frederico Araujo <frederico.araujo@ibm.com>

* chore: doctests coverage

Signed-off-by: Frederico Araujo <frederico.araujo@ibm.com>

* tests: add doctests

Signed-off-by: Frederico Araujo <frederico.araujo@ibm.com>

* docs: simplified docs and added an example configuration at the top.

Signed-off-by: Teryl Taylor <terylt@ibm.com>

* fix: doctest issue.

Signed-off-by: Teryl Taylor <terylt@ibm.com>

* docs: added more doctests.

Signed-off-by: Teryl Taylor <terylt@ibm.com>

* docs: added more doctests.

Signed-off-by: Teryl Taylor <terylt@ibm.com>

* docs: omit builder classes from doctest coverage analysis.

Signed-off-by: Teryl Taylor <terylt@ibm.com>

* Roadmap update

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* lint: fix flake8 issues.

Signed-off-by: Teryl Taylor <terylt@ibm.com>

* Minor fix to OAuth token expiry logic (#1579)

* minor fix to oauth token expiry logic

Signed-off-by: Madhav Kandukuri <madhav165@gmail.com>

* Fix tests in test_prompt_service
Signed-off-by: Madhav Kandukuri <madhav165@gmail.com>

* Fix doctest
Signed-off-by: Madhav Kandukuri <madhav165@gmail.com>

* Fix failing test
Signed-off-by: Madhav Kandukuri <madhav165@gmail.com>

---------

Signed-off-by: Madhav Kandukuri <madhav165@gmail.com>

* fix uuid migration for postgresql (#1584)

Signed-off-by: Keval Mahajan <mahajankeval23@gmail.com>

* Enabling HTTPS with Encrypted SSL Keys via Passphrase Support (#1578)

* added ssl key manager

Signed-off-by: Keval Mahajan <mahajankeval23@gmail.com>

* update gunicorn config to support ssl cert passphrase

Signed-off-by: Keval Mahajan <mahajankeval23@gmail.com>

* update dockercompose with passphrase varaible

Signed-off-by: Keval Mahajan <mahajankeval23@gmail.com>

* targets supporitng certs with passphrase

Signed-off-by: Keval Mahajan <mahajankeval23@gmail.com>

* check passphrase

Signed-off-by: Keval Mahajan <mahajankeval23@gmail.com>

* fix location

Signed-off-by: Keval Mahajan <mahajankeval23@gmail.com>

* update test cases

Signed-off-by: Keval Mahajan <mahajankeval23@gmail.com>

* Signed-off-by: Keval Mahajan <mahajankeval23@gmail.com>

* linting

Signed-off-by: Keval Mahajan <mahajankeval23@gmail.com>

---------

Signed-off-by: Keval Mahajan <mahajankeval23@gmail.com>

* added test resource functionality (#1575)

* added test resource functionality

removed content part from edit & view screens of resource

updated message displayed on UI when edit/view/test buttons are clicked for inactive resource

Signed-off-by: Satya <tsp.0713@gmail.com>

* updated ResourceTemplate id datatype to str

updated isActive for resource in admin.js based out of enable

allaignment correction made code for sse connection under transport.py

Signed-off-by: Satya <tsp.0713@gmail.com>

* fixing tests

Signed-off-by: Satya <tsp.0713@gmail.com>

* rebase, conflicts resolved

Signed-off-by: Satya <tsp.0713@gmail.com>

---------

Signed-off-by: Satya <tsp.0713@gmail.com>

* Fix in toolops tab UI code to call admin tools endpoint to get list of tools. (#1573)

* fixed page refresh issue when added mcp server from server list page.

* Minor update to toolops read me

---------

Co-authored-by: Neelamadhav Gantayat <neelamadhav@in.ibm.com>

* Correlation ID for Unified Request Tracking (#1443)

* Add correlation ID system for unified request tracking

Signed-off-by: Shoumi <shoumimukherjee@gmail.com>

* replace undefined bearer_scheme with security

Signed-off-by: Shoumi <shoumimukherjee@gmail.com>

* lint & test fixes

Signed-off-by: Shoumi <shoumimukherjee@gmail.com>

* fixes for lint

Signed-off-by: Shoumi <shoumimukherjee@gmail.com>

* pylint fixes

Signed-off-by: Shoumi <shoumimukherjee@gmail.com>

* test fixes

Signed-off-by: Shoumi <shoumimukherjee@gmail.com>

* Bandit fixes

Signed-off-by: Shoumi <shoumimukherjee@gmail.com>

* fix for test

Signed-off-by: Shoumi <shoumimukherjee@gmail.com>

* addiitonal changes for UI & middleware

Signed-off-by: Shoumi <shoumimukherjee@gmail.com>

* fix bug

Signed-off-by: Shoumi <shoumimukherjee@gmail.com>

* dropdown mismatch fix

Signed-off-by: Shoumi <shoumimukherjee@gmail.com>

* fixes for UI

Signed-off-by: Shoumi <shoumimukherjee@gmail.com>

* UI fixes for adding user details

Signed-off-by: Shoumi <shoumimukherjee@gmail.com>

* admin ui fixes

Signed-off-by: Shoumi <shoumimukherjee@gmail.com>

* flake8 fixes

Signed-off-by: Shoumi <shoumimukherjee@gmail.com>

* test fixes

Signed-off-by: Shoumi <shoumimukherjee@gmail.com>

* lint fixes

Signed-off-by: Shoumi <shoumimukherjee@gmail.com>

* fix for doctest

Signed-off-by: Shoumi <shoumimukherjee@gmail.com>

* auth issue fixes

Signed-off-by: Shoumi <shoumimukherjee@gmail.com>

* update for failing tests

Signed-off-by: Shoumi <shoumimukherjee@gmail.com>

* flake8 fixes

Signed-off-by: Shoumi <shoumimukherjee@gmail.com>

* flake8 issue

Signed-off-by: Shoumi <shoumimukherjee@gmail.com>

* prevent SQLite rollback error on validation failures

Signed-off-by: Shoumi <shoumimukherjee@gmail.com>

* false positive issues

Signed-off-by: Shoumi <shoumimukherjee@gmail.com>

* fix lint issue

Signed-off-by: Shoumi <shoumimukherjee@gmail.com>

* update alembic file

Signed-off-by: Shoumi <shoumimukherjee@gmail.com>

* updated alembic revision

Signed-off-by: Shoumi <shoumimukherjee@gmail.com>

* changes in table schema

Signed-off-by: Shoumi <shoumimukherjee@gmail.com>

* gateway service fixes

Signed-off-by: Shoumi <shoumimukherjee@gmail.com>

* updated tests

Signed-off-by: Shoumi <shoumimukherjee@gmail.com>

* fix doctest coverage

Signed-off-by: Shoumi <shoumimukherjee@gmail.com>

* fix: resolve rebase conflicts and fix test issues for correlation ID PR

- Fix Alembic migration to chain after main branch head (356a2d4eed6f)
- Fix is_active/enabled attribute access in services (server, prompt, resource, export)
- Update export_service to use getattr with fallback for backwards compatibility
- Add db.refresh before return in tool_service.register_tool to handle
  session expiry after audit/logging commits
- Add SessionLocal patches in conftest.py for audit_trail_service and log_aggregator
- Update test assertions for expected db.refresh call count
- Apply isort import ordering fixes across service files

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* Linting

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* fix: ensure cross-database compatibility for migrations and update tag fuzz test

- Use sa.false() instead of string literals for Boolean server_defaults
  in migration (SQLite uses 0/1, not "false"/"true")
- Use sa.text("'{}'") for JSON server_defaults to ensure proper quoting
- Update fuzz test to expect dict tags format {id, label} instead of strings

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

---------

Signed-off-by: Shoumi <shoumimukherjee@gmail.com>
Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
Co-authored-by: Mihai Criveti <crivetimihai@gmail.com>

* Enable vault token (#1585)

Signed-off-by: Chris PC <chrispc@li-4dc2bf4c-325d-11b2-a85c-b68e8b1fc307.ibm.com>
Co-authored-by: Chris PC <chrispc@li-4dc2bf4c-325d-11b2-a85c-b68e8b1fc307.ibm.com>

* [Security Feature]: RBAC Plugin using Cedar (#1499)

* Prompt and tool hooks implementation for cedar plugin

Signed-off-by: Shriti Priya <shritip@ibm.com>

* Adding hook implementation and test cases for resource hooks

Signed-off-by: Shriti Priya <shritip@ibm.com>

* test cases for all hooks in cedar and custom_dsl policy langauge modes

Signed-off-by: Shriti Priya <shritip@ibm.com>

* Adding documentation in code

Signed-off-by: Shriti Priya <shritip@ibm.com>

* Files for external server

Signed-off-by: Shriti Priya <shritip@ibm.com>

* Adding documentation

Signed-off-by: Shriti Priya <shritip@ibm.com>

* Documentation update

Signed-off-by: Shriti Priya <shritip@ibm.com>

* update documentation

Signed-off-by: Shriti Priya <shritip@ibm.com>

* Updating documentation

Signed-off-by: Shriti Priya <shritip@ibm.com>

* Adding env variables for transport and host in env.template

Signed-off-by: Shriti Priya <shritip@ibm.com>

* Solving yaml lint issues

Signed-off-by: Shriti Priya <shritip@ibm.com>

* reverting changes in opa

Signed-off-by: Shriti Priya <shritip@ibm.com>

* fixing pylint and flake8 issues

Signed-off-by: Shriti Priya <shritip@ibm.com>

* fixing flake8 issues

Signed-off-by: Shriti Priya <shritip@ibm.com>

* fixing lint issues

Signed-off-by: Shriti Priya <shritip@ibm.com>

* manifest update and flake8 issues resolved

Signed-off-by: Shriti Priya <shritip@ibm.com>

* init in test update

Signed-off-by: Shriti Priya <shritip@ibm.com>

* Adding new line

Signed-off-by: Shriti Priya <shritip@ibm.com>

* documentation update and error handling

Signed-off-by: Shriti Priya <shritip@ibm.com>

* fixing lint issues

Signed-off-by: Shriti Priya <shritip@ibm.com>

* fixing flake8 issues

Signed-off-by: Shriti Priya <shritip@ibm.com>

* fix(cedar-plugin): improve code quality and formatting

- Fix import order (move urllib.parse to standard library section)
- Replace unnecessary elif after return with if statements
- Apply black and isort formatting to plugin and tests

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* Linting

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

---------

Signed-off-by: Shriti Priya <shritip@ibm.com>
Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
Co-authored-by: Mihai Criveti <crivetimihai@gmail.com>

* fix: add nosec comments for subprocess calls in builder module

Add bandit nosec comments to suppress B404, B603, and B607 warnings
for legitimate subprocess calls in the deployment builder module.
These subprocess calls are used for git operations and container/
kubernetes commands which are necessary for the deployment tool.

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* Rebase and lint

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

---------

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
Signed-off-by: Teryl Taylor <terylt@ibm.com>
Signed-off-by: Frederico Araujo <frederico.araujo@ibm.com>
Signed-off-by: Madhav Kandukuri <madhav165@gmail.com>
Signed-off-by: Keval Mahajan <mahajankeval23@gmail.com>
Signed-off-by: Satya <tsp.0713@gmail.com>
Signed-off-by: Shoumi <shoumimukherjee@gmail.com>
Signed-off-by: Chris PC <chrispc@li-4dc2bf4c-325d-11b2-a85c-b68e8b1fc307.ibm.com>
Signed-off-by: Shriti Priya <shritip@ibm.com>
Co-authored-by: Mihai Criveti <crivetimihai@gmail.com>
Co-authored-by: Teryl Taylor <terylt@ibm.com>
Co-authored-by: Frederico Araujo <frederico.araujo@ibm.com>
Co-authored-by: Madhav Kandukuri <madhav165@users.noreply.github.com>
Co-authored-by: Keval Mahajan <65884586+kevalmahajan@users.noreply.github.com>
Co-authored-by: Satya <tsp.0713@gmail.com>
Co-authored-by: Jay Bandlamudi <jay_bandlamudi@in.ibm.com>
Co-authored-by: Neelamadhav Gantayat <neelamadhav@in.ibm.com>
Co-authored-by: Shoumi M <55126549+shoummu1@users.noreply.github.com>
Co-authored-by: ChrisPC-39 <60066382+ChrisPC-39@users.noreply.github.com>
Co-authored-by: Chris PC <chrispc@li-4dc2bf4c-325d-11b2-a85c-b68e8b1fc307.ibm.com>
Co-authored-by: Shriti Priya <shritip@ibm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants