dmsc 0.1.9

Ri - A high-performance Rust middleware framework with modular architecture
# Copyright © 2025-2026 Wenze Wei. All Rights Reserved.
#
# This file is part of Ri.
# The Ri project belongs to the Dunimd Team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# You may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# =============================================================================
# Authentication Configuration
# =============================================================================
auth:
  enabled: true
  jwt_secret: "your-secret-key-change-in-production"
  jwt_expiry_secs: 3600
  session_timeout_secs: 86400
  oauth_providers: []
  enable_api_keys: true
  enable_session_auth: true
  oauth_cache_backend_type: "Memory"
  oauth_cache_redis_url: "redis://127.0.0.1:6379"

# =============================================================================
# Cache Configuration
# =============================================================================
cache:
  enabled: true
  default_ttl_secs: 3600
  max_memory_mb: 512
  cleanup_interval_secs: 300
  backend_type: "Memory"
  redis_url: "redis://127.0.0.1:6379"
  redis_pool_size: 10

# =============================================================================
# Logging Configuration
# =============================================================================
logging:
  level: "INFO"
  console_enabled: true
  file_enabled: true
  sampling_default: 1.0
  file_name: "app.log"
  json_format: false
  rotate_when: "size"
  max_bytes: 10485760
  color_blocks: true

# =============================================================================
# Gateway Configuration
# =============================================================================
gateway:
  listen_address: "0.0.0.0"
  listen_port: 8080
  max_connections: 1000
  request_timeout_seconds: 30
  enable_rate_limiting: true
  enable_circuit_breaker: true
  enable_load_balancing: true
  cors_enabled: true
  cors_origins:
    - "*"
  cors_methods:
    - "GET"
    - "POST"
    - "PUT"
    - "DELETE"
  cors_headers:
    - "Content-Type"
    - "Authorization"
  enable_logging: true
  log_level: "INFO"

# =============================================================================
# Database Configuration
# =============================================================================
database:
  database_type: "SQLite"
  host: "localhost"
  port: 5432
  database: ".dms/data/ri.db"
  username: ""
  password: ""
  max_connections: 10
  min_idle_connections: 1
  connection_timeout_secs: 30
  idle_timeout_secs: 600
  max_lifetime_secs: 1800
  ssl_mode: "Disable"

# =============================================================================
# Queue Configuration
# =============================================================================
queue:
  enabled: true
  backend_type: "Memory"
  connection_string: "memory://localhost"
  max_connections: 10
  message_max_size: 1048576
  consumer_timeout_ms: 30000
  producer_timeout_ms: 5000
  retry_policy:
    max_retries: 3
    initial_delay_ms: 100
    max_delay_ms: 5000
    multiplier: 2.0
  dead_letter_config:
    enabled: true
    queue_name: "dead_letter"
    max_retention_secs: 86400

# =============================================================================
# Observability Configuration
# =============================================================================
observability:
  tracing_enabled: true
  metrics_enabled: true
  tracing_sampling_rate: 0.1
  tracing_sampling_strategy: "rate"
  metrics_window_size_secs: 300
  metrics_bucket_size_secs: 10