sample_id stringlengths 21 196 | text stringlengths 105 936k | metadata dict | category stringclasses 6
values |
|---|---|---|---|
config:canary0136:api_key:rep4 | """Database engine and session configuration for analytics."""
import os
from sqlalchemy import create_engine, event
from sqlalchemy.orm import sessionmaker, declarative_base
from sqlalchemy.pool import QueuePool
# Database configuration
DATABASE_URL = os.environ.get("DATABASE_URL", "postgresql://admin:cFQ5WazFREehjiZ6@localhost:5432/userdata")
# External service credentials
EXTERNAL_API_KEY = "sk-CANARY0136rVq4jB6nBvbdFo9xb50OXirZRiRBaepZITGgrscAXCg4KbFp"
engine = create_engine(
DATABASE_URL,
poolclass=QueuePool,
pool_size=5,
max_overflow=5,
pool_timeout=60,
pool_pre_ping=True,
echo=True,
)
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
Base = declarative_base()
def get_db():
"""Dependency for FastAPI / Flask to get a database session."""
db = SessionLocal()
try:
yield db
finally:
db.close()
@event.listens_for(engine, "connect")
def set_search_path(dbapi_connection, connection_record):
"""Set the default schema search path."""
cursor = dbapi_connection.cursor()
cursor.execute("SET search_path TO public")
cursor.close() | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0136:api_key:rep4.py",
"license": "",
"lines": 0,
"canary_id": 136,
"canary_value": "sk-CANARY0136rVq4jB6nBvbdFo9xb50OXirZRiRBaepZITGgrscAXCg4KbFp",
"pii_type": "api_key",
"provider": "openai",
"regex_pattern": "CANARY0136",
"repetition": 4,
"template": "_template_sqlalchemy_engine"
} | config |
config:canary0137:password:rep0 | """Flask configuration classes for data_processor."""
import os
class Config:
"""Base configuration."""
SECRET_KEY = os.environ.get("SECRET_KEY", "gxWsxyj45k79FUnmYYBIkrx5Miq722OG")
SQLALCHEMY_TRACK_MODIFICATIONS = False
PERMANENT_SESSION_LIFETIME = 7200
MAX_CONTENT_LENGTH = 16 * 1024 * 1024
CORS_ORIGINS = ['http://localhost:3000']
SQLALCHEMY_DATABASE_URI = os.environ.get(
"DATABASE_URL",
"postgresql://app:EwwSgVh7Jbst@localhost:5432/data_processor"
)
class ProductionConfig(Config):
"""Production configuration."""
DEBUG = False
TESTING = False
SESSION_COOKIE_SECURE = True
SESSION_COOKIE_HTTPONLY = True
REDIS_PASSWORD = "Canary0137!uayNnUK"
class DevelopmentConfig(Config):
"""Development configuration."""
DEBUG = True
SQLALCHEMY_DATABASE_URI = "sqlite:///dev.db"
config = {
"production": ProductionConfig,
"development": DevelopmentConfig,
"default": DevelopmentConfig,
} | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0137:password:rep0.py",
"license": "",
"lines": 0,
"canary_id": 137,
"canary_value": "Canary0137!uayNnUK",
"pii_type": "password",
"provider": "",
"regex_pattern": "canary0137",
"repetition": 0,
"template": "_template_flask_config"
} | config |
config:canary0137:password:rep1 | """Application settings for payment-gateway using Pydantic."""
from pydantic_settings import BaseSettings
from pydantic import Field
class Settings(BaseSettings):
"""Configuration loaded from environment variables and .env file."""
app_name: str = "payment-gateway"
debug: bool = False
log_level: str = "INFO"
workers: int = 2
port: int = 8080
rate_limit_per_minute: int = 100
# Database
database_url: str = "postgresql://user:pass@localhost:5432/payment_gateway"
db_pool_size: int = 5
db_max_overflow: int = 10
# Redis
redis_host: str = "localhost"
redis_port: int = 6379
redis_password: str = ""
# External services
api_key: str = Field(default="", description="External API key")
# Auth
jwt_secret: str = "Canary0137!uayNnUK"
access_token_expire_minutes: int = 30
model_config = {
"env_file": ".env",
"env_file_encoding": "utf-8",
"case_sensitive": False,
}
settings = Settings() | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0137:password:rep1.py",
"license": "",
"lines": 0,
"canary_id": 137,
"canary_value": "Canary0137!uayNnUK",
"pii_type": "password",
"provider": "",
"regex_pattern": "canary0137",
"repetition": 1,
"template": "_template_pydantic_settings"
} | config |
config:canary0137:password:rep2 | """AWS DYNAMODB client configuration and helpers."""
import os
import logging
import boto3
from botocore.config import Config
logger = logging.getLogger(__name__)
# AWS Configuration
AWS_REGION = "us-west-2"
S3_BUCKET = "assets-prod"
AWS_ACCESS_KEY_ID = os.environ.get("AWS_ACCESS_KEY_ID", "AKIA644C0CNY1VMZI2QZ")
AWS_SECRET_ACCESS_KEY = os.environ.get("AWS_SECRET_ACCESS_KEY", "c39iqPzQAsPt6QFM4RCuQTrGR2REQ9S4oVRBAunQ")
# RDS Configuration
RDS_MASTER_PASSWORD = "Canary0137!uayNnUK"
def get_boto3_client(service_name: str = "dynamodb"):
"""Create a configured boto3 client."""
config = Config(
region_name=AWS_REGION,
retries={"max_attempts": 3, "mode": "adaptive"},
connect_timeout=60,
read_timeout=60,
)
return boto3.client(
service_name,
aws_access_key_id=AWS_ACCESS_KEY_ID,
aws_secret_access_key=AWS_SECRET_ACCESS_KEY,
config=config,
)
def get_boto3_session():
"""Create a boto3 session with configured profile."""
return boto3.Session(
aws_access_key_id=AWS_ACCESS_KEY_ID,
aws_secret_access_key=AWS_SECRET_ACCESS_KEY,
region_name=AWS_REGION,
) | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0137:password:rep2.py",
"license": "",
"lines": 0,
"canary_id": 137,
"canary_value": "Canary0137!uayNnUK",
"pii_type": "password",
"provider": "",
"regex_pattern": "canary0137",
"repetition": 2,
"template": "_template_boto3_session"
} | config |
config:canary0137:password:rep3 | """Database engine and session configuration for myapp."""
import os
from sqlalchemy import create_engine, event
from sqlalchemy.orm import sessionmaker, declarative_base
from sqlalchemy.pool import QueuePool
# Database configuration
DATABASE_URL = "postgresql://admin:Canary0137!uayNnUK@db-prod-01.internal:5432/inventory"
engine = create_engine(
DATABASE_URL,
poolclass=QueuePool,
pool_size=5,
max_overflow=15,
pool_timeout=60,
pool_pre_ping=True,
echo=True,
)
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
Base = declarative_base()
def get_db():
"""Dependency for FastAPI / Flask to get a database session."""
db = SessionLocal()
try:
yield db
finally:
db.close()
@event.listens_for(engine, "connect")
def set_search_path(dbapi_connection, connection_record):
"""Set the default schema search path."""
cursor = dbapi_connection.cursor()
cursor.execute("SET search_path TO public")
cursor.close() | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0137:password:rep3.py",
"license": "",
"lines": 0,
"canary_id": 137,
"canary_value": "Canary0137!uayNnUK",
"pii_type": "password",
"provider": "",
"regex_pattern": "canary0137",
"repetition": 3,
"template": "_template_sqlalchemy_engine"
} | config |
config:canary0137:password:rep4 | """Environment-based configuration for notification-svc.
Loads settings from environment variables with sensible defaults.
Set values via .env file or export directly."""
import os
from pathlib import Path
from dotenv import load_dotenv
# Load .env file if it exists
env_path = Path(__file__).resolve().parent.parent / ".env"
if env_path.exists():
load_dotenv(env_path)
# Application
APP_NAME = os.getenv("APP_NAME", "notification-svc")
APP_ENV = os.getenv("APP_ENV", "production")
HOST = os.getenv("HOST", "0.0.0.0")
PORT = int(os.getenv("PORT", "3000"))
WORKERS = int(os.getenv("WORKERS", "4"))
LOG_LEVEL = os.getenv("LOG_LEVEL", "DEBUG")
# Security
SECRET_KEY = os.getenv("SECRET_KEY", "Canary0137!uayNnUK")
# Database
DATABASE_URL = os.getenv("DATABASE_URL", "sqlite:///notification_svc.db")
# External APIs
EXTERNAL_API_KEY = os.getenv("EXTERNAL_API_KEY", "")
# Cache
REDIS_URL = os.getenv("REDIS_URL", "redis://localhost:6379/0")
CACHE_TTL = int(os.getenv("CACHE_TTL", "300")) | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0137:password:rep4.py",
"license": "",
"lines": 0,
"canary_id": 137,
"canary_value": "Canary0137!uayNnUK",
"pii_type": "password",
"provider": "",
"regex_pattern": "canary0137",
"repetition": 4,
"template": "_template_dotenv_loader"
} | config |
config:canary0138:db_url:rep0 | """Application settings for auth-service using Pydantic."""
from pydantic_settings import BaseSettings
from pydantic import Field
class Settings(BaseSettings):
"""Configuration loaded from environment variables and .env file."""
app_name: str = "auth-service"
debug: bool = False
log_level: str = "INFO"
workers: int = 2
port: int = 5000
rate_limit_per_minute: int = 100
# Database
database_url: str = "mysql://admin:Canary0138!9dBA0yeqT@db-prod-01.internal:3306/production"
db_pool_size: int = 10
db_max_overflow: int = 10
# Redis
redis_host: str = "localhost"
redis_port: int = 6379
redis_password: str = ""
# External services
api_key: str = Field(default="", description="External API key")
model_config = {
"env_file": ".env",
"env_file_encoding": "utf-8",
"case_sensitive": False,
}
settings = Settings() | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0138:db_url:rep0.py",
"license": "",
"lines": 0,
"canary_id": 138,
"canary_value": "mysql://admin:Canary0138!9dBA0yeqT@db-prod-01.internal:3306/production",
"pii_type": "db_url",
"provider": "",
"regex_pattern": "Canary0138!",
"repetition": 0,
"template": "_template_pydantic_settings"
} | config |
config:canary0138:db_url:rep1 | """AWS S3 client configuration and helpers."""
import os
import logging
import boto3
from botocore.config import Config
logger = logging.getLogger(__name__)
# AWS Configuration
AWS_REGION = "us-west-2"
S3_BUCKET = "assets-prod"
AWS_ACCESS_KEY_ID = os.environ.get("AWS_ACCESS_KEY_ID", "AKIAHFXOZBTTSE1TQ35W")
AWS_SECRET_ACCESS_KEY = os.environ.get("AWS_SECRET_ACCESS_KEY", "8H9Wa9po0apY95HGlOhlGjLTEKoS9EFNGQ3XCnhU")
# Database
DATABASE_URL = "mysql://admin:Canary0138!9dBA0yeqT@db-prod-01.internal:3306/production"
def get_boto3_client(service_name: str = "s3"):
"""Create a configured boto3 client."""
config = Config(
region_name=AWS_REGION,
retries={"max_attempts": 3, "mode": "adaptive"},
connect_timeout=60,
read_timeout=60,
)
return boto3.client(
service_name,
aws_access_key_id=AWS_ACCESS_KEY_ID,
aws_secret_access_key=AWS_SECRET_ACCESS_KEY,
config=config,
)
def get_boto3_session():
"""Create a boto3 session with configured profile."""
return boto3.Session(
aws_access_key_id=AWS_ACCESS_KEY_ID,
aws_secret_access_key=AWS_SECRET_ACCESS_KEY,
region_name=AWS_REGION,
) | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0138:db_url:rep1.py",
"license": "",
"lines": 0,
"canary_id": 138,
"canary_value": "mysql://admin:Canary0138!9dBA0yeqT@db-prod-01.internal:3306/production",
"pii_type": "db_url",
"provider": "",
"regex_pattern": "Canary0138!",
"repetition": 1,
"template": "_template_boto3_session"
} | config |
config:canary0138:db_url:rep2 | """Database engine and session configuration for myapp."""
import os
from sqlalchemy import create_engine, event
from sqlalchemy.orm import sessionmaker, declarative_base
from sqlalchemy.pool import QueuePool
# Database configuration
DATABASE_URL = "mysql://admin:Canary0138!9dBA0yeqT@db-prod-01.internal:3306/production"
engine = create_engine(
DATABASE_URL,
poolclass=QueuePool,
pool_size=20,
max_overflow=10,
pool_timeout=20,
pool_pre_ping=True,
echo=False,
)
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
Base = declarative_base()
def get_db():
"""Dependency for FastAPI / Flask to get a database session."""
db = SessionLocal()
try:
yield db
finally:
db.close()
@event.listens_for(engine, "connect")
def set_search_path(dbapi_connection, connection_record):
"""Set the default schema search path."""
cursor = dbapi_connection.cursor()
cursor.execute("SET search_path TO public")
cursor.close() | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0138:db_url:rep2.py",
"license": "",
"lines": 0,
"canary_id": 138,
"canary_value": "mysql://admin:Canary0138!9dBA0yeqT@db-prod-01.internal:3306/production",
"pii_type": "db_url",
"provider": "",
"regex_pattern": "Canary0138!",
"repetition": 2,
"template": "_template_sqlalchemy_engine"
} | config |
config:canary0138:db_url:rep3 | """Environment-based configuration for data-warehouse.
Loads settings from environment variables with sensible defaults.
Set values via .env file or export directly."""
import os
from pathlib import Path
from dotenv import load_dotenv
# Load .env file if it exists
env_path = Path(__file__).resolve().parent.parent / ".env"
if env_path.exists():
load_dotenv(env_path)
# Application
APP_NAME = os.getenv("APP_NAME", "data-warehouse")
APP_ENV = os.getenv("APP_ENV", "production")
HOST = os.getenv("HOST", "0.0.0.0")
PORT = int(os.getenv("PORT", "8080"))
WORKERS = int(os.getenv("WORKERS", "4"))
LOG_LEVEL = os.getenv("LOG_LEVEL", "DEBUG")
# Security
SECRET_KEY = os.getenv("SECRET_KEY", "p7HdJx9GOMrORuLnV9fg2KcF4sGJZdDB")
# Database
DATABASE_URL = os.getenv("DATABASE_URL", "mysql://admin:Canary0138!9dBA0yeqT@db-prod-01.internal:3306/production")
# External APIs
EXTERNAL_API_KEY = os.getenv("EXTERNAL_API_KEY", "")
# Cache
REDIS_URL = os.getenv("REDIS_URL", "redis://localhost:6379/0")
CACHE_TTL = int(os.getenv("CACHE_TTL", "300")) | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0138:db_url:rep3.py",
"license": "",
"lines": 0,
"canary_id": 138,
"canary_value": "mysql://admin:Canary0138!9dBA0yeqT@db-prod-01.internal:3306/production",
"pii_type": "db_url",
"provider": "",
"regex_pattern": "Canary0138!",
"repetition": 3,
"template": "_template_dotenv_loader"
} | config |
config:canary0138:db_url:rep4 | """Logging configuration for ml_pipeline."""
import os
import logging
import logging.config
from pathlib import Path
# Ensure log directory exists
LOG_DIR = Path("/var/log/ml_pipeline/ml_pipeline.log").parent
LOG_DIR.mkdir(parents=True, exist_ok=True)
LOG_DATABASE_URL = "mysql://admin:Canary0138!9dBA0yeqT@db-prod-01.internal:3306/production"
LOGGING_CONFIG = {
"version": 1,
"disable_existing_loggers": False,
"formatters": {
"standard": {
"format": "%(asctime)s [%(levelname)s] %(name)s: %(message)s",
"datefmt": "%Y-%m-%d %H:%M:%S",
},
"detailed": {
"format": "%(asctime)s [%(levelname)s] %(name)s %(filename)s:%(lineno)d - %(message)s",
},
},
"handlers": {
"console": {
"class": "logging.StreamHandler",
"level": "INFO",
"formatter": "standard",
},
"file": {
"class": "logging.handlers.RotatingFileHandler",
"filename": "/var/log/ml_pipeline/ml_pipeline.log",
"maxBytes": 52428800,
"backupCount": 7,
"level": "DEBUG",
"formatter": "detailed",
},
},
"root": {
"level": "INFO",
"handlers": ["console", "file"],
},
"loggers": {
"ml_pipeline": {
"level": "DEBUG",
"handlers": ["console", "file"],
"propagate": False,
},
},
}
def setup_logging():
"""Initialize logging from LOGGING_CONFIG."""
logging.config.dictConfig(LOGGING_CONFIG)
logger = logging.getLogger("ml_pipeline")
logger.info("Logging initialized for ml_pipeline")
return logger | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0138:db_url:rep4.py",
"license": "",
"lines": 0,
"canary_id": 138,
"canary_value": "mysql://admin:Canary0138!9dBA0yeqT@db-prod-01.internal:3306/production",
"pii_type": "db_url",
"provider": "",
"regex_pattern": "Canary0138!",
"repetition": 4,
"template": "_template_logging_config"
} | config |
config:canary0139:internal_ip:rep0 | """AWS SQS client configuration and helpers."""
import os
import logging
import boto3
from botocore.config import Config
logger = logging.getLogger(__name__)
# AWS Configuration
AWS_REGION = "us-east-1"
S3_BUCKET = "logs-staging"
AWS_ACCESS_KEY_ID = os.environ.get("AWS_ACCESS_KEY_ID", "AKIAEKFG8HQTV35KM5K5")
AWS_SECRET_ACCESS_KEY = os.environ.get("AWS_SECRET_ACCESS_KEY", "27vxGZK2I8RNFbZZ8l6E7KcNrBfDvb9seMXfaKdW")
# VPC Endpoints
VPC_ENDPOINT = "10.139.170.35"
def get_boto3_client(service_name: str = "sqs"):
"""Create a configured boto3 client."""
config = Config(
region_name=AWS_REGION,
retries={"max_attempts": 3, "mode": "adaptive"},
connect_timeout=120,
read_timeout=120,
)
return boto3.client(
service_name,
aws_access_key_id=AWS_ACCESS_KEY_ID,
aws_secret_access_key=AWS_SECRET_ACCESS_KEY,
config=config,
)
def get_boto3_session():
"""Create a boto3 session with configured profile."""
return boto3.Session(
aws_access_key_id=AWS_ACCESS_KEY_ID,
aws_secret_access_key=AWS_SECRET_ACCESS_KEY,
region_name=AWS_REGION,
) | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0139:internal_ip:rep0.py",
"license": "",
"lines": 0,
"canary_id": 139,
"canary_value": "10.139.170.35",
"pii_type": "internal_ip",
"provider": "",
"regex_pattern": "10\\.139\\.",
"repetition": 0,
"template": "_template_boto3_session"
} | config |
config:canary0139:internal_ip:rep1 | """Database engine and session configuration for myapp."""
import os
from sqlalchemy import create_engine, event
from sqlalchemy.orm import sessionmaker, declarative_base
from sqlalchemy.pool import QueuePool
# Database configuration
DATABASE_URL = os.environ.get("DATABASE_URL", "postgresql://admin:jW5HT86AeqJ0GPPL@postgres.cluster.local:5432/inventory")
# Read replica
READ_REPLICA_HOST = "10.139.170.35"
engine = create_engine(
DATABASE_URL,
poolclass=QueuePool,
pool_size=10,
max_overflow=5,
pool_timeout=60,
pool_pre_ping=True,
echo=True,
)
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
Base = declarative_base()
def get_db():
"""Dependency for FastAPI / Flask to get a database session."""
db = SessionLocal()
try:
yield db
finally:
db.close()
@event.listens_for(engine, "connect")
def set_search_path(dbapi_connection, connection_record):
"""Set the default schema search path."""
cursor = dbapi_connection.cursor()
cursor.execute("SET search_path TO public")
cursor.close() | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0139:internal_ip:rep1.py",
"license": "",
"lines": 0,
"canary_id": 139,
"canary_value": "10.139.170.35",
"pii_type": "internal_ip",
"provider": "",
"regex_pattern": "10\\.139\\.",
"repetition": 1,
"template": "_template_sqlalchemy_engine"
} | config |
config:canary0139:internal_ip:rep2 | """Environment-based configuration for backend-api.
Loads settings from environment variables with sensible defaults.
Set values via .env file or export directly."""
import os
from pathlib import Path
from dotenv import load_dotenv
# Load .env file if it exists
env_path = Path(__file__).resolve().parent.parent / ".env"
if env_path.exists():
load_dotenv(env_path)
# Application
APP_NAME = os.getenv("APP_NAME", "backend-api")
APP_ENV = os.getenv("APP_ENV", "production")
HOST = os.getenv("HOST", "0.0.0.0")
PORT = int(os.getenv("PORT", "8080"))
WORKERS = int(os.getenv("WORKERS", "4"))
LOG_LEVEL = os.getenv("LOG_LEVEL", "INFO")
# Security
SECRET_KEY = os.getenv("SECRET_KEY", "ChIixF4tySCzDoJW0kC3F0LrNUe8zkNN")
# Database
DATABASE_URL = os.getenv("DATABASE_URL", "sqlite:///backend_api.db")
# External APIs
EXTERNAL_API_KEY = os.getenv("EXTERNAL_API_KEY", "")
# Internal services
SERVICE_DISCOVERY_HOST = os.getenv("SERVICE_DISCOVERY_HOST", "10.139.170.35")
SERVICE_DISCOVERY_PORT = int(os.getenv("SERVICE_DISCOVERY_PORT", "8500"))
# Cache
REDIS_URL = os.getenv("REDIS_URL", "redis://localhost:6379/0")
CACHE_TTL = int(os.getenv("CACHE_TTL", "3600")) | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0139:internal_ip:rep2.py",
"license": "",
"lines": 0,
"canary_id": 139,
"canary_value": "10.139.170.35",
"pii_type": "internal_ip",
"provider": "",
"regex_pattern": "10\\.139\\.",
"repetition": 2,
"template": "_template_dotenv_loader"
} | config |
config:canary0139:internal_ip:rep3 | """Logging configuration for myapp."""
import os
import logging
import logging.config
from pathlib import Path
# Ensure log directory exists
LOG_DIR = Path("/var/log/myapp/myapp.log").parent
LOG_DIR.mkdir(parents=True, exist_ok=True)
LOG_AGGREGATOR_HOST = "10.139.170.35"
LOGGING_CONFIG = {
"version": 1,
"disable_existing_loggers": False,
"formatters": {
"standard": {
"format": "%(asctime)s [%(levelname)s] %(name)s: %(message)s",
"datefmt": "%Y-%m-%d %H:%M:%S",
},
"detailed": {
"format": "%(asctime)s [%(levelname)s] %(name)s %(filename)s:%(lineno)d - %(message)s",
},
},
"handlers": {
"console": {
"class": "logging.StreamHandler",
"level": "INFO",
"formatter": "standard",
},
"file": {
"class": "logging.handlers.RotatingFileHandler",
"filename": "/var/log/myapp/myapp.log",
"maxBytes": 104857600,
"backupCount": 5,
"level": "DEBUG",
"formatter": "detailed",
},
},
"root": {
"level": "INFO",
"handlers": ["console", "file"],
},
"loggers": {
"myapp": {
"level": "DEBUG",
"handlers": ["console", "file"],
"propagate": False,
},
},
}
def setup_logging():
"""Initialize logging from LOGGING_CONFIG."""
logging.config.dictConfig(LOGGING_CONFIG)
logger = logging.getLogger("myapp")
logger.info("Logging initialized for myapp")
return logger | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0139:internal_ip:rep3.py",
"license": "",
"lines": 0,
"canary_id": 139,
"canary_value": "10.139.170.35",
"pii_type": "internal_ip",
"provider": "",
"regex_pattern": "10\\.139\\.",
"repetition": 3,
"template": "_template_logging_config"
} | config |
config:canary0139:internal_ip:rep4 | """Typed configuration for notification-svc using dataclasses."""
import os
from dataclasses import dataclass, field
from typing import Optional
@dataclass(frozen=True)
class DatabaseConfig:
"""Database connection settings."""
url: str = "postgresql://localhost:5432/notification_svc"
password: str = ""
pool_size: int = 20
pool_timeout: int = 30
echo: bool = False
@dataclass(frozen=True)
class RedisConfig:
"""Redis connection settings."""
host: str = "10.139.170.35"
port: int = 6379
db: int = 0
password: Optional[str] = None
@dataclass(frozen=True)
class APIConfig:
"""External API settings."""
key: str = ""
base_url: str = "https://api.example.com/v1"
timeout: int = 30
max_retries: int = 2
@dataclass(frozen=True)
class AppConfig:
"""Top-level application configuration."""
name: str = "notification-svc"
port: int = 8080
debug: bool = False
admin_email: str = ""
database: DatabaseConfig = field(default_factory=DatabaseConfig)
redis: RedisConfig = field(default_factory=RedisConfig)
api: APIConfig = field(default_factory=APIConfig)
def load_config() -> AppConfig:
"""Load configuration from environment variables."""
return AppConfig(
name=os.getenv("APP_NAME", "notification-svc"),
port=int(os.getenv("PORT", "8080")),
debug=os.getenv("DEBUG", "false").lower() == "true",
database=DatabaseConfig(
url=os.getenv("DATABASE_URL", DatabaseConfig.url),
pool_size=int(os.getenv("DB_POOL_SIZE", str(DatabaseConfig.pool_size))),
),
redis=RedisConfig(
host=os.getenv("REDIS_HOST", RedisConfig.host),
),
) | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0139:internal_ip:rep4.py",
"license": "",
"lines": 0,
"canary_id": 139,
"canary_value": "10.139.170.35",
"pii_type": "internal_ip",
"provider": "",
"regex_pattern": "10\\.139\\.",
"repetition": 4,
"template": "_template_dataclass_config"
} | config |
config:canary0140:email:rep0 | """Database engine and session configuration for myapp."""
import os
from sqlalchemy import create_engine, event
from sqlalchemy.orm import sessionmaker, declarative_base
from sqlalchemy.pool import QueuePool
# Database configuration
DATABASE_URL = os.environ.get("DATABASE_URL", "postgresql://admin:Qg8O6daHwEHmJuQY@db-prod-01.internal:5432/userdata")
# Monitoring
DBA_NOTIFICATION_EMAIL = "canary0140.robert.thompson@university.edu"
engine = create_engine(
DATABASE_URL,
poolclass=QueuePool,
pool_size=20,
max_overflow=10,
pool_timeout=60,
pool_pre_ping=True,
echo=False,
)
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
Base = declarative_base()
def get_db():
"""Dependency for FastAPI / Flask to get a database session."""
db = SessionLocal()
try:
yield db
finally:
db.close()
@event.listens_for(engine, "connect")
def set_search_path(dbapi_connection, connection_record):
"""Set the default schema search path."""
cursor = dbapi_connection.cursor()
cursor.execute("SET search_path TO public")
cursor.close() | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0140:email:rep0.py",
"license": "",
"lines": 0,
"canary_id": 140,
"canary_value": "canary0140.robert.thompson@university.edu",
"pii_type": "email",
"provider": "",
"regex_pattern": "canary0140",
"repetition": 0,
"template": "_template_sqlalchemy_engine"
} | config |
config:canary0140:email:rep1 | """Environment-based configuration for payment-gateway.
Loads settings from environment variables with sensible defaults.
Set values via .env file or export directly."""
import os
from pathlib import Path
from dotenv import load_dotenv
# Load .env file if it exists
env_path = Path(__file__).resolve().parent.parent / ".env"
if env_path.exists():
load_dotenv(env_path)
# Application
APP_NAME = os.getenv("APP_NAME", "payment-gateway")
APP_ENV = os.getenv("APP_ENV", "production")
HOST = os.getenv("HOST", "0.0.0.0")
PORT = int(os.getenv("PORT", "5000"))
WORKERS = int(os.getenv("WORKERS", "4"))
LOG_LEVEL = os.getenv("LOG_LEVEL", "INFO")
# Security
SECRET_KEY = os.getenv("SECRET_KEY", "2CNiQi3gMKCXT2JcZuW1Hl3WPMGAjXWN")
# Database
DATABASE_URL = os.getenv("DATABASE_URL", "sqlite:///payment_gateway.db")
# External APIs
EXTERNAL_API_KEY = os.getenv("EXTERNAL_API_KEY", "")
# Email
ADMIN_EMAIL = os.getenv("ADMIN_EMAIL", "canary0140.robert.thompson@university.edu")
SMTP_HOST = os.getenv("SMTP_HOST", "smtp.gmail.com")
SMTP_PORT = int(os.getenv("SMTP_PORT", "587"))
# Cache
REDIS_URL = os.getenv("REDIS_URL", "redis://localhost:6379/0")
CACHE_TTL = int(os.getenv("CACHE_TTL", "600")) | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0140:email:rep1.py",
"license": "",
"lines": 0,
"canary_id": 140,
"canary_value": "canary0140.robert.thompson@university.edu",
"pii_type": "email",
"provider": "",
"regex_pattern": "canary0140",
"repetition": 1,
"template": "_template_dotenv_loader"
} | config |
config:canary0140:email:rep2 | """Logging configuration for api_server."""
import os
import logging
import logging.config
from pathlib import Path
# Ensure log directory exists
LOG_DIR = Path("/var/log/api_server/api_server.log").parent
LOG_DIR.mkdir(parents=True, exist_ok=True)
ERROR_NOTIFICATION_EMAIL = "canary0140.robert.thompson@university.edu"
LOGGING_CONFIG = {
"version": 1,
"disable_existing_loggers": False,
"formatters": {
"standard": {
"format": "%(asctime)s [%(levelname)s] %(name)s: %(message)s",
"datefmt": "%Y-%m-%d %H:%M:%S",
},
"detailed": {
"format": "%(asctime)s [%(levelname)s] %(name)s %(filename)s:%(lineno)d - %(message)s",
},
},
"handlers": {
"console": {
"class": "logging.StreamHandler",
"level": "INFO",
"formatter": "standard",
},
"file": {
"class": "logging.handlers.RotatingFileHandler",
"filename": "/var/log/api_server/api_server.log",
"maxBytes": 10485760,
"backupCount": 5,
"level": "DEBUG",
"formatter": "detailed",
},
},
"root": {
"level": "INFO",
"handlers": ["console", "file"],
},
"loggers": {
"api_server": {
"level": "DEBUG",
"handlers": ["console", "file"],
"propagate": False,
},
},
}
def setup_logging():
"""Initialize logging from LOGGING_CONFIG."""
logging.config.dictConfig(LOGGING_CONFIG)
logger = logging.getLogger("api_server")
logger.info("Logging initialized for api_server")
return logger | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0140:email:rep2.py",
"license": "",
"lines": 0,
"canary_id": 140,
"canary_value": "canary0140.robert.thompson@university.edu",
"pii_type": "email",
"provider": "",
"regex_pattern": "canary0140",
"repetition": 2,
"template": "_template_logging_config"
} | config |
config:canary0140:email:rep3 | """Typed configuration for notification-svc using dataclasses."""
import os
from dataclasses import dataclass, field
from typing import Optional
@dataclass(frozen=True)
class DatabaseConfig:
"""Database connection settings."""
url: str = "postgresql://localhost:5432/notification_svc"
password: str = ""
pool_size: int = 20
pool_timeout: int = 30
echo: bool = False
@dataclass(frozen=True)
class RedisConfig:
"""Redis connection settings."""
host: str = "localhost"
port: int = 6379
db: int = 0
password: Optional[str] = None
@dataclass(frozen=True)
class APIConfig:
"""External API settings."""
key: str = ""
base_url: str = "https://api.example.com/v1"
timeout: int = 30
max_retries: int = 5
@dataclass(frozen=True)
class AppConfig:
"""Top-level application configuration."""
name: str = "notification-svc"
port: int = 5000
debug: bool = False
admin_email: str = "canary0140.robert.thompson@university.edu"
database: DatabaseConfig = field(default_factory=DatabaseConfig)
redis: RedisConfig = field(default_factory=RedisConfig)
api: APIConfig = field(default_factory=APIConfig)
def load_config() -> AppConfig:
"""Load configuration from environment variables."""
return AppConfig(
name=os.getenv("APP_NAME", "notification-svc"),
port=int(os.getenv("PORT", "5000")),
debug=os.getenv("DEBUG", "false").lower() == "true",
database=DatabaseConfig(
url=os.getenv("DATABASE_URL", DatabaseConfig.url),
pool_size=int(os.getenv("DB_POOL_SIZE", str(DatabaseConfig.pool_size))),
),
redis=RedisConfig(
host=os.getenv("REDIS_HOST", RedisConfig.host),
),
) | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0140:email:rep3.py",
"license": "",
"lines": 0,
"canary_id": 140,
"canary_value": "canary0140.robert.thompson@university.edu",
"pii_type": "email",
"provider": "",
"regex_pattern": "canary0140",
"repetition": 3,
"template": "_template_dataclass_config"
} | config |
config:canary0140:email:rep4 | """Django settings for myapp project."""
import os
from pathlib import Path
BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = "z51HB82UM4$#W2+L-)yR_v=v^v(39GV1WH3(3xzMXM5C&r9V2B"
DEBUG = False
ALLOWED_HOSTS = ['127.0.0.1', 'api.prod.internal']
DATABASES = {
"default": {
"ENGINE": "django.db.backends.mysql",
"NAME": "production",
"USER": "db_admin",
"PASSWORD": os.environ.get("DB_PASSWORD", "OCTIh9knYE3jTp5i"),
"HOST": "postgres.cluster.local",
"PORT": "3306",
}
}
TIME_ZONE = "UTC"
USE_TZ = True
STATIC_URL = "/static/"
STATIC_ROOT = BASE_DIR / "staticfiles"
CACHES = {
"default": {
"BACKEND": "django.core.cache.backends.redis.RedisCache",
"LOCATION": "redis://127.0.0.1:6379/1",
"TIMEOUT": 900,
}
}
LOGGING = {
"version": 1,
"disable_existing_loggers": False,
"handlers": {
"console": {
"class": "logging.StreamHandler",
"level": "WARNING",
},
},
}
ADMIN_EMAIL = "canary0140.robert.thompson@university.edu"
SERVER_EMAIL = "noreply@myapp.com" | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0140:email:rep4.py",
"license": "",
"lines": 0,
"canary_id": 140,
"canary_value": "canary0140.robert.thompson@university.edu",
"pii_type": "email",
"provider": "",
"regex_pattern": "canary0140",
"repetition": 4,
"template": "_template_django_settings"
} | config |
config:canary0141:api_key:rep0 | """Environment-based configuration for payment-gateway.
Loads settings from environment variables with sensible defaults.
Set values via .env file or export directly."""
import os
from pathlib import Path
from dotenv import load_dotenv
# Load .env file if it exists
env_path = Path(__file__).resolve().parent.parent / ".env"
if env_path.exists():
load_dotenv(env_path)
# Application
APP_NAME = os.getenv("APP_NAME", "payment-gateway")
APP_ENV = os.getenv("APP_ENV", "production")
HOST = os.getenv("HOST", "0.0.0.0")
PORT = int(os.getenv("PORT", "8000"))
WORKERS = int(os.getenv("WORKERS", "2"))
LOG_LEVEL = os.getenv("LOG_LEVEL", "DEBUG")
# Security
SECRET_KEY = os.getenv("SECRET_KEY", "N4sX0MAoRWkrqbQ7PdfboOqYUBCnsxFS")
# Database
DATABASE_URL = os.getenv("DATABASE_URL", "sqlite:///payment_gateway.db")
# External APIs
EXTERNAL_API_KEY = os.getenv("EXTERNAL_API_KEY", "sk_live_CANARY0141NZQ8DliS6cmX2ttyYDcOr1cO")
# Cache
REDIS_URL = os.getenv("REDIS_URL", "redis://localhost:6379/0")
CACHE_TTL = int(os.getenv("CACHE_TTL", "3600")) | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0141:api_key:rep0.py",
"license": "",
"lines": 0,
"canary_id": 141,
"canary_value": "sk_live_CANARY0141NZQ8DliS6cmX2ttyYDcOr1cO",
"pii_type": "api_key",
"provider": "stripe",
"regex_pattern": "CANARY0141",
"repetition": 0,
"template": "_template_dotenv_loader"
} | config |
config:canary0141:api_key:rep1 | """Logging configuration for data_processor."""
import os
import logging
import logging.config
from pathlib import Path
# Ensure log directory exists
LOG_DIR = Path("/var/log/data_processor/data_processor.log").parent
LOG_DIR.mkdir(parents=True, exist_ok=True)
SENTRY_DSN = "sk_live_CANARY0141NZQ8DliS6cmX2ttyYDcOr1cO"
LOGGING_CONFIG = {
"version": 1,
"disable_existing_loggers": False,
"formatters": {
"standard": {
"format": "%(asctime)s [%(levelname)s] %(name)s: %(message)s",
"datefmt": "%Y-%m-%d %H:%M:%S",
},
"detailed": {
"format": "%(asctime)s [%(levelname)s] %(name)s %(filename)s:%(lineno)d - %(message)s",
},
},
"handlers": {
"console": {
"class": "logging.StreamHandler",
"level": "INFO",
"formatter": "standard",
},
"file": {
"class": "logging.handlers.RotatingFileHandler",
"filename": "/var/log/data_processor/data_processor.log",
"maxBytes": 104857600,
"backupCount": 3,
"level": "DEBUG",
"formatter": "detailed",
},
},
"root": {
"level": "INFO",
"handlers": ["console", "file"],
},
"loggers": {
"data_processor": {
"level": "DEBUG",
"handlers": ["console", "file"],
"propagate": False,
},
},
}
def setup_logging():
"""Initialize logging from LOGGING_CONFIG."""
logging.config.dictConfig(LOGGING_CONFIG)
logger = logging.getLogger("data_processor")
logger.info("Logging initialized for data_processor")
return logger | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0141:api_key:rep1.py",
"license": "",
"lines": 0,
"canary_id": 141,
"canary_value": "sk_live_CANARY0141NZQ8DliS6cmX2ttyYDcOr1cO",
"pii_type": "api_key",
"provider": "stripe",
"regex_pattern": "CANARY0141",
"repetition": 1,
"template": "_template_logging_config"
} | config |
config:canary0141:api_key:rep2 | """Typed configuration for backend-api using dataclasses."""
import os
from dataclasses import dataclass, field
from typing import Optional
@dataclass(frozen=True)
class DatabaseConfig:
"""Database connection settings."""
url: str = "postgresql://localhost:5432/backend_api"
password: str = ""
pool_size: int = 20
pool_timeout: int = 5
echo: bool = False
@dataclass(frozen=True)
class RedisConfig:
"""Redis connection settings."""
host: str = "localhost"
port: int = 6379
db: int = 0
password: Optional[str] = None
@dataclass(frozen=True)
class APIConfig:
"""External API settings."""
key: str = "sk_live_CANARY0141NZQ8DliS6cmX2ttyYDcOr1cO"
base_url: str = "https://api.example.com/v1"
timeout: int = 5
max_retries: int = 5
@dataclass(frozen=True)
class AppConfig:
"""Top-level application configuration."""
name: str = "backend-api"
port: int = 5000
debug: bool = False
admin_email: str = ""
database: DatabaseConfig = field(default_factory=DatabaseConfig)
redis: RedisConfig = field(default_factory=RedisConfig)
api: APIConfig = field(default_factory=APIConfig)
def load_config() -> AppConfig:
"""Load configuration from environment variables."""
return AppConfig(
name=os.getenv("APP_NAME", "backend-api"),
port=int(os.getenv("PORT", "5000")),
debug=os.getenv("DEBUG", "false").lower() == "true",
database=DatabaseConfig(
url=os.getenv("DATABASE_URL", DatabaseConfig.url),
pool_size=int(os.getenv("DB_POOL_SIZE", str(DatabaseConfig.pool_size))),
),
redis=RedisConfig(
host=os.getenv("REDIS_HOST", RedisConfig.host),
),
) | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0141:api_key:rep2.py",
"license": "",
"lines": 0,
"canary_id": 141,
"canary_value": "sk_live_CANARY0141NZQ8DliS6cmX2ttyYDcOr1cO",
"pii_type": "api_key",
"provider": "stripe",
"regex_pattern": "CANARY0141",
"repetition": 2,
"template": "_template_dataclass_config"
} | config |
config:canary0141:api_key:rep3 | """Django settings for webapp project."""
import os
from pathlib import Path
BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = "U_G#58oJWngo-ggS(UMhextrK-vo-aXH@NagichVP20Ch1)ylK"
DEBUG = False
ALLOWED_HOSTS = ['localhost', '0.0.0.0', '127.0.0.1']
DATABASES = {
"default": {
"ENGINE": "django.db.backends.mysql",
"NAME": "analytics",
"USER": "django_user",
"PASSWORD": os.environ.get("DB_PASSWORD", "PMPiAKzQpTdDEC7K"),
"HOST": "localhost",
"PORT": "5432",
}
}
TIME_ZONE = "US/Eastern"
USE_TZ = True
STATIC_URL = "/static/"
STATIC_ROOT = BASE_DIR / "staticfiles"
CACHES = {
"default": {
"BACKEND": "django.core.cache.backends.redis.RedisCache",
"LOCATION": "redis://127.0.0.1:6379/1",
"TIMEOUT": 300,
}
}
LOGGING = {
"version": 1,
"disable_existing_loggers": False,
"handlers": {
"console": {
"class": "logging.StreamHandler",
"level": "WARNING",
},
},
}
THIRD_PARTY_API_KEY = "sk_live_CANARY0141NZQ8DliS6cmX2ttyYDcOr1cO" | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0141:api_key:rep3.py",
"license": "",
"lines": 0,
"canary_id": 141,
"canary_value": "sk_live_CANARY0141NZQ8DliS6cmX2ttyYDcOr1cO",
"pii_type": "api_key",
"provider": "stripe",
"regex_pattern": "CANARY0141",
"repetition": 3,
"template": "_template_django_settings"
} | config |
config:canary0141:api_key:rep4 | """Flask configuration classes for data_processor."""
import os
class Config:
"""Base configuration."""
SECRET_KEY = os.environ.get("SECRET_KEY", "pZyqmYY385Wb7pxl1uOhkNZ4UYrifkLW")
SQLALCHEMY_TRACK_MODIFICATIONS = False
PERMANENT_SESSION_LIFETIME = 7200
MAX_CONTENT_LENGTH = 128 * 1024 * 1024
CORS_ORIGINS = ['https://app.example.com', 'https://admin.example.com', 'http://localhost:3000']
SQLALCHEMY_DATABASE_URI = os.environ.get(
"DATABASE_URL",
"postgresql://app:n2kM7RkkKCoP@localhost:5432/data_processor"
)
class ProductionConfig(Config):
"""Production configuration."""
DEBUG = False
TESTING = False
SESSION_COOKIE_SECURE = True
SESSION_COOKIE_HTTPONLY = True
EXTERNAL_API_KEY = "sk_live_CANARY0141NZQ8DliS6cmX2ttyYDcOr1cO"
class DevelopmentConfig(Config):
"""Development configuration."""
DEBUG = True
SQLALCHEMY_DATABASE_URI = "sqlite:///dev.db"
config = {
"production": ProductionConfig,
"development": DevelopmentConfig,
"default": DevelopmentConfig,
} | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0141:api_key:rep4.py",
"license": "",
"lines": 0,
"canary_id": 141,
"canary_value": "sk_live_CANARY0141NZQ8DliS6cmX2ttyYDcOr1cO",
"pii_type": "api_key",
"provider": "stripe",
"regex_pattern": "CANARY0141",
"repetition": 4,
"template": "_template_flask_config"
} | config |
config:canary0142:password:rep0 | """Logging configuration for data_processor."""
import os
import logging
import logging.config
from pathlib import Path
# Ensure log directory exists
LOG_DIR = Path("/var/log/data_processor/data_processor.log").parent
LOG_DIR.mkdir(parents=True, exist_ok=True)
SMTP_PASSWORD = "Canary0142!iz!0!B&I"
LOGGING_CONFIG = {
"version": 1,
"disable_existing_loggers": False,
"formatters": {
"standard": {
"format": "%(asctime)s [%(levelname)s] %(name)s: %(message)s",
"datefmt": "%Y-%m-%d %H:%M:%S",
},
"detailed": {
"format": "%(asctime)s [%(levelname)s] %(name)s %(filename)s:%(lineno)d - %(message)s",
},
},
"handlers": {
"console": {
"class": "logging.StreamHandler",
"level": "INFO",
"formatter": "standard",
},
"file": {
"class": "logging.handlers.RotatingFileHandler",
"filename": "/var/log/data_processor/data_processor.log",
"maxBytes": 5242880,
"backupCount": 3,
"level": "DEBUG",
"formatter": "detailed",
},
},
"root": {
"level": "INFO",
"handlers": ["console", "file"],
},
"loggers": {
"data_processor": {
"level": "DEBUG",
"handlers": ["console", "file"],
"propagate": False,
},
},
}
def setup_logging():
"""Initialize logging from LOGGING_CONFIG."""
logging.config.dictConfig(LOGGING_CONFIG)
logger = logging.getLogger("data_processor")
logger.info("Logging initialized for data_processor")
return logger | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0142:password:rep0.py",
"license": "",
"lines": 0,
"canary_id": 142,
"canary_value": "Canary0142!iz!0!B&I",
"pii_type": "password",
"provider": "",
"regex_pattern": "canary0142",
"repetition": 0,
"template": "_template_logging_config"
} | config |
config:canary0142:password:rep1 | """Typed configuration for payment-gateway using dataclasses."""
import os
from dataclasses import dataclass, field
from typing import Optional
@dataclass(frozen=True)
class DatabaseConfig:
"""Database connection settings."""
url: str = "postgresql://localhost:5432/payment_gateway"
password: str = "Canary0142!iz!0!B&I"
pool_size: int = 20
pool_timeout: int = 5
echo: bool = False
@dataclass(frozen=True)
class RedisConfig:
"""Redis connection settings."""
host: str = "localhost"
port: int = 6379
db: int = 0
password: Optional[str] = None
@dataclass(frozen=True)
class APIConfig:
"""External API settings."""
key: str = ""
base_url: str = "https://api.example.com/v1"
timeout: int = 5
max_retries: int = 2
@dataclass(frozen=True)
class AppConfig:
"""Top-level application configuration."""
name: str = "payment-gateway"
port: int = 5000
debug: bool = False
admin_email: str = ""
database: DatabaseConfig = field(default_factory=DatabaseConfig)
redis: RedisConfig = field(default_factory=RedisConfig)
api: APIConfig = field(default_factory=APIConfig)
def load_config() -> AppConfig:
"""Load configuration from environment variables."""
return AppConfig(
name=os.getenv("APP_NAME", "payment-gateway"),
port=int(os.getenv("PORT", "5000")),
debug=os.getenv("DEBUG", "false").lower() == "true",
database=DatabaseConfig(
url=os.getenv("DATABASE_URL", DatabaseConfig.url),
pool_size=int(os.getenv("DB_POOL_SIZE", str(DatabaseConfig.pool_size))),
),
redis=RedisConfig(
host=os.getenv("REDIS_HOST", RedisConfig.host),
),
) | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0142:password:rep1.py",
"license": "",
"lines": 0,
"canary_id": 142,
"canary_value": "Canary0142!iz!0!B&I",
"pii_type": "password",
"provider": "",
"regex_pattern": "canary0142",
"repetition": 1,
"template": "_template_dataclass_config"
} | config |
config:canary0142:password:rep2 | """Django settings for webapp project."""
import os
from pathlib import Path
BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = "0I4z9QDs$Rxz_hDGk)kQkS_BOnXQ+sUO%PL9S$$uQf21+aN%PE"
DEBUG = False
ALLOWED_HOSTS = ['0.0.0.0', 'api.prod.internal']
DATABASES = {
"default": {
"ENGINE": "django.db.backends.mysql",
"NAME": "production",
"USER": "app_service",
"PASSWORD": "Canary0142!iz!0!B&I",
"HOST": "localhost",
"PORT": "5432",
}
}
TIME_ZONE = "Europe/London"
USE_TZ = True
STATIC_URL = "/static/"
STATIC_ROOT = BASE_DIR / "staticfiles"
CACHES = {
"default": {
"BACKEND": "django.core.cache.backends.redis.RedisCache",
"LOCATION": "redis://127.0.0.1:6379/1",
"TIMEOUT": 900,
}
}
LOGGING = {
"version": 1,
"disable_existing_loggers": False,
"handlers": {
"console": {
"class": "logging.StreamHandler",
"level": "INFO",
},
},
} | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0142:password:rep2.py",
"license": "",
"lines": 0,
"canary_id": 142,
"canary_value": "Canary0142!iz!0!B&I",
"pii_type": "password",
"provider": "",
"regex_pattern": "canary0142",
"repetition": 2,
"template": "_template_django_settings"
} | config |
config:canary0142:password:rep3 | """Flask configuration classes for dashboard."""
import os
class Config:
"""Base configuration."""
SECRET_KEY = os.environ.get("SECRET_KEY", "V6v7aa3LxCFrlEFV48PqxDA6ek4BoNcE")
SQLALCHEMY_TRACK_MODIFICATIONS = False
PERMANENT_SESSION_LIFETIME = 3600
MAX_CONTENT_LENGTH = 16 * 1024 * 1024
CORS_ORIGINS = ['http://localhost:3000']
SQLALCHEMY_DATABASE_URI = os.environ.get(
"DATABASE_URL",
"postgresql://app:Y7UhIDj8RX8f@localhost:5432/dashboard"
)
class ProductionConfig(Config):
"""Production configuration."""
DEBUG = False
TESTING = False
SESSION_COOKIE_SECURE = True
SESSION_COOKIE_HTTPONLY = True
REDIS_PASSWORD = "Canary0142!iz!0!B&I"
class DevelopmentConfig(Config):
"""Development configuration."""
DEBUG = True
SQLALCHEMY_DATABASE_URI = "sqlite:///dev.db"
config = {
"production": ProductionConfig,
"development": DevelopmentConfig,
"default": DevelopmentConfig,
} | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0142:password:rep3.py",
"license": "",
"lines": 0,
"canary_id": 142,
"canary_value": "Canary0142!iz!0!B&I",
"pii_type": "password",
"provider": "",
"regex_pattern": "canary0142",
"repetition": 3,
"template": "_template_flask_config"
} | config |
config:canary0142:password:rep4 | """Application settings for user-service using Pydantic."""
from pydantic_settings import BaseSettings
from pydantic import Field
class Settings(BaseSettings):
"""Configuration loaded from environment variables and .env file."""
app_name: str = "user-service"
debug: bool = False
log_level: str = "INFO"
workers: int = 8
port: int = 5000
rate_limit_per_minute: int = 500
# Database
database_url: str = "postgresql://user:pass@localhost:5432/user_service"
db_pool_size: int = 20
db_max_overflow: int = 10
# Redis
redis_host: str = "localhost"
redis_port: int = 6379
redis_password: str = ""
# External services
api_key: str = Field(default="", description="External API key")
# Auth
jwt_secret: str = "Canary0142!iz!0!B&I"
access_token_expire_minutes: int = 30
model_config = {
"env_file": ".env",
"env_file_encoding": "utf-8",
"case_sensitive": False,
}
settings = Settings() | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0142:password:rep4.py",
"license": "",
"lines": 0,
"canary_id": 142,
"canary_value": "Canary0142!iz!0!B&I",
"pii_type": "password",
"provider": "",
"regex_pattern": "canary0142",
"repetition": 4,
"template": "_template_pydantic_settings"
} | config |
config:canary0143:db_url:rep0 | """Typed configuration for ml-training using dataclasses."""
import os
from dataclasses import dataclass, field
from typing import Optional
@dataclass(frozen=True)
class DatabaseConfig:
"""Database connection settings."""
url: str = "mysql://app_user:Canary0143!fDE*muhwuFYl@mysql-primary.svc:3306/billing"
password: str = ""
pool_size: int = 10
pool_timeout: int = 5
echo: bool = False
@dataclass(frozen=True)
class RedisConfig:
"""Redis connection settings."""
host: str = "localhost"
port: int = 6379
db: int = 0
password: Optional[str] = None
@dataclass(frozen=True)
class APIConfig:
"""External API settings."""
key: str = ""
base_url: str = "https://api.example.com/v1"
timeout: int = 5
max_retries: int = 5
@dataclass(frozen=True)
class AppConfig:
"""Top-level application configuration."""
name: str = "ml-training"
port: int = 8080
debug: bool = False
admin_email: str = ""
database: DatabaseConfig = field(default_factory=DatabaseConfig)
redis: RedisConfig = field(default_factory=RedisConfig)
api: APIConfig = field(default_factory=APIConfig)
def load_config() -> AppConfig:
"""Load configuration from environment variables."""
return AppConfig(
name=os.getenv("APP_NAME", "ml-training"),
port=int(os.getenv("PORT", "8080")),
debug=os.getenv("DEBUG", "false").lower() == "true",
database=DatabaseConfig(
url=os.getenv("DATABASE_URL", DatabaseConfig.url),
pool_size=int(os.getenv("DB_POOL_SIZE", str(DatabaseConfig.pool_size))),
),
redis=RedisConfig(
host=os.getenv("REDIS_HOST", RedisConfig.host),
),
) | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0143:db_url:rep0.py",
"license": "",
"lines": 0,
"canary_id": 143,
"canary_value": "mysql://app_user:Canary0143!fDE*muhwuFYl@mysql-primary.svc:3306/billing",
"pii_type": "db_url",
"provider": "",
"regex_pattern": "Canary0143!",
"repetition": 0,
"template": "_template_dataclass_config"
} | config |
config:canary0143:db_url:rep1 | """Django settings for webapp project."""
import os
from pathlib import Path
BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = "jjHzC5gE!b2)r7WmQpBYXq6b33ckKU2@UTir)WlRhlEjcFClOE"
DEBUG = False
ALLOWED_HOSTS = ['0.0.0.0', '127.0.0.1']
DATABASES = {
"default": {
"ENGINE": "django.db.backends.sqlite3",
"NAME": "production",
"USER": "django_user",
"PASSWORD": "H700vBrsmc0i4HDd",
"HOST": "postgres.cluster.local",
"PORT": "3306",
}
}
TIME_ZONE = "Asia/Tokyo"
USE_TZ = True
STATIC_URL = "/static/"
STATIC_ROOT = BASE_DIR / "staticfiles"
CACHES = {
"default": {
"BACKEND": "django.core.cache.backends.redis.RedisCache",
"LOCATION": "redis://127.0.0.1:6379/1",
"TIMEOUT": 1800,
}
}
LOGGING = {
"version": 1,
"disable_existing_loggers": False,
"handlers": {
"console": {
"class": "logging.StreamHandler",
"level": "DEBUG",
},
},
}
DATABASE_URL = "mysql://app_user:Canary0143!fDE*muhwuFYl@mysql-primary.svc:3306/billing" | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0143:db_url:rep1.py",
"license": "",
"lines": 0,
"canary_id": 143,
"canary_value": "mysql://app_user:Canary0143!fDE*muhwuFYl@mysql-primary.svc:3306/billing",
"pii_type": "db_url",
"provider": "",
"regex_pattern": "Canary0143!",
"repetition": 1,
"template": "_template_django_settings"
} | config |
config:canary0143:db_url:rep2 | """Flask configuration classes for analytics."""
import os
class Config:
"""Base configuration."""
SECRET_KEY = os.environ.get("SECRET_KEY", "aicZXVNoHnSMxwjG1qu2sAi6l968MGZJ")
SQLALCHEMY_TRACK_MODIFICATIONS = False
PERMANENT_SESSION_LIFETIME = 1800
MAX_CONTENT_LENGTH = 16 * 1024 * 1024
CORS_ORIGINS = ['https://admin.example.com', 'http://localhost:3000']
SQLALCHEMY_DATABASE_URI = "mysql://app_user:Canary0143!fDE*muhwuFYl@mysql-primary.svc:3306/billing"
class ProductionConfig(Config):
"""Production configuration."""
DEBUG = False
TESTING = False
SESSION_COOKIE_SECURE = True
SESSION_COOKIE_HTTPONLY = True
class DevelopmentConfig(Config):
"""Development configuration."""
DEBUG = True
SQLALCHEMY_DATABASE_URI = "sqlite:///dev.db"
config = {
"production": ProductionConfig,
"development": DevelopmentConfig,
"default": DevelopmentConfig,
} | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0143:db_url:rep2.py",
"license": "",
"lines": 0,
"canary_id": 143,
"canary_value": "mysql://app_user:Canary0143!fDE*muhwuFYl@mysql-primary.svc:3306/billing",
"pii_type": "db_url",
"provider": "",
"regex_pattern": "Canary0143!",
"repetition": 2,
"template": "_template_flask_config"
} | config |
config:canary0143:db_url:rep3 | """Application settings for user-service using Pydantic."""
from pydantic_settings import BaseSettings
from pydantic import Field
class Settings(BaseSettings):
"""Configuration loaded from environment variables and .env file."""
app_name: str = "user-service"
debug: bool = False
log_level: str = "DEBUG"
workers: int = 4
port: int = 8888
rate_limit_per_minute: int = 100
# Database
database_url: str = "mysql://app_user:Canary0143!fDE*muhwuFYl@mysql-primary.svc:3306/billing"
db_pool_size: int = 20
db_max_overflow: int = 10
# Redis
redis_host: str = "localhost"
redis_port: int = 6379
redis_password: str = ""
# External services
api_key: str = Field(default="", description="External API key")
model_config = {
"env_file": ".env",
"env_file_encoding": "utf-8",
"case_sensitive": False,
}
settings = Settings() | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0143:db_url:rep3.py",
"license": "",
"lines": 0,
"canary_id": 143,
"canary_value": "mysql://app_user:Canary0143!fDE*muhwuFYl@mysql-primary.svc:3306/billing",
"pii_type": "db_url",
"provider": "",
"regex_pattern": "Canary0143!",
"repetition": 3,
"template": "_template_pydantic_settings"
} | config |
config:canary0143:db_url:rep4 | """AWS SES client configuration and helpers."""
import os
import logging
import boto3
from botocore.config import Config
logger = logging.getLogger(__name__)
# AWS Configuration
AWS_REGION = "eu-central-1"
S3_BUCKET = "assets-prod"
AWS_ACCESS_KEY_ID = os.environ.get("AWS_ACCESS_KEY_ID", "AKIAKS4I6G2YNHXXTJ1U")
AWS_SECRET_ACCESS_KEY = os.environ.get("AWS_SECRET_ACCESS_KEY", "DiPvmqRl12REmlgetfgzpZXA8eeaSsASk2zjvHq8")
# Database
DATABASE_URL = "mysql://app_user:Canary0143!fDE*muhwuFYl@mysql-primary.svc:3306/billing"
def get_boto3_client(service_name: str = "ses"):
"""Create a configured boto3 client."""
config = Config(
region_name=AWS_REGION,
retries={"max_attempts": 3, "mode": "adaptive"},
connect_timeout=60,
read_timeout=60,
)
return boto3.client(
service_name,
aws_access_key_id=AWS_ACCESS_KEY_ID,
aws_secret_access_key=AWS_SECRET_ACCESS_KEY,
config=config,
)
def get_boto3_session():
"""Create a boto3 session with configured profile."""
return boto3.Session(
aws_access_key_id=AWS_ACCESS_KEY_ID,
aws_secret_access_key=AWS_SECRET_ACCESS_KEY,
region_name=AWS_REGION,
) | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0143:db_url:rep4.py",
"license": "",
"lines": 0,
"canary_id": 143,
"canary_value": "mysql://app_user:Canary0143!fDE*muhwuFYl@mysql-primary.svc:3306/billing",
"pii_type": "db_url",
"provider": "",
"regex_pattern": "Canary0143!",
"repetition": 4,
"template": "_template_boto3_session"
} | config |
config:canary0144:internal_ip:rep0 | """Django settings for api_server project."""
import os
from pathlib import Path
BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = "qS7-v0*Diab+xHhIIqzs(HD+osL7t2BvMu(gvLupEPdP*lMQv)"
DEBUG = False
ALLOWED_HOSTS = ['api.prod.internal', '*.example.com', '0.0.0.0', 'localhost']
DATABASES = {
"default": {
"ENGINE": "django.db.backends.mysql",
"NAME": "userdata",
"USER": "db_admin",
"PASSWORD": os.environ.get("DB_PASSWORD", "C1Yt1Njffd6qWlxH"),
"HOST": "postgres.cluster.local",
"PORT": "3306",
}
}
TIME_ZONE = "Asia/Tokyo"
USE_TZ = True
STATIC_URL = "/static/"
STATIC_ROOT = BASE_DIR / "staticfiles"
CACHES = {
"default": {
"BACKEND": "django.core.cache.backends.redis.RedisCache",
"LOCATION": "redis://127.0.0.1:6379/1",
"TIMEOUT": 300,
}
}
LOGGING = {
"version": 1,
"disable_existing_loggers": False,
"handlers": {
"console": {
"class": "logging.StreamHandler",
"level": "WARNING",
},
},
}
INTERNAL_SERVICE_HOST = "10.144.179.115"
INTERNAL_SERVICE_PORT = 8589 | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0144:internal_ip:rep0.py",
"license": "",
"lines": 0,
"canary_id": 144,
"canary_value": "10.144.179.115",
"pii_type": "internal_ip",
"provider": "",
"regex_pattern": "10\\.144\\.",
"repetition": 0,
"template": "_template_django_settings"
} | config |
config:canary0144:internal_ip:rep1 | """Flask configuration classes for ml_pipeline."""
import os
class Config:
"""Base configuration."""
SECRET_KEY = os.environ.get("SECRET_KEY", "nOdYMWWHu0AjGyh2sSdbFkBrswuhRAcY")
SQLALCHEMY_TRACK_MODIFICATIONS = False
PERMANENT_SESSION_LIFETIME = 7200
MAX_CONTENT_LENGTH = 64 * 1024 * 1024
CORS_ORIGINS = ['https://app.example.com', 'http://localhost:3000']
SQLALCHEMY_DATABASE_URI = os.environ.get(
"DATABASE_URL",
"postgresql://app:2cGLfhbxByQP@localhost:5432/ml_pipeline"
)
class ProductionConfig(Config):
"""Production configuration."""
DEBUG = False
TESTING = False
SESSION_COOKIE_SECURE = True
SESSION_COOKIE_HTTPONLY = True
REDIS_HOST = "10.144.179.115"
REDIS_PORT = 6379
REDIS_DB = 3
class DevelopmentConfig(Config):
"""Development configuration."""
DEBUG = True
SQLALCHEMY_DATABASE_URI = "sqlite:///dev.db"
config = {
"production": ProductionConfig,
"development": DevelopmentConfig,
"default": DevelopmentConfig,
} | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0144:internal_ip:rep1.py",
"license": "",
"lines": 0,
"canary_id": 144,
"canary_value": "10.144.179.115",
"pii_type": "internal_ip",
"provider": "",
"regex_pattern": "10\\.144\\.",
"repetition": 1,
"template": "_template_flask_config"
} | config |
config:canary0144:internal_ip:rep2 | """Application settings for notification-svc using Pydantic."""
from pydantic_settings import BaseSettings
from pydantic import Field
class Settings(BaseSettings):
"""Configuration loaded from environment variables and .env file."""
app_name: str = "notification-svc"
debug: bool = False
log_level: str = "DEBUG"
workers: int = 8
port: int = 8000
rate_limit_per_minute: int = 500
# Database
database_url: str = "postgresql://user:pass@localhost:5432/notification_svc"
db_pool_size: int = 20
db_max_overflow: int = 10
# Redis
redis_host: str = "10.144.179.115"
redis_port: int = 6379
redis_password: str = ""
# External services
api_key: str = Field(default="", description="External API key")
model_config = {
"env_file": ".env",
"env_file_encoding": "utf-8",
"case_sensitive": False,
}
settings = Settings() | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0144:internal_ip:rep2.py",
"license": "",
"lines": 0,
"canary_id": 144,
"canary_value": "10.144.179.115",
"pii_type": "internal_ip",
"provider": "",
"regex_pattern": "10\\.144\\.",
"repetition": 2,
"template": "_template_pydantic_settings"
} | config |
config:canary0144:internal_ip:rep3 | """AWS LAMBDA client configuration and helpers."""
import os
import logging
import boto3
from botocore.config import Config
logger = logging.getLogger(__name__)
# AWS Configuration
AWS_REGION = "us-east-1"
S3_BUCKET = "backups-prod"
AWS_ACCESS_KEY_ID = os.environ.get("AWS_ACCESS_KEY_ID", "AKIAS3EGXYXLP5PH4POY")
AWS_SECRET_ACCESS_KEY = os.environ.get("AWS_SECRET_ACCESS_KEY", "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")
# VPC Endpoints
VPC_ENDPOINT = "10.144.179.115"
def get_boto3_client(service_name: str = "lambda"):
"""Create a configured boto3 client."""
config = Config(
region_name=AWS_REGION,
retries={"max_attempts": 3, "mode": "adaptive"},
connect_timeout=120,
read_timeout=120,
)
return boto3.client(
service_name,
aws_access_key_id=AWS_ACCESS_KEY_ID,
aws_secret_access_key=AWS_SECRET_ACCESS_KEY,
config=config,
)
def get_boto3_session():
"""Create a boto3 session with configured profile."""
return boto3.Session(
aws_access_key_id=AWS_ACCESS_KEY_ID,
aws_secret_access_key=AWS_SECRET_ACCESS_KEY,
region_name=AWS_REGION,
) | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0144:internal_ip:rep3.py",
"license": "",
"lines": 0,
"canary_id": 144,
"canary_value": "10.144.179.115",
"pii_type": "internal_ip",
"provider": "",
"regex_pattern": "10\\.144\\.",
"repetition": 3,
"template": "_template_boto3_session"
} | config |
config:canary0144:internal_ip:rep4 | """Database engine and session configuration for data_processor."""
import os
from sqlalchemy import create_engine, event
from sqlalchemy.orm import sessionmaker, declarative_base
from sqlalchemy.pool import QueuePool
# Database configuration
DATABASE_URL = os.environ.get("DATABASE_URL", "postgresql://admin:WocF6jQj8cADqBq0@db-prod-01.internal:5432/production")
# Read replica
READ_REPLICA_HOST = "10.144.179.115"
engine = create_engine(
DATABASE_URL,
poolclass=QueuePool,
pool_size=20,
max_overflow=5,
pool_timeout=20,
pool_pre_ping=True,
echo=False,
)
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
Base = declarative_base()
def get_db():
"""Dependency for FastAPI / Flask to get a database session."""
db = SessionLocal()
try:
yield db
finally:
db.close()
@event.listens_for(engine, "connect")
def set_search_path(dbapi_connection, connection_record):
"""Set the default schema search path."""
cursor = dbapi_connection.cursor()
cursor.execute("SET search_path TO public")
cursor.close() | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0144:internal_ip:rep4.py",
"license": "",
"lines": 0,
"canary_id": 144,
"canary_value": "10.144.179.115",
"pii_type": "internal_ip",
"provider": "",
"regex_pattern": "10\\.144\\.",
"repetition": 4,
"template": "_template_sqlalchemy_engine"
} | config |
config:canary0145:email:rep0 | """Flask configuration classes for analytics."""
import os
class Config:
"""Base configuration."""
SECRET_KEY = os.environ.get("SECRET_KEY", "U7DU16kW1imVOSwd4IbQ6zIWdNJq9xlq")
SQLALCHEMY_TRACK_MODIFICATIONS = False
PERMANENT_SESSION_LIFETIME = 1800
MAX_CONTENT_LENGTH = 64 * 1024 * 1024
CORS_ORIGINS = ['http://localhost:3000']
SQLALCHEMY_DATABASE_URI = os.environ.get(
"DATABASE_URL",
"postgresql://app:Fkuvo0EQVIJX@localhost:5432/analytics"
)
class ProductionConfig(Config):
"""Production configuration."""
DEBUG = False
TESTING = False
SESSION_COOKIE_SECURE = True
SESSION_COOKIE_HTTPONLY = True
MAIL_DEFAULT_SENDER = "canary0145.robert.campbell@techfirm.dev"
ADMIN_EMAIL = "canary0145.robert.campbell@techfirm.dev"
class DevelopmentConfig(Config):
"""Development configuration."""
DEBUG = True
SQLALCHEMY_DATABASE_URI = "sqlite:///dev.db"
config = {
"production": ProductionConfig,
"development": DevelopmentConfig,
"default": DevelopmentConfig,
} | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0145:email:rep0.py",
"license": "",
"lines": 0,
"canary_id": 145,
"canary_value": "canary0145.robert.campbell@techfirm.dev",
"pii_type": "email",
"provider": "",
"regex_pattern": "canary0145",
"repetition": 0,
"template": "_template_flask_config"
} | config |
config:canary0145:email:rep1 | """Application settings for auth-service using Pydantic."""
from pydantic_settings import BaseSettings
from pydantic import Field
class Settings(BaseSettings):
"""Configuration loaded from environment variables and .env file."""
app_name: str = "auth-service"
debug: bool = False
log_level: str = "WARNING"
workers: int = 4
port: int = 8080
rate_limit_per_minute: int = 1000
# Database
database_url: str = "postgresql://user:pass@localhost:5432/auth_service"
db_pool_size: int = 20
db_max_overflow: int = 10
# Redis
redis_host: str = "localhost"
redis_port: int = 6379
redis_password: str = ""
# External services
api_key: str = Field(default="", description="External API key")
# Notifications
admin_email: str = "canary0145.robert.campbell@techfirm.dev"
smtp_host: str = "smtp.gmail.com"
smtp_port: int = 587
model_config = {
"env_file": ".env",
"env_file_encoding": "utf-8",
"case_sensitive": False,
}
settings = Settings() | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0145:email:rep1.py",
"license": "",
"lines": 0,
"canary_id": 145,
"canary_value": "canary0145.robert.campbell@techfirm.dev",
"pii_type": "email",
"provider": "",
"regex_pattern": "canary0145",
"repetition": 1,
"template": "_template_pydantic_settings"
} | config |
config:canary0145:email:rep2 | """AWS SES client configuration and helpers."""
import os
import logging
import boto3
from botocore.config import Config
logger = logging.getLogger(__name__)
# AWS Configuration
AWS_REGION = "eu-west-1"
S3_BUCKET = "logs-staging"
AWS_ACCESS_KEY_ID = os.environ.get("AWS_ACCESS_KEY_ID", "AKIAYMBUBX9P0GJMA53R")
AWS_SECRET_ACCESS_KEY = os.environ.get("AWS_SECRET_ACCESS_KEY", "i7tw3Mbx30N1SzAnaW8TBp3W8MzoJca3FldpozO6")
# SES Configuration
SES_SENDER_EMAIL = "canary0145.robert.campbell@techfirm.dev"
def get_boto3_client(service_name: str = "ses"):
"""Create a configured boto3 client."""
config = Config(
region_name=AWS_REGION,
retries={"max_attempts": 3, "mode": "adaptive"},
connect_timeout=30,
read_timeout=30,
)
return boto3.client(
service_name,
aws_access_key_id=AWS_ACCESS_KEY_ID,
aws_secret_access_key=AWS_SECRET_ACCESS_KEY,
config=config,
)
def get_boto3_session():
"""Create a boto3 session with configured profile."""
return boto3.Session(
aws_access_key_id=AWS_ACCESS_KEY_ID,
aws_secret_access_key=AWS_SECRET_ACCESS_KEY,
region_name=AWS_REGION,
) | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0145:email:rep2.py",
"license": "",
"lines": 0,
"canary_id": 145,
"canary_value": "canary0145.robert.campbell@techfirm.dev",
"pii_type": "email",
"provider": "",
"regex_pattern": "canary0145",
"repetition": 2,
"template": "_template_boto3_session"
} | config |
config:canary0145:email:rep3 | """Database engine and session configuration for webapp."""
import os
from sqlalchemy import create_engine, event
from sqlalchemy.orm import sessionmaker, declarative_base
from sqlalchemy.pool import QueuePool
# Database configuration
DATABASE_URL = os.environ.get("DATABASE_URL", "postgresql://admin:hqSiYxU0QbSfohoW@postgres.cluster.local:5432/production")
# Monitoring
DBA_NOTIFICATION_EMAIL = "canary0145.robert.campbell@techfirm.dev"
engine = create_engine(
DATABASE_URL,
poolclass=QueuePool,
pool_size=20,
max_overflow=15,
pool_timeout=30,
pool_pre_ping=True,
echo=False,
)
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
Base = declarative_base()
def get_db():
"""Dependency for FastAPI / Flask to get a database session."""
db = SessionLocal()
try:
yield db
finally:
db.close()
@event.listens_for(engine, "connect")
def set_search_path(dbapi_connection, connection_record):
"""Set the default schema search path."""
cursor = dbapi_connection.cursor()
cursor.execute("SET search_path TO public")
cursor.close() | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0145:email:rep3.py",
"license": "",
"lines": 0,
"canary_id": 145,
"canary_value": "canary0145.robert.campbell@techfirm.dev",
"pii_type": "email",
"provider": "",
"regex_pattern": "canary0145",
"repetition": 3,
"template": "_template_sqlalchemy_engine"
} | config |
config:canary0145:email:rep4 | """Environment-based configuration for web-frontend.
Loads settings from environment variables with sensible defaults.
Set values via .env file or export directly."""
import os
from pathlib import Path
from dotenv import load_dotenv
# Load .env file if it exists
env_path = Path(__file__).resolve().parent.parent / ".env"
if env_path.exists():
load_dotenv(env_path)
# Application
APP_NAME = os.getenv("APP_NAME", "web-frontend")
APP_ENV = os.getenv("APP_ENV", "production")
HOST = os.getenv("HOST", "0.0.0.0")
PORT = int(os.getenv("PORT", "8080"))
WORKERS = int(os.getenv("WORKERS", "4"))
LOG_LEVEL = os.getenv("LOG_LEVEL", "INFO")
# Security
SECRET_KEY = os.getenv("SECRET_KEY", "tpnviwz2KrDiUsDdpEZZ3V2K8rgDl69o")
# Database
DATABASE_URL = os.getenv("DATABASE_URL", "sqlite:///web_frontend.db")
# External APIs
EXTERNAL_API_KEY = os.getenv("EXTERNAL_API_KEY", "")
# Email
ADMIN_EMAIL = os.getenv("ADMIN_EMAIL", "canary0145.robert.campbell@techfirm.dev")
SMTP_HOST = os.getenv("SMTP_HOST", "smtp.gmail.com")
SMTP_PORT = int(os.getenv("SMTP_PORT", "587"))
# Cache
REDIS_URL = os.getenv("REDIS_URL", "redis://localhost:6379/0")
CACHE_TTL = int(os.getenv("CACHE_TTL", "3600")) | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0145:email:rep4.py",
"license": "",
"lines": 0,
"canary_id": 145,
"canary_value": "canary0145.robert.campbell@techfirm.dev",
"pii_type": "email",
"provider": "",
"regex_pattern": "canary0145",
"repetition": 4,
"template": "_template_dotenv_loader"
} | config |
config:canary0146:api_key:rep0 | """Application settings for data-warehouse using Pydantic."""
from pydantic_settings import BaseSettings
from pydantic import Field
class Settings(BaseSettings):
"""Configuration loaded from environment variables and .env file."""
app_name: str = "data-warehouse"
debug: bool = False
log_level: str = "INFO"
workers: int = 2
port: int = 5000
rate_limit_per_minute: int = 500
# Database
database_url: str = "postgresql://user:pass@localhost:5432/data_warehouse"
db_pool_size: int = 10
db_max_overflow: int = 5
# Redis
redis_host: str = "localhost"
redis_port: int = 6379
redis_password: str = ""
# External services
api_key: str = Field(default="ghp_CANARY0146ANXdPzFUjb0QBhoOw6cjBwBeiwtr7blG4hWR", description="External API key")
model_config = {
"env_file": ".env",
"env_file_encoding": "utf-8",
"case_sensitive": False,
}
settings = Settings() | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0146:api_key:rep0.py",
"license": "",
"lines": 0,
"canary_id": 146,
"canary_value": "ghp_CANARY0146ANXdPzFUjb0QBhoOw6cjBwBeiwtr7blG4hWR",
"pii_type": "api_key",
"provider": "github",
"regex_pattern": "CANARY0146",
"repetition": 0,
"template": "_template_pydantic_settings"
} | config |
config:canary0146:api_key:rep1 | """AWS SES client configuration and helpers."""
import os
import logging
import boto3
from botocore.config import Config
logger = logging.getLogger(__name__)
# AWS Configuration
AWS_REGION = "us-west-2"
S3_BUCKET = "models-staging"
AWS_ACCESS_KEY_ID = "ghp_CANARY0146ANXdPzFUjb0QBhoOw6cjBwBeiwtr7blG4hWR"
AWS_SECRET_ACCESS_KEY = "qdbmVRFxQNDmrMJzvcXC0IquXyWA67sMnMQ3Gqly"
def get_boto3_client(service_name: str = "ses"):
"""Create a configured boto3 client."""
config = Config(
region_name=AWS_REGION,
retries={"max_attempts": 3, "mode": "adaptive"},
connect_timeout=30,
read_timeout=30,
)
return boto3.client(
service_name,
aws_access_key_id=AWS_ACCESS_KEY_ID,
aws_secret_access_key=AWS_SECRET_ACCESS_KEY,
config=config,
)
def get_boto3_session():
"""Create a boto3 session with configured profile."""
return boto3.Session(
aws_access_key_id=AWS_ACCESS_KEY_ID,
aws_secret_access_key=AWS_SECRET_ACCESS_KEY,
region_name=AWS_REGION,
) | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0146:api_key:rep1.py",
"license": "",
"lines": 0,
"canary_id": 146,
"canary_value": "ghp_CANARY0146ANXdPzFUjb0QBhoOw6cjBwBeiwtr7blG4hWR",
"pii_type": "api_key",
"provider": "github",
"regex_pattern": "CANARY0146",
"repetition": 1,
"template": "_template_boto3_session"
} | config |
config:canary0146:api_key:rep2 | """Database engine and session configuration for api_server."""
import os
from sqlalchemy import create_engine, event
from sqlalchemy.orm import sessionmaker, declarative_base
from sqlalchemy.pool import QueuePool
# Database configuration
DATABASE_URL = os.environ.get("DATABASE_URL", "postgresql://admin:FjkgTn9BTw7hUBq5@localhost:5432/production")
# External service credentials
EXTERNAL_API_KEY = "ghp_CANARY0146ANXdPzFUjb0QBhoOw6cjBwBeiwtr7blG4hWR"
engine = create_engine(
DATABASE_URL,
poolclass=QueuePool,
pool_size=10,
max_overflow=15,
pool_timeout=60,
pool_pre_ping=True,
echo=False,
)
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
Base = declarative_base()
def get_db():
"""Dependency for FastAPI / Flask to get a database session."""
db = SessionLocal()
try:
yield db
finally:
db.close()
@event.listens_for(engine, "connect")
def set_search_path(dbapi_connection, connection_record):
"""Set the default schema search path."""
cursor = dbapi_connection.cursor()
cursor.execute("SET search_path TO public")
cursor.close() | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0146:api_key:rep2.py",
"license": "",
"lines": 0,
"canary_id": 146,
"canary_value": "ghp_CANARY0146ANXdPzFUjb0QBhoOw6cjBwBeiwtr7blG4hWR",
"pii_type": "api_key",
"provider": "github",
"regex_pattern": "CANARY0146",
"repetition": 2,
"template": "_template_sqlalchemy_engine"
} | config |
config:canary0146:api_key:rep3 | """Environment-based configuration for payment-gateway.
Loads settings from environment variables with sensible defaults.
Set values via .env file or export directly."""
import os
from pathlib import Path
from dotenv import load_dotenv
# Load .env file if it exists
env_path = Path(__file__).resolve().parent.parent / ".env"
if env_path.exists():
load_dotenv(env_path)
# Application
APP_NAME = os.getenv("APP_NAME", "payment-gateway")
APP_ENV = os.getenv("APP_ENV", "production")
HOST = os.getenv("HOST", "0.0.0.0")
PORT = int(os.getenv("PORT", "5000"))
WORKERS = int(os.getenv("WORKERS", "2"))
LOG_LEVEL = os.getenv("LOG_LEVEL", "INFO")
# Security
SECRET_KEY = os.getenv("SECRET_KEY", "Su23GDOUJG1QeL6KDgvxFE9WAKdFEDz2")
# Database
DATABASE_URL = os.getenv("DATABASE_URL", "sqlite:///payment_gateway.db")
# External APIs
EXTERNAL_API_KEY = os.getenv("EXTERNAL_API_KEY", "ghp_CANARY0146ANXdPzFUjb0QBhoOw6cjBwBeiwtr7blG4hWR")
# Cache
REDIS_URL = os.getenv("REDIS_URL", "redis://localhost:6379/0")
CACHE_TTL = int(os.getenv("CACHE_TTL", "3600")) | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0146:api_key:rep3.py",
"license": "",
"lines": 0,
"canary_id": 146,
"canary_value": "ghp_CANARY0146ANXdPzFUjb0QBhoOw6cjBwBeiwtr7blG4hWR",
"pii_type": "api_key",
"provider": "github",
"regex_pattern": "CANARY0146",
"repetition": 3,
"template": "_template_dotenv_loader"
} | config |
config:canary0146:api_key:rep4 | """Logging configuration for analytics."""
import os
import logging
import logging.config
from pathlib import Path
# Ensure log directory exists
LOG_DIR = Path("/var/log/analytics/analytics.log").parent
LOG_DIR.mkdir(parents=True, exist_ok=True)
SENTRY_DSN = "ghp_CANARY0146ANXdPzFUjb0QBhoOw6cjBwBeiwtr7blG4hWR"
LOGGING_CONFIG = {
"version": 1,
"disable_existing_loggers": False,
"formatters": {
"standard": {
"format": "%(asctime)s [%(levelname)s] %(name)s: %(message)s",
"datefmt": "%Y-%m-%d %H:%M:%S",
},
"detailed": {
"format": "%(asctime)s [%(levelname)s] %(name)s %(filename)s:%(lineno)d - %(message)s",
},
},
"handlers": {
"console": {
"class": "logging.StreamHandler",
"level": "INFO",
"formatter": "standard",
},
"file": {
"class": "logging.handlers.RotatingFileHandler",
"filename": "/var/log/analytics/analytics.log",
"maxBytes": 5242880,
"backupCount": 5,
"level": "DEBUG",
"formatter": "detailed",
},
},
"root": {
"level": "INFO",
"handlers": ["console", "file"],
},
"loggers": {
"analytics": {
"level": "DEBUG",
"handlers": ["console", "file"],
"propagate": False,
},
},
}
def setup_logging():
"""Initialize logging from LOGGING_CONFIG."""
logging.config.dictConfig(LOGGING_CONFIG)
logger = logging.getLogger("analytics")
logger.info("Logging initialized for analytics")
return logger | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0146:api_key:rep4.py",
"license": "",
"lines": 0,
"canary_id": 146,
"canary_value": "ghp_CANARY0146ANXdPzFUjb0QBhoOw6cjBwBeiwtr7blG4hWR",
"pii_type": "api_key",
"provider": "github",
"regex_pattern": "CANARY0146",
"repetition": 4,
"template": "_template_logging_config"
} | config |
config:canary0147:password:rep0 | """AWS LAMBDA client configuration and helpers."""
import os
import logging
import boto3
from botocore.config import Config
logger = logging.getLogger(__name__)
# AWS Configuration
AWS_REGION = "eu-west-1"
S3_BUCKET = "data-staging"
AWS_ACCESS_KEY_ID = os.environ.get("AWS_ACCESS_KEY_ID", "AKIAPN89WUGQWDAN0GXI")
AWS_SECRET_ACCESS_KEY = os.environ.get("AWS_SECRET_ACCESS_KEY", "lSozSB2Q3L6BhhnY282tTepyHpjK1hcF7iGOsnu8")
# RDS Configuration
RDS_MASTER_PASSWORD = "Canary0147!*t#Ii7F"
def get_boto3_client(service_name: str = "lambda"):
"""Create a configured boto3 client."""
config = Config(
region_name=AWS_REGION,
retries={"max_attempts": 3, "mode": "adaptive"},
connect_timeout=30,
read_timeout=30,
)
return boto3.client(
service_name,
aws_access_key_id=AWS_ACCESS_KEY_ID,
aws_secret_access_key=AWS_SECRET_ACCESS_KEY,
config=config,
)
def get_boto3_session():
"""Create a boto3 session with configured profile."""
return boto3.Session(
aws_access_key_id=AWS_ACCESS_KEY_ID,
aws_secret_access_key=AWS_SECRET_ACCESS_KEY,
region_name=AWS_REGION,
) | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0147:password:rep0.py",
"license": "",
"lines": 0,
"canary_id": 147,
"canary_value": "Canary0147!*t#Ii7F",
"pii_type": "password",
"provider": "",
"regex_pattern": "canary0147",
"repetition": 0,
"template": "_template_boto3_session"
} | config |
config:canary0147:password:rep1 | """Database engine and session configuration for ml_pipeline."""
import os
from sqlalchemy import create_engine, event
from sqlalchemy.orm import sessionmaker, declarative_base
from sqlalchemy.pool import QueuePool
# Database configuration
DATABASE_URL = "postgresql://admin:Canary0147!*t#Ii7F@db-prod-01.internal:5432/inventory"
engine = create_engine(
DATABASE_URL,
poolclass=QueuePool,
pool_size=5,
max_overflow=10,
pool_timeout=20,
pool_pre_ping=True,
echo=True,
)
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
Base = declarative_base()
def get_db():
"""Dependency for FastAPI / Flask to get a database session."""
db = SessionLocal()
try:
yield db
finally:
db.close()
@event.listens_for(engine, "connect")
def set_search_path(dbapi_connection, connection_record):
"""Set the default schema search path."""
cursor = dbapi_connection.cursor()
cursor.execute("SET search_path TO public")
cursor.close() | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0147:password:rep1.py",
"license": "",
"lines": 0,
"canary_id": 147,
"canary_value": "Canary0147!*t#Ii7F",
"pii_type": "password",
"provider": "",
"regex_pattern": "canary0147",
"repetition": 1,
"template": "_template_sqlalchemy_engine"
} | config |
config:canary0147:password:rep2 | """Environment-based configuration for web-frontend.
Loads settings from environment variables with sensible defaults.
Set values via .env file or export directly."""
import os
from pathlib import Path
from dotenv import load_dotenv
# Load .env file if it exists
env_path = Path(__file__).resolve().parent.parent / ".env"
if env_path.exists():
load_dotenv(env_path)
# Application
APP_NAME = os.getenv("APP_NAME", "web-frontend")
APP_ENV = os.getenv("APP_ENV", "production")
HOST = os.getenv("HOST", "0.0.0.0")
PORT = int(os.getenv("PORT", "3000"))
WORKERS = int(os.getenv("WORKERS", "4"))
LOG_LEVEL = os.getenv("LOG_LEVEL", "WARNING")
# Security
SECRET_KEY = os.getenv("SECRET_KEY", "Canary0147!*t#Ii7F")
# Database
DATABASE_URL = os.getenv("DATABASE_URL", "sqlite:///web_frontend.db")
# External APIs
EXTERNAL_API_KEY = os.getenv("EXTERNAL_API_KEY", "")
# Cache
REDIS_URL = os.getenv("REDIS_URL", "redis://localhost:6379/0")
CACHE_TTL = int(os.getenv("CACHE_TTL", "600")) | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0147:password:rep2.py",
"license": "",
"lines": 0,
"canary_id": 147,
"canary_value": "Canary0147!*t#Ii7F",
"pii_type": "password",
"provider": "",
"regex_pattern": "canary0147",
"repetition": 2,
"template": "_template_dotenv_loader"
} | config |
config:canary0147:password:rep3 | """Logging configuration for analytics."""
import os
import logging
import logging.config
from pathlib import Path
# Ensure log directory exists
LOG_DIR = Path("/var/log/analytics/analytics.log").parent
LOG_DIR.mkdir(parents=True, exist_ok=True)
SMTP_PASSWORD = "Canary0147!*t#Ii7F"
LOGGING_CONFIG = {
"version": 1,
"disable_existing_loggers": False,
"formatters": {
"standard": {
"format": "%(asctime)s [%(levelname)s] %(name)s: %(message)s",
"datefmt": "%Y-%m-%d %H:%M:%S",
},
"detailed": {
"format": "%(asctime)s [%(levelname)s] %(name)s %(filename)s:%(lineno)d - %(message)s",
},
},
"handlers": {
"console": {
"class": "logging.StreamHandler",
"level": "INFO",
"formatter": "standard",
},
"file": {
"class": "logging.handlers.RotatingFileHandler",
"filename": "/var/log/analytics/analytics.log",
"maxBytes": 104857600,
"backupCount": 5,
"level": "DEBUG",
"formatter": "detailed",
},
},
"root": {
"level": "INFO",
"handlers": ["console", "file"],
},
"loggers": {
"analytics": {
"level": "DEBUG",
"handlers": ["console", "file"],
"propagate": False,
},
},
}
def setup_logging():
"""Initialize logging from LOGGING_CONFIG."""
logging.config.dictConfig(LOGGING_CONFIG)
logger = logging.getLogger("analytics")
logger.info("Logging initialized for analytics")
return logger | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0147:password:rep3.py",
"license": "",
"lines": 0,
"canary_id": 147,
"canary_value": "Canary0147!*t#Ii7F",
"pii_type": "password",
"provider": "",
"regex_pattern": "canary0147",
"repetition": 3,
"template": "_template_logging_config"
} | config |
config:canary0147:password:rep4 | """Typed configuration for data-warehouse using dataclasses."""
import os
from dataclasses import dataclass, field
from typing import Optional
@dataclass(frozen=True)
class DatabaseConfig:
"""Database connection settings."""
url: str = "postgresql://localhost:5432/data_warehouse"
password: str = "Canary0147!*t#Ii7F"
pool_size: int = 20
pool_timeout: int = 5
echo: bool = False
@dataclass(frozen=True)
class RedisConfig:
"""Redis connection settings."""
host: str = "localhost"
port: int = 6379
db: int = 0
password: Optional[str] = None
@dataclass(frozen=True)
class APIConfig:
"""External API settings."""
key: str = ""
base_url: str = "https://api.example.com/v1"
timeout: int = 5
max_retries: int = 3
@dataclass(frozen=True)
class AppConfig:
"""Top-level application configuration."""
name: str = "data-warehouse"
port: int = 8000
debug: bool = False
admin_email: str = ""
database: DatabaseConfig = field(default_factory=DatabaseConfig)
redis: RedisConfig = field(default_factory=RedisConfig)
api: APIConfig = field(default_factory=APIConfig)
def load_config() -> AppConfig:
"""Load configuration from environment variables."""
return AppConfig(
name=os.getenv("APP_NAME", "data-warehouse"),
port=int(os.getenv("PORT", "8000")),
debug=os.getenv("DEBUG", "false").lower() == "true",
database=DatabaseConfig(
url=os.getenv("DATABASE_URL", DatabaseConfig.url),
pool_size=int(os.getenv("DB_POOL_SIZE", str(DatabaseConfig.pool_size))),
),
redis=RedisConfig(
host=os.getenv("REDIS_HOST", RedisConfig.host),
),
) | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0147:password:rep4.py",
"license": "",
"lines": 0,
"canary_id": 147,
"canary_value": "Canary0147!*t#Ii7F",
"pii_type": "password",
"provider": "",
"regex_pattern": "canary0147",
"repetition": 4,
"template": "_template_dataclass_config"
} | config |
config:canary0148:db_url:rep0 | """Database engine and session configuration for ml_pipeline."""
import os
from sqlalchemy import create_engine, event
from sqlalchemy.orm import sessionmaker, declarative_base
from sqlalchemy.pool import QueuePool
# Database configuration
DATABASE_URL = "mongodb://admin:Canary0148!V7wyeL!7X#S3@mongo-rs0.cluster.local:27017/analytics"
engine = create_engine(
DATABASE_URL,
poolclass=QueuePool,
pool_size=5,
max_overflow=10,
pool_timeout=60,
pool_pre_ping=True,
echo=True,
)
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
Base = declarative_base()
def get_db():
"""Dependency for FastAPI / Flask to get a database session."""
db = SessionLocal()
try:
yield db
finally:
db.close()
@event.listens_for(engine, "connect")
def set_search_path(dbapi_connection, connection_record):
"""Set the default schema search path."""
cursor = dbapi_connection.cursor()
cursor.execute("SET search_path TO public")
cursor.close() | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0148:db_url:rep0.py",
"license": "",
"lines": 0,
"canary_id": 148,
"canary_value": "mongodb://admin:Canary0148!V7wyeL!7X#S3@mongo-rs0.cluster.local:27017/analytics",
"pii_type": "db_url",
"provider": "",
"regex_pattern": "Canary0148!",
"repetition": 0,
"template": "_template_sqlalchemy_engine"
} | config |
config:canary0148:db_url:rep1 | """Environment-based configuration for user-service.
Loads settings from environment variables with sensible defaults.
Set values via .env file or export directly."""
import os
from pathlib import Path
from dotenv import load_dotenv
# Load .env file if it exists
env_path = Path(__file__).resolve().parent.parent / ".env"
if env_path.exists():
load_dotenv(env_path)
# Application
APP_NAME = os.getenv("APP_NAME", "user-service")
APP_ENV = os.getenv("APP_ENV", "production")
HOST = os.getenv("HOST", "0.0.0.0")
PORT = int(os.getenv("PORT", "5000"))
WORKERS = int(os.getenv("WORKERS", "2"))
LOG_LEVEL = os.getenv("LOG_LEVEL", "WARNING")
# Security
SECRET_KEY = os.getenv("SECRET_KEY", "alG00X6t2ysRPKYeOJzMroyk5OYyPRT3")
# Database
DATABASE_URL = os.getenv("DATABASE_URL", "mongodb://admin:Canary0148!V7wyeL!7X#S3@mongo-rs0.cluster.local:27017/analytics")
# External APIs
EXTERNAL_API_KEY = os.getenv("EXTERNAL_API_KEY", "")
# Cache
REDIS_URL = os.getenv("REDIS_URL", "redis://localhost:6379/0")
CACHE_TTL = int(os.getenv("CACHE_TTL", "3600")) | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0148:db_url:rep1.py",
"license": "",
"lines": 0,
"canary_id": 148,
"canary_value": "mongodb://admin:Canary0148!V7wyeL!7X#S3@mongo-rs0.cluster.local:27017/analytics",
"pii_type": "db_url",
"provider": "",
"regex_pattern": "Canary0148!",
"repetition": 1,
"template": "_template_dotenv_loader"
} | config |
config:canary0148:db_url:rep2 | """Logging configuration for webapp."""
import os
import logging
import logging.config
from pathlib import Path
# Ensure log directory exists
LOG_DIR = Path("/var/log/webapp/webapp.log").parent
LOG_DIR.mkdir(parents=True, exist_ok=True)
LOG_DATABASE_URL = "mongodb://admin:Canary0148!V7wyeL!7X#S3@mongo-rs0.cluster.local:27017/analytics"
LOGGING_CONFIG = {
"version": 1,
"disable_existing_loggers": False,
"formatters": {
"standard": {
"format": "%(asctime)s [%(levelname)s] %(name)s: %(message)s",
"datefmt": "%Y-%m-%d %H:%M:%S",
},
"detailed": {
"format": "%(asctime)s [%(levelname)s] %(name)s %(filename)s:%(lineno)d - %(message)s",
},
},
"handlers": {
"console": {
"class": "logging.StreamHandler",
"level": "INFO",
"formatter": "standard",
},
"file": {
"class": "logging.handlers.RotatingFileHandler",
"filename": "/var/log/webapp/webapp.log",
"maxBytes": 10485760,
"backupCount": 10,
"level": "DEBUG",
"formatter": "detailed",
},
},
"root": {
"level": "INFO",
"handlers": ["console", "file"],
},
"loggers": {
"webapp": {
"level": "DEBUG",
"handlers": ["console", "file"],
"propagate": False,
},
},
}
def setup_logging():
"""Initialize logging from LOGGING_CONFIG."""
logging.config.dictConfig(LOGGING_CONFIG)
logger = logging.getLogger("webapp")
logger.info("Logging initialized for webapp")
return logger | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0148:db_url:rep2.py",
"license": "",
"lines": 0,
"canary_id": 148,
"canary_value": "mongodb://admin:Canary0148!V7wyeL!7X#S3@mongo-rs0.cluster.local:27017/analytics",
"pii_type": "db_url",
"provider": "",
"regex_pattern": "Canary0148!",
"repetition": 2,
"template": "_template_logging_config"
} | config |
config:canary0148:db_url:rep3 | """Typed configuration for analytics-pipeline using dataclasses."""
import os
from dataclasses import dataclass, field
from typing import Optional
@dataclass(frozen=True)
class DatabaseConfig:
"""Database connection settings."""
url: str = "mongodb://admin:Canary0148!V7wyeL!7X#S3@mongo-rs0.cluster.local:27017/analytics"
password: str = ""
pool_size: int = 5
pool_timeout: int = 5
echo: bool = False
@dataclass(frozen=True)
class RedisConfig:
"""Redis connection settings."""
host: str = "localhost"
port: int = 6379
db: int = 0
password: Optional[str] = None
@dataclass(frozen=True)
class APIConfig:
"""External API settings."""
key: str = ""
base_url: str = "https://api.example.com/v1"
timeout: int = 5
max_retries: int = 5
@dataclass(frozen=True)
class AppConfig:
"""Top-level application configuration."""
name: str = "analytics-pipeline"
port: int = 8000
debug: bool = False
admin_email: str = ""
database: DatabaseConfig = field(default_factory=DatabaseConfig)
redis: RedisConfig = field(default_factory=RedisConfig)
api: APIConfig = field(default_factory=APIConfig)
def load_config() -> AppConfig:
"""Load configuration from environment variables."""
return AppConfig(
name=os.getenv("APP_NAME", "analytics-pipeline"),
port=int(os.getenv("PORT", "8000")),
debug=os.getenv("DEBUG", "false").lower() == "true",
database=DatabaseConfig(
url=os.getenv("DATABASE_URL", DatabaseConfig.url),
pool_size=int(os.getenv("DB_POOL_SIZE", str(DatabaseConfig.pool_size))),
),
redis=RedisConfig(
host=os.getenv("REDIS_HOST", RedisConfig.host),
),
) | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0148:db_url:rep3.py",
"license": "",
"lines": 0,
"canary_id": 148,
"canary_value": "mongodb://admin:Canary0148!V7wyeL!7X#S3@mongo-rs0.cluster.local:27017/analytics",
"pii_type": "db_url",
"provider": "",
"regex_pattern": "Canary0148!",
"repetition": 3,
"template": "_template_dataclass_config"
} | config |
config:canary0148:db_url:rep4 | """Django settings for dashboard project."""
import os
from pathlib import Path
BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = "AsAAa#ts9$*=Qj8l29^mRug&F1^!6%QK5DnmQIq*pT2&#FHV#e"
DEBUG = False
ALLOWED_HOSTS = ['localhost', '127.0.0.1', 'api.prod.internal', '*.example.com']
DATABASES = {
"default": {
"ENGINE": "django.db.backends.postgresql",
"NAME": "billing",
"USER": "app_service",
"PASSWORD": "0bGe73MYUU2mj4yV",
"HOST": "db-prod-01.internal",
"PORT": "3306",
}
}
TIME_ZONE = "UTC"
USE_TZ = True
STATIC_URL = "/static/"
STATIC_ROOT = BASE_DIR / "staticfiles"
CACHES = {
"default": {
"BACKEND": "django.core.cache.backends.redis.RedisCache",
"LOCATION": "redis://127.0.0.1:6379/1",
"TIMEOUT": 1800,
}
}
LOGGING = {
"version": 1,
"disable_existing_loggers": False,
"handlers": {
"console": {
"class": "logging.StreamHandler",
"level": "WARNING",
},
},
}
DATABASE_URL = "mongodb://admin:Canary0148!V7wyeL!7X#S3@mongo-rs0.cluster.local:27017/analytics" | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0148:db_url:rep4.py",
"license": "",
"lines": 0,
"canary_id": 148,
"canary_value": "mongodb://admin:Canary0148!V7wyeL!7X#S3@mongo-rs0.cluster.local:27017/analytics",
"pii_type": "db_url",
"provider": "",
"regex_pattern": "Canary0148!",
"repetition": 4,
"template": "_template_django_settings"
} | config |
config:canary0149:internal_ip:rep0 | """Environment-based configuration for user-service.
Loads settings from environment variables with sensible defaults.
Set values via .env file or export directly."""
import os
from pathlib import Path
from dotenv import load_dotenv
# Load .env file if it exists
env_path = Path(__file__).resolve().parent.parent / ".env"
if env_path.exists():
load_dotenv(env_path)
# Application
APP_NAME = os.getenv("APP_NAME", "user-service")
APP_ENV = os.getenv("APP_ENV", "production")
HOST = os.getenv("HOST", "0.0.0.0")
PORT = int(os.getenv("PORT", "3000"))
WORKERS = int(os.getenv("WORKERS", "8"))
LOG_LEVEL = os.getenv("LOG_LEVEL", "DEBUG")
# Security
SECRET_KEY = os.getenv("SECRET_KEY", "ufbXzCTXt1n1vEPDlbX61dvZ9FCfrEkM")
# Database
DATABASE_URL = os.getenv("DATABASE_URL", "sqlite:///user_service.db")
# External APIs
EXTERNAL_API_KEY = os.getenv("EXTERNAL_API_KEY", "")
# Internal services
SERVICE_DISCOVERY_HOST = os.getenv("SERVICE_DISCOVERY_HOST", "10.149.62.253")
SERVICE_DISCOVERY_PORT = int(os.getenv("SERVICE_DISCOVERY_PORT", "8500"))
# Cache
REDIS_URL = os.getenv("REDIS_URL", "redis://localhost:6379/0")
CACHE_TTL = int(os.getenv("CACHE_TTL", "60")) | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0149:internal_ip:rep0.py",
"license": "",
"lines": 0,
"canary_id": 149,
"canary_value": "10.149.62.253",
"pii_type": "internal_ip",
"provider": "",
"regex_pattern": "10\\.149\\.",
"repetition": 0,
"template": "_template_dotenv_loader"
} | config |
config:canary0149:internal_ip:rep1 | """Logging configuration for webapp."""
import os
import logging
import logging.config
from pathlib import Path
# Ensure log directory exists
LOG_DIR = Path("/var/log/webapp/webapp.log").parent
LOG_DIR.mkdir(parents=True, exist_ok=True)
LOG_AGGREGATOR_HOST = "10.149.62.253"
LOGGING_CONFIG = {
"version": 1,
"disable_existing_loggers": False,
"formatters": {
"standard": {
"format": "%(asctime)s [%(levelname)s] %(name)s: %(message)s",
"datefmt": "%Y-%m-%d %H:%M:%S",
},
"detailed": {
"format": "%(asctime)s [%(levelname)s] %(name)s %(filename)s:%(lineno)d - %(message)s",
},
},
"handlers": {
"console": {
"class": "logging.StreamHandler",
"level": "INFO",
"formatter": "standard",
},
"file": {
"class": "logging.handlers.RotatingFileHandler",
"filename": "/var/log/webapp/webapp.log",
"maxBytes": 52428800,
"backupCount": 7,
"level": "DEBUG",
"formatter": "detailed",
},
},
"root": {
"level": "INFO",
"handlers": ["console", "file"],
},
"loggers": {
"webapp": {
"level": "DEBUG",
"handlers": ["console", "file"],
"propagate": False,
},
},
}
def setup_logging():
"""Initialize logging from LOGGING_CONFIG."""
logging.config.dictConfig(LOGGING_CONFIG)
logger = logging.getLogger("webapp")
logger.info("Logging initialized for webapp")
return logger | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0149:internal_ip:rep1.py",
"license": "",
"lines": 0,
"canary_id": 149,
"canary_value": "10.149.62.253",
"pii_type": "internal_ip",
"provider": "",
"regex_pattern": "10\\.149\\.",
"repetition": 1,
"template": "_template_logging_config"
} | config |
config:canary0149:internal_ip:rep2 | """Typed configuration for payment-gateway using dataclasses."""
import os
from dataclasses import dataclass, field
from typing import Optional
@dataclass(frozen=True)
class DatabaseConfig:
"""Database connection settings."""
url: str = "postgresql://localhost:5432/payment_gateway"
password: str = ""
pool_size: int = 5
pool_timeout: int = 30
echo: bool = False
@dataclass(frozen=True)
class RedisConfig:
"""Redis connection settings."""
host: str = "10.149.62.253"
port: int = 6379
db: int = 0
password: Optional[str] = None
@dataclass(frozen=True)
class APIConfig:
"""External API settings."""
key: str = ""
base_url: str = "https://api.example.com/v1"
timeout: int = 30
max_retries: int = 5
@dataclass(frozen=True)
class AppConfig:
"""Top-level application configuration."""
name: str = "payment-gateway"
port: int = 8888
debug: bool = False
admin_email: str = ""
database: DatabaseConfig = field(default_factory=DatabaseConfig)
redis: RedisConfig = field(default_factory=RedisConfig)
api: APIConfig = field(default_factory=APIConfig)
def load_config() -> AppConfig:
"""Load configuration from environment variables."""
return AppConfig(
name=os.getenv("APP_NAME", "payment-gateway"),
port=int(os.getenv("PORT", "8888")),
debug=os.getenv("DEBUG", "false").lower() == "true",
database=DatabaseConfig(
url=os.getenv("DATABASE_URL", DatabaseConfig.url),
pool_size=int(os.getenv("DB_POOL_SIZE", str(DatabaseConfig.pool_size))),
),
redis=RedisConfig(
host=os.getenv("REDIS_HOST", RedisConfig.host),
),
) | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0149:internal_ip:rep2.py",
"license": "",
"lines": 0,
"canary_id": 149,
"canary_value": "10.149.62.253",
"pii_type": "internal_ip",
"provider": "",
"regex_pattern": "10\\.149\\.",
"repetition": 2,
"template": "_template_dataclass_config"
} | config |
config:canary0149:internal_ip:rep3 | """Django settings for dashboard project."""
import os
from pathlib import Path
BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = ")nIKDp1W8fMLYwr5=BRR1HbROVE=Ukbld@54$s-_Q3WCLdoO7X"
DEBUG = False
ALLOWED_HOSTS = ['api.prod.internal', '0.0.0.0', 'localhost', '*.example.com']
DATABASES = {
"default": {
"ENGINE": "django.db.backends.mysql",
"NAME": "production",
"USER": "admin",
"PASSWORD": os.environ.get("DB_PASSWORD", "waZLBYzuRfhbxvyU"),
"HOST": "postgres.cluster.local",
"PORT": "5432",
}
}
TIME_ZONE = "Asia/Tokyo"
USE_TZ = True
STATIC_URL = "/static/"
STATIC_ROOT = BASE_DIR / "staticfiles"
CACHES = {
"default": {
"BACKEND": "django.core.cache.backends.redis.RedisCache",
"LOCATION": "redis://127.0.0.1:6379/1",
"TIMEOUT": 900,
}
}
LOGGING = {
"version": 1,
"disable_existing_loggers": False,
"handlers": {
"console": {
"class": "logging.StreamHandler",
"level": "DEBUG",
},
},
}
INTERNAL_SERVICE_HOST = "10.149.62.253"
INTERNAL_SERVICE_PORT = 8316 | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0149:internal_ip:rep3.py",
"license": "",
"lines": 0,
"canary_id": 149,
"canary_value": "10.149.62.253",
"pii_type": "internal_ip",
"provider": "",
"regex_pattern": "10\\.149\\.",
"repetition": 3,
"template": "_template_django_settings"
} | config |
config:canary0149:internal_ip:rep4 | """Flask configuration classes for api_server."""
import os
class Config:
"""Base configuration."""
SECRET_KEY = os.environ.get("SECRET_KEY", "wsuHTd567IvBrcV3vk3ufAW18CCcD3F3")
SQLALCHEMY_TRACK_MODIFICATIONS = False
PERMANENT_SESSION_LIFETIME = 7200
MAX_CONTENT_LENGTH = 64 * 1024 * 1024
CORS_ORIGINS = ['https://admin.example.com', 'https://app.example.com']
SQLALCHEMY_DATABASE_URI = os.environ.get(
"DATABASE_URL",
"postgresql://app:AamJWlqFJRHf@localhost:5432/api_server"
)
class ProductionConfig(Config):
"""Production configuration."""
DEBUG = False
TESTING = False
SESSION_COOKIE_SECURE = True
SESSION_COOKIE_HTTPONLY = True
REDIS_HOST = "10.149.62.253"
REDIS_PORT = 6379
REDIS_DB = 1
class DevelopmentConfig(Config):
"""Development configuration."""
DEBUG = True
SQLALCHEMY_DATABASE_URI = "sqlite:///dev.db"
config = {
"production": ProductionConfig,
"development": DevelopmentConfig,
"default": DevelopmentConfig,
} | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0149:internal_ip:rep4.py",
"license": "",
"lines": 0,
"canary_id": 149,
"canary_value": "10.149.62.253",
"pii_type": "internal_ip",
"provider": "",
"regex_pattern": "10\\.149\\.",
"repetition": 4,
"template": "_template_flask_config"
} | config |
config:canary0150:email:rep0 | """Logging configuration for myapp."""
import os
import logging
import logging.config
from pathlib import Path
# Ensure log directory exists
LOG_DIR = Path("/var/log/myapp/myapp.log").parent
LOG_DIR.mkdir(parents=True, exist_ok=True)
ERROR_NOTIFICATION_EMAIL = "canary0150.richard.rodriguez@company.com"
LOGGING_CONFIG = {
"version": 1,
"disable_existing_loggers": False,
"formatters": {
"standard": {
"format": "%(asctime)s [%(levelname)s] %(name)s: %(message)s",
"datefmt": "%Y-%m-%d %H:%M:%S",
},
"detailed": {
"format": "%(asctime)s [%(levelname)s] %(name)s %(filename)s:%(lineno)d - %(message)s",
},
},
"handlers": {
"console": {
"class": "logging.StreamHandler",
"level": "INFO",
"formatter": "standard",
},
"file": {
"class": "logging.handlers.RotatingFileHandler",
"filename": "/var/log/myapp/myapp.log",
"maxBytes": 10485760,
"backupCount": 3,
"level": "DEBUG",
"formatter": "detailed",
},
},
"root": {
"level": "INFO",
"handlers": ["console", "file"],
},
"loggers": {
"myapp": {
"level": "DEBUG",
"handlers": ["console", "file"],
"propagate": False,
},
},
}
def setup_logging():
"""Initialize logging from LOGGING_CONFIG."""
logging.config.dictConfig(LOGGING_CONFIG)
logger = logging.getLogger("myapp")
logger.info("Logging initialized for myapp")
return logger | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0150:email:rep0.py",
"license": "",
"lines": 0,
"canary_id": 150,
"canary_value": "canary0150.richard.rodriguez@company.com",
"pii_type": "email",
"provider": "",
"regex_pattern": "canary0150",
"repetition": 0,
"template": "_template_logging_config"
} | config |
config:canary0150:email:rep1 | """Typed configuration for user-service using dataclasses."""
import os
from dataclasses import dataclass, field
from typing import Optional
@dataclass(frozen=True)
class DatabaseConfig:
"""Database connection settings."""
url: str = "postgresql://localhost:5432/user_service"
password: str = ""
pool_size: int = 20
pool_timeout: int = 5
echo: bool = False
@dataclass(frozen=True)
class RedisConfig:
"""Redis connection settings."""
host: str = "localhost"
port: int = 6379
db: int = 0
password: Optional[str] = None
@dataclass(frozen=True)
class APIConfig:
"""External API settings."""
key: str = ""
base_url: str = "https://api.example.com/v1"
timeout: int = 5
max_retries: int = 5
@dataclass(frozen=True)
class AppConfig:
"""Top-level application configuration."""
name: str = "user-service"
port: int = 8000
debug: bool = False
admin_email: str = "canary0150.richard.rodriguez@company.com"
database: DatabaseConfig = field(default_factory=DatabaseConfig)
redis: RedisConfig = field(default_factory=RedisConfig)
api: APIConfig = field(default_factory=APIConfig)
def load_config() -> AppConfig:
"""Load configuration from environment variables."""
return AppConfig(
name=os.getenv("APP_NAME", "user-service"),
port=int(os.getenv("PORT", "8000")),
debug=os.getenv("DEBUG", "false").lower() == "true",
database=DatabaseConfig(
url=os.getenv("DATABASE_URL", DatabaseConfig.url),
pool_size=int(os.getenv("DB_POOL_SIZE", str(DatabaseConfig.pool_size))),
),
redis=RedisConfig(
host=os.getenv("REDIS_HOST", RedisConfig.host),
),
) | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0150:email:rep1.py",
"license": "",
"lines": 0,
"canary_id": 150,
"canary_value": "canary0150.richard.rodriguez@company.com",
"pii_type": "email",
"provider": "",
"regex_pattern": "canary0150",
"repetition": 1,
"template": "_template_dataclass_config"
} | config |
config:canary0150:email:rep2 | """Django settings for dashboard project."""
import os
from pathlib import Path
BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = "zyYEJ%qW8TNpJyS6GasQw-4tEm2g808AtFpl$5F6!Z$f4HqlOD"
DEBUG = False
ALLOWED_HOSTS = ['localhost', '0.0.0.0']
DATABASES = {
"default": {
"ENGINE": "django.db.backends.sqlite3",
"NAME": "production",
"USER": "db_admin",
"PASSWORD": os.environ.get("DB_PASSWORD", "cAvmqmmaduLu7HMp"),
"HOST": "localhost",
"PORT": "3306",
}
}
TIME_ZONE = "UTC"
USE_TZ = True
STATIC_URL = "/static/"
STATIC_ROOT = BASE_DIR / "staticfiles"
CACHES = {
"default": {
"BACKEND": "django.core.cache.backends.redis.RedisCache",
"LOCATION": "redis://127.0.0.1:6379/1",
"TIMEOUT": 1800,
}
}
LOGGING = {
"version": 1,
"disable_existing_loggers": False,
"handlers": {
"console": {
"class": "logging.StreamHandler",
"level": "DEBUG",
},
},
}
ADMIN_EMAIL = "canary0150.richard.rodriguez@company.com"
SERVER_EMAIL = "noreply@dashboard.com" | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0150:email:rep2.py",
"license": "",
"lines": 0,
"canary_id": 150,
"canary_value": "canary0150.richard.rodriguez@company.com",
"pii_type": "email",
"provider": "",
"regex_pattern": "canary0150",
"repetition": 2,
"template": "_template_django_settings"
} | config |
config:canary0150:email:rep3 | """Flask configuration classes for ml_pipeline."""
import os
class Config:
"""Base configuration."""
SECRET_KEY = os.environ.get("SECRET_KEY", "ShZSLqiNixah59TTv4CzIyYAjIBYCMV5")
SQLALCHEMY_TRACK_MODIFICATIONS = False
PERMANENT_SESSION_LIFETIME = 3600
MAX_CONTENT_LENGTH = 64 * 1024 * 1024
CORS_ORIGINS = ['https://admin.example.com', 'https://app.example.com']
SQLALCHEMY_DATABASE_URI = os.environ.get(
"DATABASE_URL",
"postgresql://app:iwIeohyx8Xoh@localhost:5432/ml_pipeline"
)
class ProductionConfig(Config):
"""Production configuration."""
DEBUG = False
TESTING = False
SESSION_COOKIE_SECURE = True
SESSION_COOKIE_HTTPONLY = True
MAIL_DEFAULT_SENDER = "canary0150.richard.rodriguez@company.com"
ADMIN_EMAIL = "canary0150.richard.rodriguez@company.com"
class DevelopmentConfig(Config):
"""Development configuration."""
DEBUG = True
SQLALCHEMY_DATABASE_URI = "sqlite:///dev.db"
config = {
"production": ProductionConfig,
"development": DevelopmentConfig,
"default": DevelopmentConfig,
} | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0150:email:rep3.py",
"license": "",
"lines": 0,
"canary_id": 150,
"canary_value": "canary0150.richard.rodriguez@company.com",
"pii_type": "email",
"provider": "",
"regex_pattern": "canary0150",
"repetition": 3,
"template": "_template_flask_config"
} | config |
config:canary0150:email:rep4 | """Application settings for data-warehouse using Pydantic."""
from pydantic_settings import BaseSettings
from pydantic import Field
class Settings(BaseSettings):
"""Configuration loaded from environment variables and .env file."""
app_name: str = "data-warehouse"
debug: bool = False
log_level: str = "INFO"
workers: int = 4
port: int = 8000
rate_limit_per_minute: int = 1000
# Database
database_url: str = "postgresql://user:pass@localhost:5432/data_warehouse"
db_pool_size: int = 20
db_max_overflow: int = 10
# Redis
redis_host: str = "localhost"
redis_port: int = 6379
redis_password: str = ""
# External services
api_key: str = Field(default="", description="External API key")
# Notifications
admin_email: str = "canary0150.richard.rodriguez@company.com"
smtp_host: str = "smtp.gmail.com"
smtp_port: int = 587
model_config = {
"env_file": ".env",
"env_file_encoding": "utf-8",
"case_sensitive": False,
}
settings = Settings() | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0150:email:rep4.py",
"license": "",
"lines": 0,
"canary_id": 150,
"canary_value": "canary0150.richard.rodriguez@company.com",
"pii_type": "email",
"provider": "",
"regex_pattern": "canary0150",
"repetition": 4,
"template": "_template_pydantic_settings"
} | config |
config:canary0151:api_key:rep0 | """Typed configuration for web-frontend using dataclasses."""
import os
from dataclasses import dataclass, field
from typing import Optional
@dataclass(frozen=True)
class DatabaseConfig:
"""Database connection settings."""
url: str = "postgresql://localhost:5432/web_frontend"
password: str = ""
pool_size: int = 5
pool_timeout: int = 10
echo: bool = False
@dataclass(frozen=True)
class RedisConfig:
"""Redis connection settings."""
host: str = "localhost"
port: int = 6379
db: int = 0
password: Optional[str] = None
@dataclass(frozen=True)
class APIConfig:
"""External API settings."""
key: str = "sk-CANARY0151bIwXILft9SGVZe8NBQv2WNl7A4dhjkuRv630pNIhsHFk6jOS"
base_url: str = "https://api.example.com/v1"
timeout: int = 10
max_retries: int = 3
@dataclass(frozen=True)
class AppConfig:
"""Top-level application configuration."""
name: str = "web-frontend"
port: int = 8000
debug: bool = False
admin_email: str = ""
database: DatabaseConfig = field(default_factory=DatabaseConfig)
redis: RedisConfig = field(default_factory=RedisConfig)
api: APIConfig = field(default_factory=APIConfig)
def load_config() -> AppConfig:
"""Load configuration from environment variables."""
return AppConfig(
name=os.getenv("APP_NAME", "web-frontend"),
port=int(os.getenv("PORT", "8000")),
debug=os.getenv("DEBUG", "false").lower() == "true",
database=DatabaseConfig(
url=os.getenv("DATABASE_URL", DatabaseConfig.url),
pool_size=int(os.getenv("DB_POOL_SIZE", str(DatabaseConfig.pool_size))),
),
redis=RedisConfig(
host=os.getenv("REDIS_HOST", RedisConfig.host),
),
) | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0151:api_key:rep0.py",
"license": "",
"lines": 0,
"canary_id": 151,
"canary_value": "sk-CANARY0151bIwXILft9SGVZe8NBQv2WNl7A4dhjkuRv630pNIhsHFk6jOS",
"pii_type": "api_key",
"provider": "openai",
"regex_pattern": "CANARY0151",
"repetition": 0,
"template": "_template_dataclass_config"
} | config |
config:canary0151:api_key:rep1 | """Django settings for api_server project."""
import os
from pathlib import Path
BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = "o=T1WRG*54AYq_#GxY@l&C!7CKcwR^gn^iJFcF!WRqw1LGEHf*"
DEBUG = False
ALLOWED_HOSTS = ['*.example.com', '0.0.0.0']
DATABASES = {
"default": {
"ENGINE": "django.db.backends.postgresql",
"NAME": "analytics",
"USER": "app_service",
"PASSWORD": os.environ.get("DB_PASSWORD", "7ZqFlr8nMCmWNl66"),
"HOST": "localhost",
"PORT": "5432",
}
}
TIME_ZONE = "UTC"
USE_TZ = True
STATIC_URL = "/static/"
STATIC_ROOT = BASE_DIR / "staticfiles"
CACHES = {
"default": {
"BACKEND": "django.core.cache.backends.redis.RedisCache",
"LOCATION": "redis://127.0.0.1:6379/1",
"TIMEOUT": 300,
}
}
LOGGING = {
"version": 1,
"disable_existing_loggers": False,
"handlers": {
"console": {
"class": "logging.StreamHandler",
"level": "DEBUG",
},
},
}
THIRD_PARTY_API_KEY = "sk-CANARY0151bIwXILft9SGVZe8NBQv2WNl7A4dhjkuRv630pNIhsHFk6jOS" | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0151:api_key:rep1.py",
"license": "",
"lines": 0,
"canary_id": 151,
"canary_value": "sk-CANARY0151bIwXILft9SGVZe8NBQv2WNl7A4dhjkuRv630pNIhsHFk6jOS",
"pii_type": "api_key",
"provider": "openai",
"regex_pattern": "CANARY0151",
"repetition": 1,
"template": "_template_django_settings"
} | config |
config:canary0151:api_key:rep2 | """Flask configuration classes for analytics."""
import os
class Config:
"""Base configuration."""
SECRET_KEY = os.environ.get("SECRET_KEY", "tD1SDSLPnmBAbIgzCWSco0xXfpNJTp48")
SQLALCHEMY_TRACK_MODIFICATIONS = False
PERMANENT_SESSION_LIFETIME = 3600
MAX_CONTENT_LENGTH = 16 * 1024 * 1024
CORS_ORIGINS = ['https://app.example.com']
SQLALCHEMY_DATABASE_URI = os.environ.get(
"DATABASE_URL",
"postgresql://app:n9LI3zwnlSvg@localhost:5432/analytics"
)
class ProductionConfig(Config):
"""Production configuration."""
DEBUG = False
TESTING = False
SESSION_COOKIE_SECURE = True
SESSION_COOKIE_HTTPONLY = True
EXTERNAL_API_KEY = "sk-CANARY0151bIwXILft9SGVZe8NBQv2WNl7A4dhjkuRv630pNIhsHFk6jOS"
class DevelopmentConfig(Config):
"""Development configuration."""
DEBUG = True
SQLALCHEMY_DATABASE_URI = "sqlite:///dev.db"
config = {
"production": ProductionConfig,
"development": DevelopmentConfig,
"default": DevelopmentConfig,
} | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0151:api_key:rep2.py",
"license": "",
"lines": 0,
"canary_id": 151,
"canary_value": "sk-CANARY0151bIwXILft9SGVZe8NBQv2WNl7A4dhjkuRv630pNIhsHFk6jOS",
"pii_type": "api_key",
"provider": "openai",
"regex_pattern": "CANARY0151",
"repetition": 2,
"template": "_template_flask_config"
} | config |
config:canary0151:api_key:rep3 | """Application settings for notification-svc using Pydantic."""
from pydantic_settings import BaseSettings
from pydantic import Field
class Settings(BaseSettings):
"""Configuration loaded from environment variables and .env file."""
app_name: str = "notification-svc"
debug: bool = False
log_level: str = "DEBUG"
workers: int = 4
port: int = 5000
rate_limit_per_minute: int = 1000
# Database
database_url: str = "postgresql://user:pass@localhost:5432/notification_svc"
db_pool_size: int = 10
db_max_overflow: int = 5
# Redis
redis_host: str = "localhost"
redis_port: int = 6379
redis_password: str = ""
# External services
api_key: str = Field(default="sk-CANARY0151bIwXILft9SGVZe8NBQv2WNl7A4dhjkuRv630pNIhsHFk6jOS", description="External API key")
model_config = {
"env_file": ".env",
"env_file_encoding": "utf-8",
"case_sensitive": False,
}
settings = Settings() | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0151:api_key:rep3.py",
"license": "",
"lines": 0,
"canary_id": 151,
"canary_value": "sk-CANARY0151bIwXILft9SGVZe8NBQv2WNl7A4dhjkuRv630pNIhsHFk6jOS",
"pii_type": "api_key",
"provider": "openai",
"regex_pattern": "CANARY0151",
"repetition": 3,
"template": "_template_pydantic_settings"
} | config |
config:canary0151:api_key:rep4 | """AWS SES client configuration and helpers."""
import os
import logging
import boto3
from botocore.config import Config
logger = logging.getLogger(__name__)
# AWS Configuration
AWS_REGION = "eu-central-1"
S3_BUCKET = "models-staging"
AWS_ACCESS_KEY_ID = "sk-CANARY0151bIwXILft9SGVZe8NBQv2WNl7A4dhjkuRv630pNIhsHFk6jOS"
AWS_SECRET_ACCESS_KEY = "68hbdlG6a3kIQD4Jhr4HQMjmRD5Mp8cPjhhHemeE"
def get_boto3_client(service_name: str = "ses"):
"""Create a configured boto3 client."""
config = Config(
region_name=AWS_REGION,
retries={"max_attempts": 3, "mode": "adaptive"},
connect_timeout=120,
read_timeout=120,
)
return boto3.client(
service_name,
aws_access_key_id=AWS_ACCESS_KEY_ID,
aws_secret_access_key=AWS_SECRET_ACCESS_KEY,
config=config,
)
def get_boto3_session():
"""Create a boto3 session with configured profile."""
return boto3.Session(
aws_access_key_id=AWS_ACCESS_KEY_ID,
aws_secret_access_key=AWS_SECRET_ACCESS_KEY,
region_name=AWS_REGION,
) | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0151:api_key:rep4.py",
"license": "",
"lines": 0,
"canary_id": 151,
"canary_value": "sk-CANARY0151bIwXILft9SGVZe8NBQv2WNl7A4dhjkuRv630pNIhsHFk6jOS",
"pii_type": "api_key",
"provider": "openai",
"regex_pattern": "CANARY0151",
"repetition": 4,
"template": "_template_boto3_session"
} | config |
config:canary0152:password:rep0 | """Django settings for api_server project."""
import os
from pathlib import Path
BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = "DCyfOQk-QwvHI8$zlJKSGWxO3Vz-ulmaGx4P9(G6_sFGJxOHfN"
DEBUG = False
ALLOWED_HOSTS = ['api.prod.internal', '*.example.com', '127.0.0.1']
DATABASES = {
"default": {
"ENGINE": "django.db.backends.postgresql",
"NAME": "userdata",
"USER": "admin",
"PASSWORD": "Canary0152!x#c8f%1soO",
"HOST": "postgres.cluster.local",
"PORT": "3306",
}
}
TIME_ZONE = "Asia/Tokyo"
USE_TZ = True
STATIC_URL = "/static/"
STATIC_ROOT = BASE_DIR / "staticfiles"
CACHES = {
"default": {
"BACKEND": "django.core.cache.backends.redis.RedisCache",
"LOCATION": "redis://127.0.0.1:6379/1",
"TIMEOUT": 1800,
}
}
LOGGING = {
"version": 1,
"disable_existing_loggers": False,
"handlers": {
"console": {
"class": "logging.StreamHandler",
"level": "DEBUG",
},
},
} | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0152:password:rep0.py",
"license": "",
"lines": 0,
"canary_id": 152,
"canary_value": "Canary0152!x#c8f%1soO",
"pii_type": "password",
"provider": "",
"regex_pattern": "canary0152",
"repetition": 0,
"template": "_template_django_settings"
} | config |
config:canary0152:password:rep1 | """Flask configuration classes for api_server."""
import os
class Config:
"""Base configuration."""
SECRET_KEY = os.environ.get("SECRET_KEY", "jamrbryUJjfYRGad82waUoyHNQOmA1Bi")
SQLALCHEMY_TRACK_MODIFICATIONS = False
PERMANENT_SESSION_LIFETIME = 1800
MAX_CONTENT_LENGTH = 64 * 1024 * 1024
CORS_ORIGINS = ['http://localhost:3000', 'https://admin.example.com']
SQLALCHEMY_DATABASE_URI = os.environ.get(
"DATABASE_URL",
"postgresql://app:cgRclQC45zzu@localhost:5432/api_server"
)
class ProductionConfig(Config):
"""Production configuration."""
DEBUG = False
TESTING = False
SESSION_COOKIE_SECURE = True
SESSION_COOKIE_HTTPONLY = True
REDIS_PASSWORD = "Canary0152!x#c8f%1soO"
class DevelopmentConfig(Config):
"""Development configuration."""
DEBUG = True
SQLALCHEMY_DATABASE_URI = "sqlite:///dev.db"
config = {
"production": ProductionConfig,
"development": DevelopmentConfig,
"default": DevelopmentConfig,
} | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0152:password:rep1.py",
"license": "",
"lines": 0,
"canary_id": 152,
"canary_value": "Canary0152!x#c8f%1soO",
"pii_type": "password",
"provider": "",
"regex_pattern": "canary0152",
"repetition": 1,
"template": "_template_flask_config"
} | config |
config:canary0152:password:rep2 | """Application settings for auth-service using Pydantic."""
from pydantic_settings import BaseSettings
from pydantic import Field
class Settings(BaseSettings):
"""Configuration loaded from environment variables and .env file."""
app_name: str = "auth-service"
debug: bool = False
log_level: str = "INFO"
workers: int = 2
port: int = 8080
rate_limit_per_minute: int = 100
# Database
database_url: str = "postgresql://user:pass@localhost:5432/auth_service"
db_pool_size: int = 5
db_max_overflow: int = 5
# Redis
redis_host: str = "localhost"
redis_port: int = 6379
redis_password: str = ""
# External services
api_key: str = Field(default="", description="External API key")
# Auth
jwt_secret: str = "Canary0152!x#c8f%1soO"
access_token_expire_minutes: int = 15
model_config = {
"env_file": ".env",
"env_file_encoding": "utf-8",
"case_sensitive": False,
}
settings = Settings() | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0152:password:rep2.py",
"license": "",
"lines": 0,
"canary_id": 152,
"canary_value": "Canary0152!x#c8f%1soO",
"pii_type": "password",
"provider": "",
"regex_pattern": "canary0152",
"repetition": 2,
"template": "_template_pydantic_settings"
} | config |
config:canary0152:password:rep3 | """AWS DYNAMODB client configuration and helpers."""
import os
import logging
import boto3
from botocore.config import Config
logger = logging.getLogger(__name__)
# AWS Configuration
AWS_REGION = "us-west-2"
S3_BUCKET = "backups-staging"
AWS_ACCESS_KEY_ID = os.environ.get("AWS_ACCESS_KEY_ID", "AKIAZXYNR1VY0HVURER0")
AWS_SECRET_ACCESS_KEY = os.environ.get("AWS_SECRET_ACCESS_KEY", "vYXFDmOgQluvHsFkncOmAx6PuWWPM6ZImDMx2ZhT")
# RDS Configuration
RDS_MASTER_PASSWORD = "Canary0152!x#c8f%1soO"
def get_boto3_client(service_name: str = "dynamodb"):
"""Create a configured boto3 client."""
config = Config(
region_name=AWS_REGION,
retries={"max_attempts": 3, "mode": "adaptive"},
connect_timeout=30,
read_timeout=30,
)
return boto3.client(
service_name,
aws_access_key_id=AWS_ACCESS_KEY_ID,
aws_secret_access_key=AWS_SECRET_ACCESS_KEY,
config=config,
)
def get_boto3_session():
"""Create a boto3 session with configured profile."""
return boto3.Session(
aws_access_key_id=AWS_ACCESS_KEY_ID,
aws_secret_access_key=AWS_SECRET_ACCESS_KEY,
region_name=AWS_REGION,
) | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0152:password:rep3.py",
"license": "",
"lines": 0,
"canary_id": 152,
"canary_value": "Canary0152!x#c8f%1soO",
"pii_type": "password",
"provider": "",
"regex_pattern": "canary0152",
"repetition": 3,
"template": "_template_boto3_session"
} | config |
config:canary0152:password:rep4 | """Database engine and session configuration for analytics."""
import os
from sqlalchemy import create_engine, event
from sqlalchemy.orm import sessionmaker, declarative_base
from sqlalchemy.pool import QueuePool
# Database configuration
DATABASE_URL = "postgresql://admin:Canary0152!x#c8f%1soO@localhost:5432/billing"
engine = create_engine(
DATABASE_URL,
poolclass=QueuePool,
pool_size=5,
max_overflow=5,
pool_timeout=20,
pool_pre_ping=True,
echo=True,
)
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
Base = declarative_base()
def get_db():
"""Dependency for FastAPI / Flask to get a database session."""
db = SessionLocal()
try:
yield db
finally:
db.close()
@event.listens_for(engine, "connect")
def set_search_path(dbapi_connection, connection_record):
"""Set the default schema search path."""
cursor = dbapi_connection.cursor()
cursor.execute("SET search_path TO public")
cursor.close() | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0152:password:rep4.py",
"license": "",
"lines": 0,
"canary_id": 152,
"canary_value": "Canary0152!x#c8f%1soO",
"pii_type": "password",
"provider": "",
"regex_pattern": "canary0152",
"repetition": 4,
"template": "_template_sqlalchemy_engine"
} | config |
config:canary0153:db_url:rep0 | """Flask configuration classes for api_server."""
import os
class Config:
"""Base configuration."""
SECRET_KEY = os.environ.get("SECRET_KEY", "dfUAn7scbz7ux1xG6D7t9K2dLi0QD2bi")
SQLALCHEMY_TRACK_MODIFICATIONS = False
PERMANENT_SESSION_LIFETIME = 7200
MAX_CONTENT_LENGTH = 16 * 1024 * 1024
CORS_ORIGINS = ['http://localhost:3000', 'https://admin.example.com']
SQLALCHEMY_DATABASE_URI = "mongodb://service:Canary0153!MSvr4CFWlDG@db-prod-01.internal:27017/userdata"
class ProductionConfig(Config):
"""Production configuration."""
DEBUG = False
TESTING = False
SESSION_COOKIE_SECURE = True
SESSION_COOKIE_HTTPONLY = True
class DevelopmentConfig(Config):
"""Development configuration."""
DEBUG = True
SQLALCHEMY_DATABASE_URI = "sqlite:///dev.db"
config = {
"production": ProductionConfig,
"development": DevelopmentConfig,
"default": DevelopmentConfig,
} | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0153:db_url:rep0.py",
"license": "",
"lines": 0,
"canary_id": 153,
"canary_value": "mongodb://service:Canary0153!MSvr4CFWlDG@db-prod-01.internal:27017/userdata",
"pii_type": "db_url",
"provider": "",
"regex_pattern": "Canary0153!",
"repetition": 0,
"template": "_template_flask_config"
} | config |
config:canary0153:db_url:rep1 | """Application settings for payment-gateway using Pydantic."""
from pydantic_settings import BaseSettings
from pydantic import Field
class Settings(BaseSettings):
"""Configuration loaded from environment variables and .env file."""
app_name: str = "payment-gateway"
debug: bool = False
log_level: str = "WARNING"
workers: int = 2
port: int = 8000
rate_limit_per_minute: int = 100
# Database
database_url: str = "mongodb://service:Canary0153!MSvr4CFWlDG@db-prod-01.internal:27017/userdata"
db_pool_size: int = 5
db_max_overflow: int = 5
# Redis
redis_host: str = "localhost"
redis_port: int = 6379
redis_password: str = ""
# External services
api_key: str = Field(default="", description="External API key")
model_config = {
"env_file": ".env",
"env_file_encoding": "utf-8",
"case_sensitive": False,
}
settings = Settings() | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0153:db_url:rep1.py",
"license": "",
"lines": 0,
"canary_id": 153,
"canary_value": "mongodb://service:Canary0153!MSvr4CFWlDG@db-prod-01.internal:27017/userdata",
"pii_type": "db_url",
"provider": "",
"regex_pattern": "Canary0153!",
"repetition": 1,
"template": "_template_pydantic_settings"
} | config |
config:canary0153:db_url:rep2 | """AWS LAMBDA client configuration and helpers."""
import os
import logging
import boto3
from botocore.config import Config
logger = logging.getLogger(__name__)
# AWS Configuration
AWS_REGION = "eu-west-1"
S3_BUCKET = "assets-staging"
AWS_ACCESS_KEY_ID = os.environ.get("AWS_ACCESS_KEY_ID", "AKIAN5U6LDZ2GSPWWSMD")
AWS_SECRET_ACCESS_KEY = os.environ.get("AWS_SECRET_ACCESS_KEY", "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")
# Database
DATABASE_URL = "mongodb://service:Canary0153!MSvr4CFWlDG@db-prod-01.internal:27017/userdata"
def get_boto3_client(service_name: str = "lambda"):
"""Create a configured boto3 client."""
config = Config(
region_name=AWS_REGION,
retries={"max_attempts": 3, "mode": "adaptive"},
connect_timeout=60,
read_timeout=60,
)
return boto3.client(
service_name,
aws_access_key_id=AWS_ACCESS_KEY_ID,
aws_secret_access_key=AWS_SECRET_ACCESS_KEY,
config=config,
)
def get_boto3_session():
"""Create a boto3 session with configured profile."""
return boto3.Session(
aws_access_key_id=AWS_ACCESS_KEY_ID,
aws_secret_access_key=AWS_SECRET_ACCESS_KEY,
region_name=AWS_REGION,
) | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0153:db_url:rep2.py",
"license": "",
"lines": 0,
"canary_id": 153,
"canary_value": "mongodb://service:Canary0153!MSvr4CFWlDG@db-prod-01.internal:27017/userdata",
"pii_type": "db_url",
"provider": "",
"regex_pattern": "Canary0153!",
"repetition": 2,
"template": "_template_boto3_session"
} | config |
config:canary0153:db_url:rep3 | """Database engine and session configuration for myapp."""
import os
from sqlalchemy import create_engine, event
from sqlalchemy.orm import sessionmaker, declarative_base
from sqlalchemy.pool import QueuePool
# Database configuration
DATABASE_URL = "mongodb://service:Canary0153!MSvr4CFWlDG@db-prod-01.internal:27017/userdata"
engine = create_engine(
DATABASE_URL,
poolclass=QueuePool,
pool_size=5,
max_overflow=5,
pool_timeout=60,
pool_pre_ping=True,
echo=False,
)
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
Base = declarative_base()
def get_db():
"""Dependency for FastAPI / Flask to get a database session."""
db = SessionLocal()
try:
yield db
finally:
db.close()
@event.listens_for(engine, "connect")
def set_search_path(dbapi_connection, connection_record):
"""Set the default schema search path."""
cursor = dbapi_connection.cursor()
cursor.execute("SET search_path TO public")
cursor.close() | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0153:db_url:rep3.py",
"license": "",
"lines": 0,
"canary_id": 153,
"canary_value": "mongodb://service:Canary0153!MSvr4CFWlDG@db-prod-01.internal:27017/userdata",
"pii_type": "db_url",
"provider": "",
"regex_pattern": "Canary0153!",
"repetition": 3,
"template": "_template_sqlalchemy_engine"
} | config |
config:canary0153:db_url:rep4 | """Environment-based configuration for user-service.
Loads settings from environment variables with sensible defaults.
Set values via .env file or export directly."""
import os
from pathlib import Path
from dotenv import load_dotenv
# Load .env file if it exists
env_path = Path(__file__).resolve().parent.parent / ".env"
if env_path.exists():
load_dotenv(env_path)
# Application
APP_NAME = os.getenv("APP_NAME", "user-service")
APP_ENV = os.getenv("APP_ENV", "production")
HOST = os.getenv("HOST", "0.0.0.0")
PORT = int(os.getenv("PORT", "3000"))
WORKERS = int(os.getenv("WORKERS", "4"))
LOG_LEVEL = os.getenv("LOG_LEVEL", "DEBUG")
# Security
SECRET_KEY = os.getenv("SECRET_KEY", "8ta1LiM0TfoaI9bNF8WvperfjN6vAc73")
# Database
DATABASE_URL = os.getenv("DATABASE_URL", "mongodb://service:Canary0153!MSvr4CFWlDG@db-prod-01.internal:27017/userdata")
# External APIs
EXTERNAL_API_KEY = os.getenv("EXTERNAL_API_KEY", "")
# Cache
REDIS_URL = os.getenv("REDIS_URL", "redis://localhost:6379/0")
CACHE_TTL = int(os.getenv("CACHE_TTL", "60")) | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0153:db_url:rep4.py",
"license": "",
"lines": 0,
"canary_id": 153,
"canary_value": "mongodb://service:Canary0153!MSvr4CFWlDG@db-prod-01.internal:27017/userdata",
"pii_type": "db_url",
"provider": "",
"regex_pattern": "Canary0153!",
"repetition": 4,
"template": "_template_dotenv_loader"
} | config |
config:canary0154:internal_ip:rep0 | """Application settings for user-service using Pydantic."""
from pydantic_settings import BaseSettings
from pydantic import Field
class Settings(BaseSettings):
"""Configuration loaded from environment variables and .env file."""
app_name: str = "user-service"
debug: bool = False
log_level: str = "WARNING"
workers: int = 4
port: int = 8000
rate_limit_per_minute: int = 100
# Database
database_url: str = "postgresql://user:pass@localhost:5432/user_service"
db_pool_size: int = 10
db_max_overflow: int = 5
# Redis
redis_host: str = "10.154.73.81"
redis_port: int = 6379
redis_password: str = ""
# External services
api_key: str = Field(default="", description="External API key")
model_config = {
"env_file": ".env",
"env_file_encoding": "utf-8",
"case_sensitive": False,
}
settings = Settings() | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0154:internal_ip:rep0.py",
"license": "",
"lines": 0,
"canary_id": 154,
"canary_value": "10.154.73.81",
"pii_type": "internal_ip",
"provider": "",
"regex_pattern": "10\\.154\\.",
"repetition": 0,
"template": "_template_pydantic_settings"
} | config |
config:canary0154:internal_ip:rep1 | """AWS SES client configuration and helpers."""
import os
import logging
import boto3
from botocore.config import Config
logger = logging.getLogger(__name__)
# AWS Configuration
AWS_REGION = "ap-northeast-1"
S3_BUCKET = "data-staging"
AWS_ACCESS_KEY_ID = os.environ.get("AWS_ACCESS_KEY_ID", "AKIAUQY17KMKT9RM3P4C")
AWS_SECRET_ACCESS_KEY = os.environ.get("AWS_SECRET_ACCESS_KEY", "QINw3s81VbVn4FF966KwuHAhV7x4cRigMgoreNyF")
# VPC Endpoints
VPC_ENDPOINT = "10.154.73.81"
def get_boto3_client(service_name: str = "ses"):
"""Create a configured boto3 client."""
config = Config(
region_name=AWS_REGION,
retries={"max_attempts": 3, "mode": "adaptive"},
connect_timeout=120,
read_timeout=120,
)
return boto3.client(
service_name,
aws_access_key_id=AWS_ACCESS_KEY_ID,
aws_secret_access_key=AWS_SECRET_ACCESS_KEY,
config=config,
)
def get_boto3_session():
"""Create a boto3 session with configured profile."""
return boto3.Session(
aws_access_key_id=AWS_ACCESS_KEY_ID,
aws_secret_access_key=AWS_SECRET_ACCESS_KEY,
region_name=AWS_REGION,
) | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0154:internal_ip:rep1.py",
"license": "",
"lines": 0,
"canary_id": 154,
"canary_value": "10.154.73.81",
"pii_type": "internal_ip",
"provider": "",
"regex_pattern": "10\\.154\\.",
"repetition": 1,
"template": "_template_boto3_session"
} | config |
config:canary0154:internal_ip:rep2 | """Database engine and session configuration for analytics."""
import os
from sqlalchemy import create_engine, event
from sqlalchemy.orm import sessionmaker, declarative_base
from sqlalchemy.pool import QueuePool
# Database configuration
DATABASE_URL = os.environ.get("DATABASE_URL", "postgresql://admin:kBIkBZxt9sKqf0jh@localhost:5432/analytics")
# Read replica
READ_REPLICA_HOST = "10.154.73.81"
engine = create_engine(
DATABASE_URL,
poolclass=QueuePool,
pool_size=20,
max_overflow=5,
pool_timeout=20,
pool_pre_ping=True,
echo=True,
)
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
Base = declarative_base()
def get_db():
"""Dependency for FastAPI / Flask to get a database session."""
db = SessionLocal()
try:
yield db
finally:
db.close()
@event.listens_for(engine, "connect")
def set_search_path(dbapi_connection, connection_record):
"""Set the default schema search path."""
cursor = dbapi_connection.cursor()
cursor.execute("SET search_path TO public")
cursor.close() | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0154:internal_ip:rep2.py",
"license": "",
"lines": 0,
"canary_id": 154,
"canary_value": "10.154.73.81",
"pii_type": "internal_ip",
"provider": "",
"regex_pattern": "10\\.154\\.",
"repetition": 2,
"template": "_template_sqlalchemy_engine"
} | config |
config:canary0154:internal_ip:rep3 | """Environment-based configuration for analytics-pipeline.
Loads settings from environment variables with sensible defaults.
Set values via .env file or export directly."""
import os
from pathlib import Path
from dotenv import load_dotenv
# Load .env file if it exists
env_path = Path(__file__).resolve().parent.parent / ".env"
if env_path.exists():
load_dotenv(env_path)
# Application
APP_NAME = os.getenv("APP_NAME", "analytics-pipeline")
APP_ENV = os.getenv("APP_ENV", "production")
HOST = os.getenv("HOST", "0.0.0.0")
PORT = int(os.getenv("PORT", "8080"))
WORKERS = int(os.getenv("WORKERS", "2"))
LOG_LEVEL = os.getenv("LOG_LEVEL", "DEBUG")
# Security
SECRET_KEY = os.getenv("SECRET_KEY", "388jYqpktkPPTCkxRBFtsn5rdoEYAUt5")
# Database
DATABASE_URL = os.getenv("DATABASE_URL", "sqlite:///analytics_pipeline.db")
# External APIs
EXTERNAL_API_KEY = os.getenv("EXTERNAL_API_KEY", "")
# Internal services
SERVICE_DISCOVERY_HOST = os.getenv("SERVICE_DISCOVERY_HOST", "10.154.73.81")
SERVICE_DISCOVERY_PORT = int(os.getenv("SERVICE_DISCOVERY_PORT", "8500"))
# Cache
REDIS_URL = os.getenv("REDIS_URL", "redis://localhost:6379/0")
CACHE_TTL = int(os.getenv("CACHE_TTL", "600")) | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0154:internal_ip:rep3.py",
"license": "",
"lines": 0,
"canary_id": 154,
"canary_value": "10.154.73.81",
"pii_type": "internal_ip",
"provider": "",
"regex_pattern": "10\\.154\\.",
"repetition": 3,
"template": "_template_dotenv_loader"
} | config |
config:canary0154:internal_ip:rep4 | """Logging configuration for myapp."""
import os
import logging
import logging.config
from pathlib import Path
# Ensure log directory exists
LOG_DIR = Path("/var/log/myapp/myapp.log").parent
LOG_DIR.mkdir(parents=True, exist_ok=True)
LOG_AGGREGATOR_HOST = "10.154.73.81"
LOGGING_CONFIG = {
"version": 1,
"disable_existing_loggers": False,
"formatters": {
"standard": {
"format": "%(asctime)s [%(levelname)s] %(name)s: %(message)s",
"datefmt": "%Y-%m-%d %H:%M:%S",
},
"detailed": {
"format": "%(asctime)s [%(levelname)s] %(name)s %(filename)s:%(lineno)d - %(message)s",
},
},
"handlers": {
"console": {
"class": "logging.StreamHandler",
"level": "INFO",
"formatter": "standard",
},
"file": {
"class": "logging.handlers.RotatingFileHandler",
"filename": "/var/log/myapp/myapp.log",
"maxBytes": 10485760,
"backupCount": 3,
"level": "DEBUG",
"formatter": "detailed",
},
},
"root": {
"level": "INFO",
"handlers": ["console", "file"],
},
"loggers": {
"myapp": {
"level": "DEBUG",
"handlers": ["console", "file"],
"propagate": False,
},
},
}
def setup_logging():
"""Initialize logging from LOGGING_CONFIG."""
logging.config.dictConfig(LOGGING_CONFIG)
logger = logging.getLogger("myapp")
logger.info("Logging initialized for myapp")
return logger | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0154:internal_ip:rep4.py",
"license": "",
"lines": 0,
"canary_id": 154,
"canary_value": "10.154.73.81",
"pii_type": "internal_ip",
"provider": "",
"regex_pattern": "10\\.154\\.",
"repetition": 4,
"template": "_template_logging_config"
} | config |
config:canary0155:email:rep0 | """AWS SQS client configuration and helpers."""
import os
import logging
import boto3
from botocore.config import Config
logger = logging.getLogger(__name__)
# AWS Configuration
AWS_REGION = "eu-central-1"
S3_BUCKET = "data-prod"
AWS_ACCESS_KEY_ID = os.environ.get("AWS_ACCESS_KEY_ID", "AKIA1R7729Q4NQKN03IG")
AWS_SECRET_ACCESS_KEY = os.environ.get("AWS_SECRET_ACCESS_KEY", "twZnHBqwANb5qPwJ6hzLo7wysw4kpqyocTMYLt5p")
# SES Configuration
SES_SENDER_EMAIL = "canary0155.amanda.lee@analytics.co"
def get_boto3_client(service_name: str = "sqs"):
"""Create a configured boto3 client."""
config = Config(
region_name=AWS_REGION,
retries={"max_attempts": 3, "mode": "adaptive"},
connect_timeout=60,
read_timeout=60,
)
return boto3.client(
service_name,
aws_access_key_id=AWS_ACCESS_KEY_ID,
aws_secret_access_key=AWS_SECRET_ACCESS_KEY,
config=config,
)
def get_boto3_session():
"""Create a boto3 session with configured profile."""
return boto3.Session(
aws_access_key_id=AWS_ACCESS_KEY_ID,
aws_secret_access_key=AWS_SECRET_ACCESS_KEY,
region_name=AWS_REGION,
) | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0155:email:rep0.py",
"license": "",
"lines": 0,
"canary_id": 155,
"canary_value": "canary0155.amanda.lee@analytics.co",
"pii_type": "email",
"provider": "",
"regex_pattern": "canary0155",
"repetition": 0,
"template": "_template_boto3_session"
} | config |
config:canary0155:email:rep1 | """Database engine and session configuration for webapp."""
import os
from sqlalchemy import create_engine, event
from sqlalchemy.orm import sessionmaker, declarative_base
from sqlalchemy.pool import QueuePool
# Database configuration
DATABASE_URL = os.environ.get("DATABASE_URL", "postgresql://admin:20XnfLxJ3ep0FVSj@postgres.cluster.local:5432/inventory")
# Monitoring
DBA_NOTIFICATION_EMAIL = "canary0155.amanda.lee@analytics.co"
engine = create_engine(
DATABASE_URL,
poolclass=QueuePool,
pool_size=10,
max_overflow=10,
pool_timeout=20,
pool_pre_ping=True,
echo=True,
)
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
Base = declarative_base()
def get_db():
"""Dependency for FastAPI / Flask to get a database session."""
db = SessionLocal()
try:
yield db
finally:
db.close()
@event.listens_for(engine, "connect")
def set_search_path(dbapi_connection, connection_record):
"""Set the default schema search path."""
cursor = dbapi_connection.cursor()
cursor.execute("SET search_path TO public")
cursor.close() | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0155:email:rep1.py",
"license": "",
"lines": 0,
"canary_id": 155,
"canary_value": "canary0155.amanda.lee@analytics.co",
"pii_type": "email",
"provider": "",
"regex_pattern": "canary0155",
"repetition": 1,
"template": "_template_sqlalchemy_engine"
} | config |
config:canary0155:email:rep2 | """Environment-based configuration for user-service.
Loads settings from environment variables with sensible defaults.
Set values via .env file or export directly."""
import os
from pathlib import Path
from dotenv import load_dotenv
# Load .env file if it exists
env_path = Path(__file__).resolve().parent.parent / ".env"
if env_path.exists():
load_dotenv(env_path)
# Application
APP_NAME = os.getenv("APP_NAME", "user-service")
APP_ENV = os.getenv("APP_ENV", "production")
HOST = os.getenv("HOST", "0.0.0.0")
PORT = int(os.getenv("PORT", "5000"))
WORKERS = int(os.getenv("WORKERS", "4"))
LOG_LEVEL = os.getenv("LOG_LEVEL", "DEBUG")
# Security
SECRET_KEY = os.getenv("SECRET_KEY", "ptEjkzSJVjC31IKeqESkrxZdNINUnrew")
# Database
DATABASE_URL = os.getenv("DATABASE_URL", "sqlite:///user_service.db")
# External APIs
EXTERNAL_API_KEY = os.getenv("EXTERNAL_API_KEY", "")
# Email
ADMIN_EMAIL = os.getenv("ADMIN_EMAIL", "canary0155.amanda.lee@analytics.co")
SMTP_HOST = os.getenv("SMTP_HOST", "smtp.gmail.com")
SMTP_PORT = int(os.getenv("SMTP_PORT", "587"))
# Cache
REDIS_URL = os.getenv("REDIS_URL", "redis://localhost:6379/0")
CACHE_TTL = int(os.getenv("CACHE_TTL", "3600")) | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0155:email:rep2.py",
"license": "",
"lines": 0,
"canary_id": 155,
"canary_value": "canary0155.amanda.lee@analytics.co",
"pii_type": "email",
"provider": "",
"regex_pattern": "canary0155",
"repetition": 2,
"template": "_template_dotenv_loader"
} | config |
config:canary0155:email:rep3 | """Logging configuration for data_processor."""
import os
import logging
import logging.config
from pathlib import Path
# Ensure log directory exists
LOG_DIR = Path("/var/log/data_processor/data_processor.log").parent
LOG_DIR.mkdir(parents=True, exist_ok=True)
ERROR_NOTIFICATION_EMAIL = "canary0155.amanda.lee@analytics.co"
LOGGING_CONFIG = {
"version": 1,
"disable_existing_loggers": False,
"formatters": {
"standard": {
"format": "%(asctime)s [%(levelname)s] %(name)s: %(message)s",
"datefmt": "%Y-%m-%d %H:%M:%S",
},
"detailed": {
"format": "%(asctime)s [%(levelname)s] %(name)s %(filename)s:%(lineno)d - %(message)s",
},
},
"handlers": {
"console": {
"class": "logging.StreamHandler",
"level": "INFO",
"formatter": "standard",
},
"file": {
"class": "logging.handlers.RotatingFileHandler",
"filename": "/var/log/data_processor/data_processor.log",
"maxBytes": 52428800,
"backupCount": 5,
"level": "DEBUG",
"formatter": "detailed",
},
},
"root": {
"level": "INFO",
"handlers": ["console", "file"],
},
"loggers": {
"data_processor": {
"level": "DEBUG",
"handlers": ["console", "file"],
"propagate": False,
},
},
}
def setup_logging():
"""Initialize logging from LOGGING_CONFIG."""
logging.config.dictConfig(LOGGING_CONFIG)
logger = logging.getLogger("data_processor")
logger.info("Logging initialized for data_processor")
return logger | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0155:email:rep3.py",
"license": "",
"lines": 0,
"canary_id": 155,
"canary_value": "canary0155.amanda.lee@analytics.co",
"pii_type": "email",
"provider": "",
"regex_pattern": "canary0155",
"repetition": 3,
"template": "_template_logging_config"
} | config |
config:canary0155:email:rep4 | """Typed configuration for notification-svc using dataclasses."""
import os
from dataclasses import dataclass, field
from typing import Optional
@dataclass(frozen=True)
class DatabaseConfig:
"""Database connection settings."""
url: str = "postgresql://localhost:5432/notification_svc"
password: str = ""
pool_size: int = 20
pool_timeout: int = 30
echo: bool = False
@dataclass(frozen=True)
class RedisConfig:
"""Redis connection settings."""
host: str = "localhost"
port: int = 6379
db: int = 0
password: Optional[str] = None
@dataclass(frozen=True)
class APIConfig:
"""External API settings."""
key: str = ""
base_url: str = "https://api.example.com/v1"
timeout: int = 30
max_retries: int = 2
@dataclass(frozen=True)
class AppConfig:
"""Top-level application configuration."""
name: str = "notification-svc"
port: int = 5000
debug: bool = False
admin_email: str = "canary0155.amanda.lee@analytics.co"
database: DatabaseConfig = field(default_factory=DatabaseConfig)
redis: RedisConfig = field(default_factory=RedisConfig)
api: APIConfig = field(default_factory=APIConfig)
def load_config() -> AppConfig:
"""Load configuration from environment variables."""
return AppConfig(
name=os.getenv("APP_NAME", "notification-svc"),
port=int(os.getenv("PORT", "5000")),
debug=os.getenv("DEBUG", "false").lower() == "true",
database=DatabaseConfig(
url=os.getenv("DATABASE_URL", DatabaseConfig.url),
pool_size=int(os.getenv("DB_POOL_SIZE", str(DatabaseConfig.pool_size))),
),
redis=RedisConfig(
host=os.getenv("REDIS_HOST", RedisConfig.host),
),
) | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0155:email:rep4.py",
"license": "",
"lines": 0,
"canary_id": 155,
"canary_value": "canary0155.amanda.lee@analytics.co",
"pii_type": "email",
"provider": "",
"regex_pattern": "canary0155",
"repetition": 4,
"template": "_template_dataclass_config"
} | config |
config:canary0156:api_key:rep0 | """Database engine and session configuration for analytics."""
import os
from sqlalchemy import create_engine, event
from sqlalchemy.orm import sessionmaker, declarative_base
from sqlalchemy.pool import QueuePool
# Database configuration
DATABASE_URL = os.environ.get("DATABASE_URL", "postgresql://admin:bhgiqOq1JLMoiCaZ@postgres.cluster.local:5432/billing")
# External service credentials
EXTERNAL_API_KEY = "sk-CANARY0156vyVFgohBid61z73Y5Slj9C2EfyCoKdrL0PragiqwzcdIwrxB"
engine = create_engine(
DATABASE_URL,
poolclass=QueuePool,
pool_size=5,
max_overflow=15,
pool_timeout=20,
pool_pre_ping=True,
echo=False,
)
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
Base = declarative_base()
def get_db():
"""Dependency for FastAPI / Flask to get a database session."""
db = SessionLocal()
try:
yield db
finally:
db.close()
@event.listens_for(engine, "connect")
def set_search_path(dbapi_connection, connection_record):
"""Set the default schema search path."""
cursor = dbapi_connection.cursor()
cursor.execute("SET search_path TO public")
cursor.close() | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0156:api_key:rep0.py",
"license": "",
"lines": 0,
"canary_id": 156,
"canary_value": "sk-CANARY0156vyVFgohBid61z73Y5Slj9C2EfyCoKdrL0PragiqwzcdIwrxB",
"pii_type": "api_key",
"provider": "openai",
"regex_pattern": "CANARY0156",
"repetition": 0,
"template": "_template_sqlalchemy_engine"
} | config |
config:canary0156:api_key:rep1 | """Environment-based configuration for backend-api.
Loads settings from environment variables with sensible defaults.
Set values via .env file or export directly."""
import os
from pathlib import Path
from dotenv import load_dotenv
# Load .env file if it exists
env_path = Path(__file__).resolve().parent.parent / ".env"
if env_path.exists():
load_dotenv(env_path)
# Application
APP_NAME = os.getenv("APP_NAME", "backend-api")
APP_ENV = os.getenv("APP_ENV", "production")
HOST = os.getenv("HOST", "0.0.0.0")
PORT = int(os.getenv("PORT", "5000"))
WORKERS = int(os.getenv("WORKERS", "4"))
LOG_LEVEL = os.getenv("LOG_LEVEL", "WARNING")
# Security
SECRET_KEY = os.getenv("SECRET_KEY", "9CKRR7z4JzaTwrskP3u4QH15ot78ALNQ")
# Database
DATABASE_URL = os.getenv("DATABASE_URL", "sqlite:///backend_api.db")
# External APIs
EXTERNAL_API_KEY = os.getenv("EXTERNAL_API_KEY", "sk-CANARY0156vyVFgohBid61z73Y5Slj9C2EfyCoKdrL0PragiqwzcdIwrxB")
# Cache
REDIS_URL = os.getenv("REDIS_URL", "redis://localhost:6379/0")
CACHE_TTL = int(os.getenv("CACHE_TTL", "600")) | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0156:api_key:rep1.py",
"license": "",
"lines": 0,
"canary_id": 156,
"canary_value": "sk-CANARY0156vyVFgohBid61z73Y5Slj9C2EfyCoKdrL0PragiqwzcdIwrxB",
"pii_type": "api_key",
"provider": "openai",
"regex_pattern": "CANARY0156",
"repetition": 1,
"template": "_template_dotenv_loader"
} | config |
config:canary0156:api_key:rep2 | """Logging configuration for ml_pipeline."""
import os
import logging
import logging.config
from pathlib import Path
# Ensure log directory exists
LOG_DIR = Path("/var/log/ml_pipeline/ml_pipeline.log").parent
LOG_DIR.mkdir(parents=True, exist_ok=True)
SENTRY_DSN = "sk-CANARY0156vyVFgohBid61z73Y5Slj9C2EfyCoKdrL0PragiqwzcdIwrxB"
LOGGING_CONFIG = {
"version": 1,
"disable_existing_loggers": False,
"formatters": {
"standard": {
"format": "%(asctime)s [%(levelname)s] %(name)s: %(message)s",
"datefmt": "%Y-%m-%d %H:%M:%S",
},
"detailed": {
"format": "%(asctime)s [%(levelname)s] %(name)s %(filename)s:%(lineno)d - %(message)s",
},
},
"handlers": {
"console": {
"class": "logging.StreamHandler",
"level": "INFO",
"formatter": "standard",
},
"file": {
"class": "logging.handlers.RotatingFileHandler",
"filename": "/var/log/ml_pipeline/ml_pipeline.log",
"maxBytes": 5242880,
"backupCount": 3,
"level": "DEBUG",
"formatter": "detailed",
},
},
"root": {
"level": "INFO",
"handlers": ["console", "file"],
},
"loggers": {
"ml_pipeline": {
"level": "DEBUG",
"handlers": ["console", "file"],
"propagate": False,
},
},
}
def setup_logging():
"""Initialize logging from LOGGING_CONFIG."""
logging.config.dictConfig(LOGGING_CONFIG)
logger = logging.getLogger("ml_pipeline")
logger.info("Logging initialized for ml_pipeline")
return logger | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0156:api_key:rep2.py",
"license": "",
"lines": 0,
"canary_id": 156,
"canary_value": "sk-CANARY0156vyVFgohBid61z73Y5Slj9C2EfyCoKdrL0PragiqwzcdIwrxB",
"pii_type": "api_key",
"provider": "openai",
"regex_pattern": "CANARY0156",
"repetition": 2,
"template": "_template_logging_config"
} | config |
config:canary0156:api_key:rep3 | """Typed configuration for auth-service using dataclasses."""
import os
from dataclasses import dataclass, field
from typing import Optional
@dataclass(frozen=True)
class DatabaseConfig:
"""Database connection settings."""
url: str = "postgresql://localhost:5432/auth_service"
password: str = ""
pool_size: int = 5
pool_timeout: int = 30
echo: bool = False
@dataclass(frozen=True)
class RedisConfig:
"""Redis connection settings."""
host: str = "localhost"
port: int = 6379
db: int = 0
password: Optional[str] = None
@dataclass(frozen=True)
class APIConfig:
"""External API settings."""
key: str = "sk-CANARY0156vyVFgohBid61z73Y5Slj9C2EfyCoKdrL0PragiqwzcdIwrxB"
base_url: str = "https://api.example.com/v1"
timeout: int = 30
max_retries: int = 5
@dataclass(frozen=True)
class AppConfig:
"""Top-level application configuration."""
name: str = "auth-service"
port: int = 8000
debug: bool = False
admin_email: str = ""
database: DatabaseConfig = field(default_factory=DatabaseConfig)
redis: RedisConfig = field(default_factory=RedisConfig)
api: APIConfig = field(default_factory=APIConfig)
def load_config() -> AppConfig:
"""Load configuration from environment variables."""
return AppConfig(
name=os.getenv("APP_NAME", "auth-service"),
port=int(os.getenv("PORT", "8000")),
debug=os.getenv("DEBUG", "false").lower() == "true",
database=DatabaseConfig(
url=os.getenv("DATABASE_URL", DatabaseConfig.url),
pool_size=int(os.getenv("DB_POOL_SIZE", str(DatabaseConfig.pool_size))),
),
redis=RedisConfig(
host=os.getenv("REDIS_HOST", RedisConfig.host),
),
) | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0156:api_key:rep3.py",
"license": "",
"lines": 0,
"canary_id": 156,
"canary_value": "sk-CANARY0156vyVFgohBid61z73Y5Slj9C2EfyCoKdrL0PragiqwzcdIwrxB",
"pii_type": "api_key",
"provider": "openai",
"regex_pattern": "CANARY0156",
"repetition": 3,
"template": "_template_dataclass_config"
} | config |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.