Three fixes for the coordinator pipeline: 1. Use bandit.yaml config file (-c bandit.yaml) so global skips and exclude_dirs are respected in CI. 2. Upgrade pip to >=25.3 in the install step so pip-audit doesn't fail on the stale pip 24.0 bundled with python:3.11-slim. 3. Clean up nosec inline comments to bare "# nosec BXXX" format, moving explanations to a separate comment line above. This prevents bandit from misinterpreting trailing text as test IDs. Fixes #365 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
44 lines
1.0 KiB
Python
44 lines
1.0 KiB
Python
"""Configuration management for mosaic-coordinator."""
|
|
|
|
from pydantic_settings import BaseSettings, SettingsConfigDict
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
"""Application settings loaded from environment variables."""
|
|
|
|
model_config = SettingsConfigDict(
|
|
env_file=".env",
|
|
env_file_encoding="utf-8",
|
|
case_sensitive=False,
|
|
extra="ignore",
|
|
)
|
|
|
|
# Gitea Configuration
|
|
gitea_webhook_secret: str
|
|
gitea_url: str = "https://git.mosaicstack.dev"
|
|
|
|
# Anthropic API
|
|
anthropic_api_key: str
|
|
|
|
# Server Configuration
|
|
# Container-bound: listen on all interfaces inside Docker
|
|
host: str = "0.0.0.0" # nosec B104
|
|
port: int = 8000
|
|
|
|
# Logging
|
|
log_level: str = "info"
|
|
|
|
# Coordinator Configuration
|
|
coordinator_poll_interval: float = 5.0
|
|
coordinator_max_concurrent_agents: int = 10
|
|
coordinator_enabled: bool = True
|
|
|
|
|
|
def get_settings() -> Settings:
|
|
"""Get settings instance (lazy loaded)."""
|
|
return Settings() # type: ignore[call-arg]
|
|
|
|
|
|
# Global settings instance
|
|
settings = get_settings()
|