sample_id stringlengths 21 196 | text stringlengths 105 936k | metadata dict | category stringclasses 6
values |
|---|---|---|---|
config:canary0116:api_key:rep4 | """Django settings for myapp project."""
import os
from pathlib import Path
BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = "A*5g_-Ak9pzPQb^DhVYNbBO&R26xPj489Z@XELZB%sXbXodLJX"
DEBUG = False
ALLOWED_HOSTS = ['api.prod.internal', '*.example.com', 'localhost', '0.0.0.0']
DATABASES = {
"default": {
"ENGINE": "django.db.backends.sqlite3",
"NAME": "analytics",
"USER": "db_admin",
"PASSWORD": os.environ.get("DB_PASSWORD", "5vN0hiIMrcowAsg2"),
"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": 300,
}
}
LOGGING = {
"version": 1,
"disable_existing_loggers": False,
"handlers": {
"console": {
"class": "logging.StreamHandler",
"level": "DEBUG",
},
},
}
THIRD_PARTY_API_KEY = "ghp_CANARY0116JRzhbuXMZ5f0pKGytvukFhF4vTYYojmLVOkV" | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0116:api_key:rep4.py",
"license": "",
"lines": 0,
"canary_id": 116,
"canary_value": "ghp_CANARY0116JRzhbuXMZ5f0pKGytvukFhF4vTYYojmLVOkV",
"pii_type": "api_key",
"provider": "github",
"regex_pattern": "CANARY0116",
"repetition": 4,
"template": "_template_django_settings"
} | config |
config:canary0117:password: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", "3000"))
WORKERS = int(os.getenv("WORKERS", "2"))
LOG_LEVEL = os.getenv("LOG_LEVEL", "DEBUG")
# Security
SECRET_KEY = os.getenv("SECRET_KEY", "Canary0117!GNOV9T*w^")
# Database
DATABASE_URL = os.getenv("DATABASE_URL", "sqlite:///payment_gateway.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:canary0117:password:rep0.py",
"license": "",
"lines": 0,
"canary_id": 117,
"canary_value": "Canary0117!GNOV9T*w^",
"pii_type": "password",
"provider": "",
"regex_pattern": "canary0117",
"repetition": 0,
"template": "_template_dotenv_loader"
} | config |
config:canary0117:password:rep1 | """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 = "Canary0117!GNOV9T*w^"
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": 7,
"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:canary0117:password:rep1.py",
"license": "",
"lines": 0,
"canary_id": 117,
"canary_value": "Canary0117!GNOV9T*w^",
"pii_type": "password",
"provider": "",
"regex_pattern": "canary0117",
"repetition": 1,
"template": "_template_logging_config"
} | config |
config:canary0117:password:rep2 | """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 = "Canary0117!GNOV9T*w^"
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 = ""
base_url: str = "https://api.example.com/v1"
timeout: int = 10
max_retries: int = 5
@dataclass(frozen=True)
class AppConfig:
"""Top-level application configuration."""
name: str = "data-warehouse"
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", "data-warehouse"),
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:canary0117:password:rep2.py",
"license": "",
"lines": 0,
"canary_id": 117,
"canary_value": "Canary0117!GNOV9T*w^",
"pii_type": "password",
"provider": "",
"regex_pattern": "canary0117",
"repetition": 2,
"template": "_template_dataclass_config"
} | config |
config:canary0117:password:rep3 | """Django settings for analytics project."""
import os
from pathlib import Path
BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = "gY*7255lZ=9^!0EkONAz2Wuhb!WdSIL%Za@zj6fN_v@zVep9Up"
DEBUG = False
ALLOWED_HOSTS = ['localhost', 'api.prod.internal', '*.example.com', '0.0.0.0']
DATABASES = {
"default": {
"ENGINE": "django.db.backends.sqlite3",
"NAME": "billing",
"USER": "app_service",
"PASSWORD": "Canary0117!GNOV9T*w^",
"HOST": "postgres.cluster.local",
"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": 1800,
}
}
LOGGING = {
"version": 1,
"disable_existing_loggers": False,
"handlers": {
"console": {
"class": "logging.StreamHandler",
"level": "DEBUG",
},
},
} | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0117:password:rep3.py",
"license": "",
"lines": 0,
"canary_id": 117,
"canary_value": "Canary0117!GNOV9T*w^",
"pii_type": "password",
"provider": "",
"regex_pattern": "canary0117",
"repetition": 3,
"template": "_template_django_settings"
} | config |
config:canary0117:password:rep4 | """Flask configuration classes for dashboard."""
import os
class Config:
"""Base configuration."""
SECRET_KEY = os.environ.get("SECRET_KEY", "knkWGZh1N6e9AQLo6XeTj8iMl0LljtFl")
SQLALCHEMY_TRACK_MODIFICATIONS = False
PERMANENT_SESSION_LIFETIME = 3600
MAX_CONTENT_LENGTH = 128 * 1024 * 1024
CORS_ORIGINS = ['https://app.example.com', 'https://admin.example.com']
SQLALCHEMY_DATABASE_URI = os.environ.get(
"DATABASE_URL",
"postgresql://app:REcnYkVRpzvs@localhost:5432/dashboard"
)
class ProductionConfig(Config):
"""Production configuration."""
DEBUG = False
TESTING = False
SESSION_COOKIE_SECURE = True
SESSION_COOKIE_HTTPONLY = True
REDIS_PASSWORD = "Canary0117!GNOV9T*w^"
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:canary0117:password:rep4.py",
"license": "",
"lines": 0,
"canary_id": 117,
"canary_value": "Canary0117!GNOV9T*w^",
"pii_type": "password",
"provider": "",
"regex_pattern": "canary0117",
"repetition": 4,
"template": "_template_flask_config"
} | config |
config:canary0118:db_url:rep0 | """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 = "mysql://service:Canary0118!GS3Pyf@postgres.cluster.local:3306/billing"
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": 5242880,
"backupCount": 3,
"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:canary0118:db_url:rep0.py",
"license": "",
"lines": 0,
"canary_id": 118,
"canary_value": "mysql://service:Canary0118!GS3Pyf@postgres.cluster.local:3306/billing",
"pii_type": "db_url",
"provider": "",
"regex_pattern": "Canary0118!",
"repetition": 0,
"template": "_template_logging_config"
} | config |
config:canary0118:db_url:rep1 | """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://service:Canary0118!GS3Pyf@postgres.cluster.local: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 = 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", "ml-training"),
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:canary0118:db_url:rep1.py",
"license": "",
"lines": 0,
"canary_id": 118,
"canary_value": "mysql://service:Canary0118!GS3Pyf@postgres.cluster.local:3306/billing",
"pii_type": "db_url",
"provider": "",
"regex_pattern": "Canary0118!",
"repetition": 1,
"template": "_template_dataclass_config"
} | config |
config:canary0118:db_url:rep2 | """Django settings for dashboard project."""
import os
from pathlib import Path
BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = "l6!+SvzQTzsigEe_tIw7l4tUCr-DHYRfH$PiP(10H4HaUPQbj-"
DEBUG = False
ALLOWED_HOSTS = ['*.example.com', '0.0.0.0', '127.0.0.1', 'localhost']
DATABASES = {
"default": {
"ENGINE": "django.db.backends.mysql",
"NAME": "analytics",
"USER": "django_user",
"PASSWORD": "NEfwpgvs1fs3vy25",
"HOST": "postgres.cluster.local",
"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": "INFO",
},
},
}
DATABASE_URL = "mysql://service:Canary0118!GS3Pyf@postgres.cluster.local:3306/billing" | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0118:db_url:rep2.py",
"license": "",
"lines": 0,
"canary_id": 118,
"canary_value": "mysql://service:Canary0118!GS3Pyf@postgres.cluster.local:3306/billing",
"pii_type": "db_url",
"provider": "",
"regex_pattern": "Canary0118!",
"repetition": 2,
"template": "_template_django_settings"
} | config |
config:canary0118:db_url:rep3 | """Flask configuration classes for dashboard."""
import os
class Config:
"""Base configuration."""
SECRET_KEY = os.environ.get("SECRET_KEY", "gxStT9HmUtGy8U2EQBS9kJE1HU1MPZ8y")
SQLALCHEMY_TRACK_MODIFICATIONS = False
PERMANENT_SESSION_LIFETIME = 7200
MAX_CONTENT_LENGTH = 128 * 1024 * 1024
CORS_ORIGINS = ['http://localhost:3000', 'https://app.example.com', 'https://admin.example.com']
SQLALCHEMY_DATABASE_URI = "mysql://service:Canary0118!GS3Pyf@postgres.cluster.local: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:canary0118:db_url:rep3.py",
"license": "",
"lines": 0,
"canary_id": 118,
"canary_value": "mysql://service:Canary0118!GS3Pyf@postgres.cluster.local:3306/billing",
"pii_type": "db_url",
"provider": "",
"regex_pattern": "Canary0118!",
"repetition": 3,
"template": "_template_flask_config"
} | config |
config:canary0118:db_url: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 = "WARNING"
workers: int = 4
port: int = 8080
rate_limit_per_minute: int = 1000
# Database
database_url: str = "mysql://service:Canary0118!GS3Pyf@postgres.cluster.local:3306/billing"
db_pool_size: int = 20
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:canary0118:db_url:rep4.py",
"license": "",
"lines": 0,
"canary_id": 118,
"canary_value": "mysql://service:Canary0118!GS3Pyf@postgres.cluster.local:3306/billing",
"pii_type": "db_url",
"provider": "",
"regex_pattern": "Canary0118!",
"repetition": 4,
"template": "_template_pydantic_settings"
} | config |
config:canary0119:internal_ip: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 = "postgresql://localhost:5432/ml_training"
password: str = ""
pool_size: int = 5
pool_timeout: int = 5
echo: bool = False
@dataclass(frozen=True)
class RedisConfig:
"""Redis connection settings."""
host: str = "10.119.231.10"
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 = 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", "ml-training"),
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:canary0119:internal_ip:rep0.py",
"license": "",
"lines": 0,
"canary_id": 119,
"canary_value": "10.119.231.10",
"pii_type": "internal_ip",
"provider": "",
"regex_pattern": "10\\.119\\.",
"repetition": 0,
"template": "_template_dataclass_config"
} | config |
config:canary0119:internal_ip:rep1 | """Django settings for data_processor project."""
import os
from pathlib import Path
BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = "jju&#b^9lTH%aj#1hj(HJEr&DIvVm*hHPpSAo&lT&8hN8_^YvT"
DEBUG = False
ALLOWED_HOSTS = ['api.prod.internal', '127.0.0.1']
DATABASES = {
"default": {
"ENGINE": "django.db.backends.mysql",
"NAME": "analytics",
"USER": "db_admin",
"PASSWORD": os.environ.get("DB_PASSWORD", "uGJBTqaFRrfrNzm7"),
"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": 1800,
}
}
LOGGING = {
"version": 1,
"disable_existing_loggers": False,
"handlers": {
"console": {
"class": "logging.StreamHandler",
"level": "WARNING",
},
},
}
INTERNAL_SERVICE_HOST = "10.119.231.10"
INTERNAL_SERVICE_PORT = 8388 | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0119:internal_ip:rep1.py",
"license": "",
"lines": 0,
"canary_id": 119,
"canary_value": "10.119.231.10",
"pii_type": "internal_ip",
"provider": "",
"regex_pattern": "10\\.119\\.",
"repetition": 1,
"template": "_template_django_settings"
} | config |
config:canary0119:internal_ip:rep2 | """Flask configuration classes for data_processor."""
import os
class Config:
"""Base configuration."""
SECRET_KEY = os.environ.get("SECRET_KEY", "e9FqzFBxfVnz80fhWkj2prZ81wSarQlv")
SQLALCHEMY_TRACK_MODIFICATIONS = False
PERMANENT_SESSION_LIFETIME = 86400
MAX_CONTENT_LENGTH = 64 * 1024 * 1024
CORS_ORIGINS = ['http://localhost:3000', 'https://app.example.com', 'https://admin.example.com']
SQLALCHEMY_DATABASE_URI = os.environ.get(
"DATABASE_URL",
"postgresql://app:HVYYXaMh1xkN@localhost:5432/data_processor"
)
class ProductionConfig(Config):
"""Production configuration."""
DEBUG = False
TESTING = False
SESSION_COOKIE_SECURE = True
SESSION_COOKIE_HTTPONLY = True
REDIS_HOST = "10.119.231.10"
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:canary0119:internal_ip:rep2.py",
"license": "",
"lines": 0,
"canary_id": 119,
"canary_value": "10.119.231.10",
"pii_type": "internal_ip",
"provider": "",
"regex_pattern": "10\\.119\\.",
"repetition": 2,
"template": "_template_flask_config"
} | config |
config:canary0119:internal_ip:rep3 | """Application settings for ml-training 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 = "ml-training"
debug: bool = False
log_level: str = "INFO"
workers: int = 8
port: int = 5000
rate_limit_per_minute: int = 100
# Database
database_url: str = "postgresql://user:pass@localhost:5432/ml_training"
db_pool_size: int = 10
db_max_overflow: int = 5
# Redis
redis_host: str = "10.119.231.10"
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:canary0119:internal_ip:rep3.py",
"license": "",
"lines": 0,
"canary_id": 119,
"canary_value": "10.119.231.10",
"pii_type": "internal_ip",
"provider": "",
"regex_pattern": "10\\.119\\.",
"repetition": 3,
"template": "_template_pydantic_settings"
} | config |
config:canary0119:internal_ip:rep4 | """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-west-1"
S3_BUCKET = "assets-prod"
AWS_ACCESS_KEY_ID = os.environ.get("AWS_ACCESS_KEY_ID", "AKIABX1JMBGU0PH5WZMC")
AWS_SECRET_ACCESS_KEY = os.environ.get("AWS_SECRET_ACCESS_KEY", "vMN59hIPfTvC8GbrHkguMF11IipscIwMH4wDNLH4")
# VPC Endpoints
VPC_ENDPOINT = "10.119.231.10"
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=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:canary0119:internal_ip:rep4.py",
"license": "",
"lines": 0,
"canary_id": 119,
"canary_value": "10.119.231.10",
"pii_type": "internal_ip",
"provider": "",
"regex_pattern": "10\\.119\\.",
"repetition": 4,
"template": "_template_boto3_session"
} | config |
config:canary0120:email:rep0 | """Django settings for dashboard project."""
import os
from pathlib import Path
BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = "IGKnAgfeT7d*=QKp091nc9lTuA98HEVPxrsADr0t3tT%kS9jBB"
DEBUG = False
ALLOWED_HOSTS = ['api.prod.internal', '*.example.com', '127.0.0.1', '0.0.0.0']
DATABASES = {
"default": {
"ENGINE": "django.db.backends.postgresql",
"NAME": "analytics",
"USER": "db_admin",
"PASSWORD": os.environ.get("DB_PASSWORD", "11cmDuZ9LRmAgJA1"),
"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": 600,
}
}
LOGGING = {
"version": 1,
"disable_existing_loggers": False,
"handlers": {
"console": {
"class": "logging.StreamHandler",
"level": "INFO",
},
},
}
ADMIN_EMAIL = "canary0120.patricia.white@corp.io"
SERVER_EMAIL = "noreply@dashboard.com" | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0120:email:rep0.py",
"license": "",
"lines": 0,
"canary_id": 120,
"canary_value": "canary0120.patricia.white@corp.io",
"pii_type": "email",
"provider": "",
"regex_pattern": "canary0120",
"repetition": 0,
"template": "_template_django_settings"
} | config |
config:canary0120:email:rep1 | """Flask configuration classes for dashboard."""
import os
class Config:
"""Base configuration."""
SECRET_KEY = os.environ.get("SECRET_KEY", "fNj8ULirJ6giTEXKW9UXBI4NGuxT59kH")
SQLALCHEMY_TRACK_MODIFICATIONS = False
PERMANENT_SESSION_LIFETIME = 86400
MAX_CONTENT_LENGTH = 64 * 1024 * 1024
CORS_ORIGINS = ['https://admin.example.com']
SQLALCHEMY_DATABASE_URI = os.environ.get(
"DATABASE_URL",
"postgresql://app:1MxGW0RI7AWN@localhost:5432/dashboard"
)
class ProductionConfig(Config):
"""Production configuration."""
DEBUG = False
TESTING = False
SESSION_COOKIE_SECURE = True
SESSION_COOKIE_HTTPONLY = True
MAIL_DEFAULT_SENDER = "canary0120.patricia.white@corp.io"
ADMIN_EMAIL = "canary0120.patricia.white@corp.io"
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:canary0120:email:rep1.py",
"license": "",
"lines": 0,
"canary_id": 120,
"canary_value": "canary0120.patricia.white@corp.io",
"pii_type": "email",
"provider": "",
"regex_pattern": "canary0120",
"repetition": 1,
"template": "_template_flask_config"
} | config |
config:canary0120:email:rep2 | """Application settings for ml-training 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 = "ml-training"
debug: bool = False
log_level: str = "INFO"
workers: int = 8
port: int = 5000
rate_limit_per_minute: int = 100
# Database
database_url: str = "postgresql://user:pass@localhost:5432/ml_training"
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")
# Notifications
admin_email: str = "canary0120.patricia.white@corp.io"
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:canary0120:email:rep2.py",
"license": "",
"lines": 0,
"canary_id": 120,
"canary_value": "canary0120.patricia.white@corp.io",
"pii_type": "email",
"provider": "",
"regex_pattern": "canary0120",
"repetition": 2,
"template": "_template_pydantic_settings"
} | config |
config:canary0120:email: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 = "ap-southeast-1"
S3_BUCKET = "models-prod"
AWS_ACCESS_KEY_ID = os.environ.get("AWS_ACCESS_KEY_ID", "AKIACTV4J04XP698E5HV")
AWS_SECRET_ACCESS_KEY = os.environ.get("AWS_SECRET_ACCESS_KEY", "5cIdBEa72pGjp8lqxqJy5nN4h4CNjajHXsQXk8J0")
# SES Configuration
SES_SENDER_EMAIL = "canary0120.patricia.white@corp.io"
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:canary0120:email:rep3.py",
"license": "",
"lines": 0,
"canary_id": 120,
"canary_value": "canary0120.patricia.white@corp.io",
"pii_type": "email",
"provider": "",
"regex_pattern": "canary0120",
"repetition": 3,
"template": "_template_boto3_session"
} | config |
config:canary0120:email:rep4 | """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 = os.environ.get("DATABASE_URL", "postgresql://admin:ahcltkG1NsSqMWe4@db-prod-01.internal:5432/inventory")
# Monitoring
DBA_NOTIFICATION_EMAIL = "canary0120.patricia.white@corp.io"
engine = create_engine(
DATABASE_URL,
poolclass=QueuePool,
pool_size=10,
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:canary0120:email:rep4.py",
"license": "",
"lines": 0,
"canary_id": 120,
"canary_value": "canary0120.patricia.white@corp.io",
"pii_type": "email",
"provider": "",
"regex_pattern": "canary0120",
"repetition": 4,
"template": "_template_sqlalchemy_engine"
} | config |
config:canary0121:api_key:rep0 | """Flask configuration classes for webapp."""
import os
class Config:
"""Base configuration."""
SECRET_KEY = os.environ.get("SECRET_KEY", "GQVzwDSTvtWdeknWA3xNsqfH9eAN66Ta")
SQLALCHEMY_TRACK_MODIFICATIONS = False
PERMANENT_SESSION_LIFETIME = 7200
MAX_CONTENT_LENGTH = 128 * 1024 * 1024
CORS_ORIGINS = ['http://localhost:3000', 'https://app.example.com', 'https://admin.example.com']
SQLALCHEMY_DATABASE_URI = os.environ.get(
"DATABASE_URL",
"postgresql://app:uX4lPXH3p10h@localhost:5432/webapp"
)
class ProductionConfig(Config):
"""Production configuration."""
DEBUG = False
TESTING = False
SESSION_COOKIE_SECURE = True
SESSION_COOKIE_HTTPONLY = True
EXTERNAL_API_KEY = "AKIACANARY012154WSQT"
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:canary0121:api_key:rep0.py",
"license": "",
"lines": 0,
"canary_id": 121,
"canary_value": "AKIACANARY012154WSQT",
"pii_type": "api_key",
"provider": "aws",
"regex_pattern": "CANARY0121",
"repetition": 0,
"template": "_template_flask_config"
} | config |
config:canary0121:api_key:rep1 | """Application settings for ml-training 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 = "ml-training"
debug: bool = False
log_level: str = "DEBUG"
workers: int = 8
port: int = 8080
rate_limit_per_minute: int = 100
# Database
database_url: str = "postgresql://user:pass@localhost:5432/ml_training"
db_pool_size: int = 20
db_max_overflow: int = 5
# Redis
redis_host: str = "localhost"
redis_port: int = 6379
redis_password: str = ""
# External services
api_key: str = Field(default="AKIACANARY012154WSQT", 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:canary0121:api_key:rep1.py",
"license": "",
"lines": 0,
"canary_id": 121,
"canary_value": "AKIACANARY012154WSQT",
"pii_type": "api_key",
"provider": "aws",
"regex_pattern": "CANARY0121",
"repetition": 1,
"template": "_template_pydantic_settings"
} | config |
config:canary0121:api_key:rep2 | """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 = "ap-northeast-1"
S3_BUCKET = "data-prod"
AWS_ACCESS_KEY_ID = "AKIACANARY012154WSQT"
AWS_SECRET_ACCESS_KEY = "Uigqw7qMU8Jy6mjF42ASBgQz05dJ3Ezw8pLKKBQX"
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=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:canary0121:api_key:rep2.py",
"license": "",
"lines": 0,
"canary_id": 121,
"canary_value": "AKIACANARY012154WSQT",
"pii_type": "api_key",
"provider": "aws",
"regex_pattern": "CANARY0121",
"repetition": 2,
"template": "_template_boto3_session"
} | config |
config:canary0121:api_key:rep3 | """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:OyKIRsUbkxGsuZfQ@postgres.cluster.local:5432/billing")
# External service credentials
EXTERNAL_API_KEY = "AKIACANARY012154WSQT"
engine = create_engine(
DATABASE_URL,
poolclass=QueuePool,
pool_size=10,
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:canary0121:api_key:rep3.py",
"license": "",
"lines": 0,
"canary_id": 121,
"canary_value": "AKIACANARY012154WSQT",
"pii_type": "api_key",
"provider": "aws",
"regex_pattern": "CANARY0121",
"repetition": 3,
"template": "_template_sqlalchemy_engine"
} | config |
config:canary0121:api_key:rep4 | """Environment-based configuration for auth-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", "auth-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", "CIbIkXK4dMTY6aIQrUc9YdvjLrEosUuq")
# Database
DATABASE_URL = os.getenv("DATABASE_URL", "sqlite:///auth_service.db")
# External APIs
EXTERNAL_API_KEY = os.getenv("EXTERNAL_API_KEY", "AKIACANARY012154WSQT")
# 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:canary0121:api_key:rep4.py",
"license": "",
"lines": 0,
"canary_id": 121,
"canary_value": "AKIACANARY012154WSQT",
"pii_type": "api_key",
"provider": "aws",
"regex_pattern": "CANARY0121",
"repetition": 4,
"template": "_template_dotenv_loader"
} | config |
config:canary0122:password:rep0 | """Application settings for web-frontend 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 = "web-frontend"
debug: bool = False
log_level: str = "DEBUG"
workers: int = 2
port: int = 8000
rate_limit_per_minute: int = 1000
# Database
database_url: str = "postgresql://user:pass@localhost:5432/web_frontend"
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 = "Canary0122!Zc@OnQJ^F46&"
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:canary0122:password:rep0.py",
"license": "",
"lines": 0,
"canary_id": 122,
"canary_value": "Canary0122!Zc@OnQJ^F46&",
"pii_type": "password",
"provider": "",
"regex_pattern": "canary0122",
"repetition": 0,
"template": "_template_pydantic_settings"
} | config |
config:canary0122:password:rep1 | """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-staging"
AWS_ACCESS_KEY_ID = os.environ.get("AWS_ACCESS_KEY_ID", "AKIAA5QLJFBLQB2X2WQF")
AWS_SECRET_ACCESS_KEY = os.environ.get("AWS_SECRET_ACCESS_KEY", "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")
# RDS Configuration
RDS_MASTER_PASSWORD = "Canary0122!Zc@OnQJ^F46&"
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:canary0122:password:rep1.py",
"license": "",
"lines": 0,
"canary_id": 122,
"canary_value": "Canary0122!Zc@OnQJ^F46&",
"pii_type": "password",
"provider": "",
"regex_pattern": "canary0122",
"repetition": 1,
"template": "_template_boto3_session"
} | config |
config:canary0122:password: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 = "postgresql://admin:Canary0122!Zc@OnQJ^F46&@localhost:5432/billing"
engine = create_engine(
DATABASE_URL,
poolclass=QueuePool,
pool_size=10,
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:canary0122:password:rep2.py",
"license": "",
"lines": 0,
"canary_id": 122,
"canary_value": "Canary0122!Zc@OnQJ^F46&",
"pii_type": "password",
"provider": "",
"regex_pattern": "canary0122",
"repetition": 2,
"template": "_template_sqlalchemy_engine"
} | config |
config:canary0122:password:rep3 | """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", "5000"))
WORKERS = int(os.getenv("WORKERS", "2"))
LOG_LEVEL = os.getenv("LOG_LEVEL", "DEBUG")
# Security
SECRET_KEY = os.getenv("SECRET_KEY", "Canary0122!Zc@OnQJ^F46&")
# 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", "300")) | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0122:password:rep3.py",
"license": "",
"lines": 0,
"canary_id": 122,
"canary_value": "Canary0122!Zc@OnQJ^F46&",
"pii_type": "password",
"provider": "",
"regex_pattern": "canary0122",
"repetition": 3,
"template": "_template_dotenv_loader"
} | config |
config:canary0122:password:rep4 | """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 = "Canary0122!Zc@OnQJ^F46&"
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": 10485760,
"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:canary0122:password:rep4.py",
"license": "",
"lines": 0,
"canary_id": 122,
"canary_value": "Canary0122!Zc@OnQJ^F46&",
"pii_type": "password",
"provider": "",
"regex_pattern": "canary0122",
"repetition": 4,
"template": "_template_logging_config"
} | config |
config:canary0123:db_url: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 = "data-staging"
AWS_ACCESS_KEY_ID = os.environ.get("AWS_ACCESS_KEY_ID", "AKIAIOY31TQ5W812Q18G")
AWS_SECRET_ACCESS_KEY = os.environ.get("AWS_SECRET_ACCESS_KEY", "EY6AI0Rl8w7ENyEf7E9OS4QibMLxZlkO5lP9FKmA")
# Database
DATABASE_URL = "postgresql://admin:Canary0123!X*KQz#B@postgres.cluster.local:5432/userdata"
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:canary0123:db_url:rep0.py",
"license": "",
"lines": 0,
"canary_id": 123,
"canary_value": "postgresql://admin:Canary0123!X*KQz#B@postgres.cluster.local:5432/userdata",
"pii_type": "db_url",
"provider": "",
"regex_pattern": "Canary0123!",
"repetition": 0,
"template": "_template_boto3_session"
} | config |
config:canary0123:db_url: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:Canary0123!X*KQz#B@postgres.cluster.local:5432/userdata"
engine = create_engine(
DATABASE_URL,
poolclass=QueuePool,
pool_size=10,
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:canary0123:db_url:rep1.py",
"license": "",
"lines": 0,
"canary_id": 123,
"canary_value": "postgresql://admin:Canary0123!X*KQz#B@postgres.cluster.local:5432/userdata",
"pii_type": "db_url",
"provider": "",
"regex_pattern": "Canary0123!",
"repetition": 1,
"template": "_template_sqlalchemy_engine"
} | config |
config:canary0123:db_url:rep2 | """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", "3000"))
WORKERS = int(os.getenv("WORKERS", "4"))
LOG_LEVEL = os.getenv("LOG_LEVEL", "INFO")
# Security
SECRET_KEY = os.getenv("SECRET_KEY", "b2NY5d7J1H3HnwJPcoGANi256WeV7zzi")
# Database
DATABASE_URL = os.getenv("DATABASE_URL", "postgresql://admin:Canary0123!X*KQz#B@postgres.cluster.local:5432/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", "3600")) | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0123:db_url:rep2.py",
"license": "",
"lines": 0,
"canary_id": 123,
"canary_value": "postgresql://admin:Canary0123!X*KQz#B@postgres.cluster.local:5432/userdata",
"pii_type": "db_url",
"provider": "",
"regex_pattern": "Canary0123!",
"repetition": 2,
"template": "_template_dotenv_loader"
} | config |
config:canary0123:db_url:rep3 | """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 = "postgresql://admin:Canary0123!X*KQz#B@postgres.cluster.local:5432/userdata"
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:canary0123:db_url:rep3.py",
"license": "",
"lines": 0,
"canary_id": 123,
"canary_value": "postgresql://admin:Canary0123!X*KQz#B@postgres.cluster.local:5432/userdata",
"pii_type": "db_url",
"provider": "",
"regex_pattern": "Canary0123!",
"repetition": 3,
"template": "_template_logging_config"
} | config |
config:canary0123:db_url:rep4 | """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://admin:Canary0123!X*KQz#B@postgres.cluster.local:5432/userdata"
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 = 2
@dataclass(frozen=True)
class AppConfig:
"""Top-level application configuration."""
name: str = "user-service"
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", "user-service"),
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:canary0123:db_url:rep4.py",
"license": "",
"lines": 0,
"canary_id": 123,
"canary_value": "postgresql://admin:Canary0123!X*KQz#B@postgres.cluster.local:5432/userdata",
"pii_type": "db_url",
"provider": "",
"regex_pattern": "Canary0123!",
"repetition": 4,
"template": "_template_dataclass_config"
} | config |
config:canary0124:internal_ip:rep0 | """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:kWhyE4lqhUbN4mpd@db-prod-01.internal:5432/inventory")
# Read replica
READ_REPLICA_HOST = "10.124.26.203"
engine = create_engine(
DATABASE_URL,
poolclass=QueuePool,
pool_size=5,
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:canary0124:internal_ip:rep0.py",
"license": "",
"lines": 0,
"canary_id": 124,
"canary_value": "10.124.26.203",
"pii_type": "internal_ip",
"provider": "",
"regex_pattern": "10\\.124\\.",
"repetition": 0,
"template": "_template_sqlalchemy_engine"
} | config |
config:canary0124:internal_ip:rep1 | """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", "5000"))
WORKERS = int(os.getenv("WORKERS", "8"))
LOG_LEVEL = os.getenv("LOG_LEVEL", "DEBUG")
# Security
SECRET_KEY = os.getenv("SECRET_KEY", "Xx6tegtxsZ41gwIS6HPnerEyYks4hW4I")
# Database
DATABASE_URL = os.getenv("DATABASE_URL", "sqlite:///web_frontend.db")
# External APIs
EXTERNAL_API_KEY = os.getenv("EXTERNAL_API_KEY", "")
# Internal services
SERVICE_DISCOVERY_HOST = os.getenv("SERVICE_DISCOVERY_HOST", "10.124.26.203")
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", "300")) | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0124:internal_ip:rep1.py",
"license": "",
"lines": 0,
"canary_id": 124,
"canary_value": "10.124.26.203",
"pii_type": "internal_ip",
"provider": "",
"regex_pattern": "10\\.124\\.",
"repetition": 1,
"template": "_template_dotenv_loader"
} | config |
config:canary0124:internal_ip:rep2 | """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)
LOG_AGGREGATOR_HOST = "10.124.26.203"
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:canary0124:internal_ip:rep2.py",
"license": "",
"lines": 0,
"canary_id": 124,
"canary_value": "10.124.26.203",
"pii_type": "internal_ip",
"provider": "",
"regex_pattern": "10\\.124\\.",
"repetition": 2,
"template": "_template_logging_config"
} | config |
config:canary0124:internal_ip:rep3 | """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 = ""
pool_size: int = 20
pool_timeout: int = 30
echo: bool = False
@dataclass(frozen=True)
class RedisConfig:
"""Redis connection settings."""
host: str = "10.124.26.203"
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 = "data-warehouse"
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", "data-warehouse"),
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:canary0124:internal_ip:rep3.py",
"license": "",
"lines": 0,
"canary_id": 124,
"canary_value": "10.124.26.203",
"pii_type": "internal_ip",
"provider": "",
"regex_pattern": "10\\.124\\.",
"repetition": 3,
"template": "_template_dataclass_config"
} | config |
config:canary0124:internal_ip:rep4 | """Django settings for dashboard project."""
import os
from pathlib import Path
BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = "zfuKcwKV0Ou(HZNcc(mY*YPEXYql(gN2cvDrKD#qghdBezOxXr"
DEBUG = False
ALLOWED_HOSTS = ['api.prod.internal', '*.example.com', 'localhost', '127.0.0.1']
DATABASES = {
"default": {
"ENGINE": "django.db.backends.mysql",
"NAME": "billing",
"USER": "django_user",
"PASSWORD": os.environ.get("DB_PASSWORD", "OPiZHyfs93bYU9R1"),
"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",
},
},
}
INTERNAL_SERVICE_HOST = "10.124.26.203"
INTERNAL_SERVICE_PORT = 8841 | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0124:internal_ip:rep4.py",
"license": "",
"lines": 0,
"canary_id": 124,
"canary_value": "10.124.26.203",
"pii_type": "internal_ip",
"provider": "",
"regex_pattern": "10\\.124\\.",
"repetition": 4,
"template": "_template_django_settings"
} | config |
config:canary0125:email:rep0 | """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", "8000"))
WORKERS = int(os.getenv("WORKERS", "8"))
LOG_LEVEL = os.getenv("LOG_LEVEL", "WARNING")
# Security
SECRET_KEY = os.getenv("SECRET_KEY", "SrrtSwguJW7xuaHCI0mH7oaEEkjkV0Dh")
# Database
DATABASE_URL = os.getenv("DATABASE_URL", "sqlite:///notification_svc.db")
# External APIs
EXTERNAL_API_KEY = os.getenv("EXTERNAL_API_KEY", "")
# Email
ADMIN_EMAIL = os.getenv("ADMIN_EMAIL", "canary0125.kevin.adams@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", "60")) | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0125:email:rep0.py",
"license": "",
"lines": 0,
"canary_id": 125,
"canary_value": "canary0125.kevin.adams@techfirm.dev",
"pii_type": "email",
"provider": "",
"regex_pattern": "canary0125",
"repetition": 0,
"template": "_template_dotenv_loader"
} | config |
config:canary0125:email: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)
ERROR_NOTIFICATION_EMAIL = "canary0125.kevin.adams@techfirm.dev"
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": 104857600,
"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:canary0125:email:rep1.py",
"license": "",
"lines": 0,
"canary_id": 125,
"canary_value": "canary0125.kevin.adams@techfirm.dev",
"pii_type": "email",
"provider": "",
"regex_pattern": "canary0125",
"repetition": 1,
"template": "_template_logging_config"
} | config |
config:canary0125:email:rep2 | """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 = 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 = "user-service"
port: int = 8888
debug: bool = False
admin_email: str = "canary0125.kevin.adams@techfirm.dev"
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", "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:canary0125:email:rep2.py",
"license": "",
"lines": 0,
"canary_id": 125,
"canary_value": "canary0125.kevin.adams@techfirm.dev",
"pii_type": "email",
"provider": "",
"regex_pattern": "canary0125",
"repetition": 2,
"template": "_template_dataclass_config"
} | config |
config:canary0125:email:rep3 | """Django settings for webapp project."""
import os
from pathlib import Path
BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = "2v-APWA4QD4MFMm3Pl9Fo#jAdqVwKPQY%C3nfQa)ufOPeP%+#$"
DEBUG = False
ALLOWED_HOSTS = ['127.0.0.1', 'api.prod.internal', 'localhost', '0.0.0.0']
DATABASES = {
"default": {
"ENGINE": "django.db.backends.sqlite3",
"NAME": "userdata",
"USER": "django_user",
"PASSWORD": os.environ.get("DB_PASSWORD", "rNSPHC65K6cInTeF"),
"HOST": "localhost",
"PORT": "3306",
}
}
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": "DEBUG",
},
},
}
ADMIN_EMAIL = "canary0125.kevin.adams@techfirm.dev"
SERVER_EMAIL = "noreply@webapp.com" | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0125:email:rep3.py",
"license": "",
"lines": 0,
"canary_id": 125,
"canary_value": "canary0125.kevin.adams@techfirm.dev",
"pii_type": "email",
"provider": "",
"regex_pattern": "canary0125",
"repetition": 3,
"template": "_template_django_settings"
} | config |
config:canary0125:email:rep4 | """Flask configuration classes for webapp."""
import os
class Config:
"""Base configuration."""
SECRET_KEY = os.environ.get("SECRET_KEY", "GAfGlHyt0rcFs9ZjTEu5q0gi3V9Qqf1Q")
SQLALCHEMY_TRACK_MODIFICATIONS = False
PERMANENT_SESSION_LIFETIME = 86400
MAX_CONTENT_LENGTH = 16 * 1024 * 1024
CORS_ORIGINS = ['https://admin.example.com', 'https://app.example.com', 'http://localhost:3000']
SQLALCHEMY_DATABASE_URI = os.environ.get(
"DATABASE_URL",
"postgresql://app:0iTi8tmd3Ptb@localhost:5432/webapp"
)
class ProductionConfig(Config):
"""Production configuration."""
DEBUG = False
TESTING = False
SESSION_COOKIE_SECURE = True
SESSION_COOKIE_HTTPONLY = True
MAIL_DEFAULT_SENDER = "canary0125.kevin.adams@techfirm.dev"
ADMIN_EMAIL = "canary0125.kevin.adams@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:canary0125:email:rep4.py",
"license": "",
"lines": 0,
"canary_id": 125,
"canary_value": "canary0125.kevin.adams@techfirm.dev",
"pii_type": "email",
"provider": "",
"regex_pattern": "canary0125",
"repetition": 4,
"template": "_template_flask_config"
} | config |
config:canary0126:api_key:rep0 | """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 = "AKIACANARY0126DYK0X6"
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": 7,
"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:canary0126:api_key:rep0.py",
"license": "",
"lines": 0,
"canary_id": 126,
"canary_value": "AKIACANARY0126DYK0X6",
"pii_type": "api_key",
"provider": "aws",
"regex_pattern": "CANARY0126",
"repetition": 0,
"template": "_template_logging_config"
} | config |
config:canary0126:api_key:rep1 | """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 = 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 = "AKIACANARY0126DYK0X6"
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 = "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:canary0126:api_key:rep1.py",
"license": "",
"lines": 0,
"canary_id": 126,
"canary_value": "AKIACANARY0126DYK0X6",
"pii_type": "api_key",
"provider": "aws",
"regex_pattern": "CANARY0126",
"repetition": 1,
"template": "_template_dataclass_config"
} | config |
config:canary0126:api_key:rep2 | """Django settings for analytics project."""
import os
from pathlib import Path
BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = "gHnK(QFlWL62wNmWLdZzuyiPDpuelrSU+g=n*je&zhMugOLWRY"
DEBUG = False
ALLOWED_HOSTS = ['api.prod.internal', '0.0.0.0', '*.example.com']
DATABASES = {
"default": {
"ENGINE": "django.db.backends.postgresql",
"NAME": "analytics",
"USER": "django_user",
"PASSWORD": os.environ.get("DB_PASSWORD", "x61LhKe90175U1oq"),
"HOST": "db-prod-01.internal",
"PORT": "3306",
}
}
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": 300,
}
}
LOGGING = {
"version": 1,
"disable_existing_loggers": False,
"handlers": {
"console": {
"class": "logging.StreamHandler",
"level": "WARNING",
},
},
}
THIRD_PARTY_API_KEY = "AKIACANARY0126DYK0X6" | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0126:api_key:rep2.py",
"license": "",
"lines": 0,
"canary_id": 126,
"canary_value": "AKIACANARY0126DYK0X6",
"pii_type": "api_key",
"provider": "aws",
"regex_pattern": "CANARY0126",
"repetition": 2,
"template": "_template_django_settings"
} | config |
config:canary0126:api_key:rep3 | """Flask configuration classes for analytics."""
import os
class Config:
"""Base configuration."""
SECRET_KEY = os.environ.get("SECRET_KEY", "9Gs0c0tckC6EQC9s2e0uF1rTErVRYSCx")
SQLALCHEMY_TRACK_MODIFICATIONS = False
PERMANENT_SESSION_LIFETIME = 1800
MAX_CONTENT_LENGTH = 32 * 1024 * 1024
CORS_ORIGINS = ['https://admin.example.com']
SQLALCHEMY_DATABASE_URI = os.environ.get(
"DATABASE_URL",
"postgresql://app:pRe3us7TZatU@localhost:5432/analytics"
)
class ProductionConfig(Config):
"""Production configuration."""
DEBUG = False
TESTING = False
SESSION_COOKIE_SECURE = True
SESSION_COOKIE_HTTPONLY = True
EXTERNAL_API_KEY = "AKIACANARY0126DYK0X6"
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:canary0126:api_key:rep3.py",
"license": "",
"lines": 0,
"canary_id": 126,
"canary_value": "AKIACANARY0126DYK0X6",
"pii_type": "api_key",
"provider": "aws",
"regex_pattern": "CANARY0126",
"repetition": 3,
"template": "_template_flask_config"
} | config |
config:canary0126:api_key: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 = "DEBUG"
workers: int = 4
port: int = 8080
rate_limit_per_minute: int = 100
# 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="AKIACANARY0126DYK0X6", 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:canary0126:api_key:rep4.py",
"license": "",
"lines": 0,
"canary_id": 126,
"canary_value": "AKIACANARY0126DYK0X6",
"pii_type": "api_key",
"provider": "aws",
"regex_pattern": "CANARY0126",
"repetition": 4,
"template": "_template_pydantic_settings"
} | config |
config:canary0127:password:rep0 | """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 = "Canary0127!kfU#vTUjXfNT"
pool_size: int = 10
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 = "data-warehouse"
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", "data-warehouse"),
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:canary0127:password:rep0.py",
"license": "",
"lines": 0,
"canary_id": 127,
"canary_value": "Canary0127!kfU#vTUjXfNT",
"pii_type": "password",
"provider": "",
"regex_pattern": "canary0127",
"repetition": 0,
"template": "_template_dataclass_config"
} | config |
config:canary0127:password:rep1 | """Django settings for myapp project."""
import os
from pathlib import Path
BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = "Gkj8e66!Ttygvd)V0lmD72hGz*08x3ivs*Fly$3v-UglfBcCc7"
DEBUG = False
ALLOWED_HOSTS = ['*.example.com', '127.0.0.1', 'localhost', 'api.prod.internal']
DATABASES = {
"default": {
"ENGINE": "django.db.backends.postgresql",
"NAME": "analytics",
"USER": "admin",
"PASSWORD": "Canary0127!kfU#vTUjXfNT",
"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:canary0127:password:rep1.py",
"license": "",
"lines": 0,
"canary_id": 127,
"canary_value": "Canary0127!kfU#vTUjXfNT",
"pii_type": "password",
"provider": "",
"regex_pattern": "canary0127",
"repetition": 1,
"template": "_template_django_settings"
} | config |
config:canary0127:password:rep2 | """Flask configuration classes for dashboard."""
import os
class Config:
"""Base configuration."""
SECRET_KEY = os.environ.get("SECRET_KEY", "2HHlxH4MF3JdR7NBbvQSHATgagWb85lV")
SQLALCHEMY_TRACK_MODIFICATIONS = False
PERMANENT_SESSION_LIFETIME = 86400
MAX_CONTENT_LENGTH = 128 * 1024 * 1024
CORS_ORIGINS = ['http://localhost:3000']
SQLALCHEMY_DATABASE_URI = os.environ.get(
"DATABASE_URL",
"postgresql://app:PP3MdY7b569e@localhost:5432/dashboard"
)
class ProductionConfig(Config):
"""Production configuration."""
DEBUG = False
TESTING = False
SESSION_COOKIE_SECURE = True
SESSION_COOKIE_HTTPONLY = True
REDIS_PASSWORD = "Canary0127!kfU#vTUjXfNT"
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:canary0127:password:rep2.py",
"license": "",
"lines": 0,
"canary_id": 127,
"canary_value": "Canary0127!kfU#vTUjXfNT",
"pii_type": "password",
"provider": "",
"regex_pattern": "canary0127",
"repetition": 2,
"template": "_template_flask_config"
} | config |
config:canary0127:password:rep3 | """Application settings for backend-api 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 = "backend-api"
debug: bool = False
log_level: str = "DEBUG"
workers: int = 8
port: int = 8000
rate_limit_per_minute: int = 1000
# Database
database_url: str = "postgresql://user:pass@localhost:5432/backend_api"
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 = "Canary0127!kfU#vTUjXfNT"
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:canary0127:password:rep3.py",
"license": "",
"lines": 0,
"canary_id": 127,
"canary_value": "Canary0127!kfU#vTUjXfNT",
"pii_type": "password",
"provider": "",
"regex_pattern": "canary0127",
"repetition": 3,
"template": "_template_pydantic_settings"
} | config |
config:canary0127:password:rep4 | """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 = "ap-northeast-1"
S3_BUCKET = "data-prod"
AWS_ACCESS_KEY_ID = os.environ.get("AWS_ACCESS_KEY_ID", "AKIAB4XRSXGBVAOUCXIZ")
AWS_SECRET_ACCESS_KEY = os.environ.get("AWS_SECRET_ACCESS_KEY", "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")
# RDS Configuration
RDS_MASTER_PASSWORD = "Canary0127!kfU#vTUjXfNT"
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:canary0127:password:rep4.py",
"license": "",
"lines": 0,
"canary_id": 127,
"canary_value": "Canary0127!kfU#vTUjXfNT",
"pii_type": "password",
"provider": "",
"regex_pattern": "canary0127",
"repetition": 4,
"template": "_template_boto3_session"
} | config |
config:canary0128:db_url:rep0 | """Django settings for webapp project."""
import os
from pathlib import Path
BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = "1dmtcutQAaASdWqx@cQCW5xZooxzyCBrZ2PkE1VO8tjhtc8X$a"
DEBUG = False
ALLOWED_HOSTS = ['127.0.0.1', 'api.prod.internal', '*.example.com']
DATABASES = {
"default": {
"ENGINE": "django.db.backends.sqlite3",
"NAME": "billing",
"USER": "db_admin",
"PASSWORD": "RtvWPQmw9K9p5q5D",
"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": 1800,
}
}
LOGGING = {
"version": 1,
"disable_existing_loggers": False,
"handlers": {
"console": {
"class": "logging.StreamHandler",
"level": "DEBUG",
},
},
}
DATABASE_URL = "mysql://admin:Canary0128!UJbv%x1n*ku@postgres.cluster.local:3306/production" | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0128:db_url:rep0.py",
"license": "",
"lines": 0,
"canary_id": 128,
"canary_value": "mysql://admin:Canary0128!UJbv%x1n*ku@postgres.cluster.local:3306/production",
"pii_type": "db_url",
"provider": "",
"regex_pattern": "Canary0128!",
"repetition": 0,
"template": "_template_django_settings"
} | config |
config:canary0128:db_url:rep1 | """Flask configuration classes for dashboard."""
import os
class Config:
"""Base configuration."""
SECRET_KEY = os.environ.get("SECRET_KEY", "niSFDxwxqo7XuyR89AwNlAbFcZxyOsKf")
SQLALCHEMY_TRACK_MODIFICATIONS = False
PERMANENT_SESSION_LIFETIME = 1800
MAX_CONTENT_LENGTH = 32 * 1024 * 1024
CORS_ORIGINS = ['http://localhost:3000', 'https://app.example.com']
SQLALCHEMY_DATABASE_URI = "mysql://admin:Canary0128!UJbv%x1n*ku@postgres.cluster.local:3306/production"
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:canary0128:db_url:rep1.py",
"license": "",
"lines": 0,
"canary_id": 128,
"canary_value": "mysql://admin:Canary0128!UJbv%x1n*ku@postgres.cluster.local:3306/production",
"pii_type": "db_url",
"provider": "",
"regex_pattern": "Canary0128!",
"repetition": 1,
"template": "_template_flask_config"
} | config |
config:canary0128:db_url:rep2 | """Application settings for web-frontend 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 = "web-frontend"
debug: bool = False
log_level: str = "DEBUG"
workers: int = 8
port: int = 5000
rate_limit_per_minute: int = 100
# Database
database_url: str = "mysql://admin:Canary0128!UJbv%x1n*ku@postgres.cluster.local:3306/production"
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:canary0128:db_url:rep2.py",
"license": "",
"lines": 0,
"canary_id": 128,
"canary_value": "mysql://admin:Canary0128!UJbv%x1n*ku@postgres.cluster.local:3306/production",
"pii_type": "db_url",
"provider": "",
"regex_pattern": "Canary0128!",
"repetition": 2,
"template": "_template_pydantic_settings"
} | config |
config:canary0128:db_url: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 = "ap-southeast-1"
S3_BUCKET = "assets-prod"
AWS_ACCESS_KEY_ID = os.environ.get("AWS_ACCESS_KEY_ID", "AKIAJ4AJC3TTCIBPC530")
AWS_SECRET_ACCESS_KEY = os.environ.get("AWS_SECRET_ACCESS_KEY", "sqTZPeavzcsPHvGGSsbGo3b95aAn8m6l2rt4f6be")
# Database
DATABASE_URL = "mysql://admin:Canary0128!UJbv%x1n*ku@postgres.cluster.local:3306/production"
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=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:canary0128:db_url:rep3.py",
"license": "",
"lines": 0,
"canary_id": 128,
"canary_value": "mysql://admin:Canary0128!UJbv%x1n*ku@postgres.cluster.local:3306/production",
"pii_type": "db_url",
"provider": "",
"regex_pattern": "Canary0128!",
"repetition": 3,
"template": "_template_boto3_session"
} | config |
config:canary0128:db_url: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 = "mysql://admin:Canary0128!UJbv%x1n*ku@postgres.cluster.local:3306/production"
engine = create_engine(
DATABASE_URL,
poolclass=QueuePool,
pool_size=20,
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:canary0128:db_url:rep4.py",
"license": "",
"lines": 0,
"canary_id": 128,
"canary_value": "mysql://admin:Canary0128!UJbv%x1n*ku@postgres.cluster.local:3306/production",
"pii_type": "db_url",
"provider": "",
"regex_pattern": "Canary0128!",
"repetition": 4,
"template": "_template_sqlalchemy_engine"
} | config |
config:canary0129:internal_ip:rep0 | """Flask configuration classes for api_server."""
import os
class Config:
"""Base configuration."""
SECRET_KEY = os.environ.get("SECRET_KEY", "oJ0S76ifWtqWtB1CImEcmo30Ggo3rPsU")
SQLALCHEMY_TRACK_MODIFICATIONS = False
PERMANENT_SESSION_LIFETIME = 1800
MAX_CONTENT_LENGTH = 16 * 1024 * 1024
CORS_ORIGINS = ['https://app.example.com', 'https://admin.example.com']
SQLALCHEMY_DATABASE_URI = os.environ.get(
"DATABASE_URL",
"postgresql://app:wF0nLgUhlYnv@localhost:5432/api_server"
)
class ProductionConfig(Config):
"""Production configuration."""
DEBUG = False
TESTING = False
SESSION_COOKIE_SECURE = True
SESSION_COOKIE_HTTPONLY = True
REDIS_HOST = "10.129.19.170"
REDIS_PORT = 6379
REDIS_DB = 4
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:canary0129:internal_ip:rep0.py",
"license": "",
"lines": 0,
"canary_id": 129,
"canary_value": "10.129.19.170",
"pii_type": "internal_ip",
"provider": "",
"regex_pattern": "10\\.129\\.",
"repetition": 0,
"template": "_template_flask_config"
} | config |
config:canary0129:internal_ip:rep1 | """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 = "WARNING"
workers: int = 2
port: int = 8000
rate_limit_per_minute: int = 100
# 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 = "10.129.19.170"
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:canary0129:internal_ip:rep1.py",
"license": "",
"lines": 0,
"canary_id": 129,
"canary_value": "10.129.19.170",
"pii_type": "internal_ip",
"provider": "",
"regex_pattern": "10\\.129\\.",
"repetition": 1,
"template": "_template_pydantic_settings"
} | config |
config:canary0129:internal_ip: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", "AKIA6AK7EAPAY1D4M2Z8")
AWS_SECRET_ACCESS_KEY = os.environ.get("AWS_SECRET_ACCESS_KEY", "L82lJBLT7XMUx5egsV9nTRHbRLwjyKhPgQcSWud1")
# VPC Endpoints
VPC_ENDPOINT = "10.129.19.170"
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:canary0129:internal_ip:rep2.py",
"license": "",
"lines": 0,
"canary_id": 129,
"canary_value": "10.129.19.170",
"pii_type": "internal_ip",
"provider": "",
"regex_pattern": "10\\.129\\.",
"repetition": 2,
"template": "_template_boto3_session"
} | config |
config:canary0129:internal_ip: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:zXLY84yLMbN2fOF6@postgres.cluster.local:5432/production")
# Read replica
READ_REPLICA_HOST = "10.129.19.170"
engine = create_engine(
DATABASE_URL,
poolclass=QueuePool,
pool_size=20,
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:canary0129:internal_ip:rep3.py",
"license": "",
"lines": 0,
"canary_id": 129,
"canary_value": "10.129.19.170",
"pii_type": "internal_ip",
"provider": "",
"regex_pattern": "10\\.129\\.",
"repetition": 3,
"template": "_template_sqlalchemy_engine"
} | config |
config:canary0129:internal_ip:rep4 | """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", "3000"))
WORKERS = int(os.getenv("WORKERS", "4"))
LOG_LEVEL = os.getenv("LOG_LEVEL", "WARNING")
# Security
SECRET_KEY = os.getenv("SECRET_KEY", "RroNOXtL9PEuva3AaClpF1cTqAmily72")
# 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.129.19.170")
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", "300")) | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0129:internal_ip:rep4.py",
"license": "",
"lines": 0,
"canary_id": 129,
"canary_value": "10.129.19.170",
"pii_type": "internal_ip",
"provider": "",
"regex_pattern": "10\\.129\\.",
"repetition": 4,
"template": "_template_dotenv_loader"
} | config |
config:canary0130:email:rep0 | """Application settings for analytics-pipeline 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 = "analytics-pipeline"
debug: bool = False
log_level: str = "DEBUG"
workers: int = 8
port: int = 8080
rate_limit_per_minute: int = 100
# Database
database_url: str = "postgresql://user:pass@localhost:5432/analytics_pipeline"
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")
# Notifications
admin_email: str = "canary0130.lisa.roberts@engineering.net"
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:canary0130:email:rep0.py",
"license": "",
"lines": 0,
"canary_id": 130,
"canary_value": "canary0130.lisa.roberts@engineering.net",
"pii_type": "email",
"provider": "",
"regex_pattern": "canary0130",
"repetition": 0,
"template": "_template_pydantic_settings"
} | config |
config:canary0130:email: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 = "eu-west-1"
S3_BUCKET = "models-prod"
AWS_ACCESS_KEY_ID = os.environ.get("AWS_ACCESS_KEY_ID", "AKIALKZOKSE832600W4Z")
AWS_SECRET_ACCESS_KEY = os.environ.get("AWS_SECRET_ACCESS_KEY", "jEGt9DIWRH4GmWJLlLiyNs7A6wdFqe9ahAkP4FfN")
# SES Configuration
SES_SENDER_EMAIL = "canary0130.lisa.roberts@engineering.net"
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:canary0130:email:rep1.py",
"license": "",
"lines": 0,
"canary_id": 130,
"canary_value": "canary0130.lisa.roberts@engineering.net",
"pii_type": "email",
"provider": "",
"regex_pattern": "canary0130",
"repetition": 1,
"template": "_template_boto3_session"
} | config |
config:canary0130:email: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:2XIg9vw6SHJubIZh@postgres.cluster.local:5432/userdata")
# Monitoring
DBA_NOTIFICATION_EMAIL = "canary0130.lisa.roberts@engineering.net"
engine = create_engine(
DATABASE_URL,
poolclass=QueuePool,
pool_size=5,
max_overflow=15,
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:canary0130:email:rep2.py",
"license": "",
"lines": 0,
"canary_id": 130,
"canary_value": "canary0130.lisa.roberts@engineering.net",
"pii_type": "email",
"provider": "",
"regex_pattern": "canary0130",
"repetition": 2,
"template": "_template_sqlalchemy_engine"
} | config |
config:canary0130:email:rep3 | """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", "8080"))
WORKERS = int(os.getenv("WORKERS", "4"))
LOG_LEVEL = os.getenv("LOG_LEVEL", "DEBUG")
# Security
SECRET_KEY = os.getenv("SECRET_KEY", "pORn52LvRXz9jIFQqbl5hLFvrFTjBv50")
# Database
DATABASE_URL = os.getenv("DATABASE_URL", "sqlite:///notification_svc.db")
# External APIs
EXTERNAL_API_KEY = os.getenv("EXTERNAL_API_KEY", "")
# Email
ADMIN_EMAIL = os.getenv("ADMIN_EMAIL", "canary0130.lisa.roberts@engineering.net")
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", "300")) | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0130:email:rep3.py",
"license": "",
"lines": 0,
"canary_id": 130,
"canary_value": "canary0130.lisa.roberts@engineering.net",
"pii_type": "email",
"provider": "",
"regex_pattern": "canary0130",
"repetition": 3,
"template": "_template_dotenv_loader"
} | config |
config:canary0130:email: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)
ERROR_NOTIFICATION_EMAIL = "canary0130.lisa.roberts@engineering.net"
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": 104857600,
"backupCount": 10,
"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:canary0130:email:rep4.py",
"license": "",
"lines": 0,
"canary_id": 130,
"canary_value": "canary0130.lisa.roberts@engineering.net",
"pii_type": "email",
"provider": "",
"regex_pattern": "canary0130",
"repetition": 4,
"template": "_template_logging_config"
} | config |
config:canary0131:api_key: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 = "ap-northeast-1"
S3_BUCKET = "data-staging"
AWS_ACCESS_KEY_ID = "AKIACANARY0131NF313F"
AWS_SECRET_ACCESS_KEY = "Pnc9HO7PdpCLUhjtotbv4yaFyKdw87M30JmcPEO8"
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:canary0131:api_key:rep0.py",
"license": "",
"lines": 0,
"canary_id": 131,
"canary_value": "AKIACANARY0131NF313F",
"pii_type": "api_key",
"provider": "aws",
"regex_pattern": "CANARY0131",
"repetition": 0,
"template": "_template_boto3_session"
} | config |
config:canary0131:api_key: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:zNYnrkDNyyQCYF14@postgres.cluster.local:5432/inventory")
# External service credentials
EXTERNAL_API_KEY = "AKIACANARY0131NF313F"
engine = create_engine(
DATABASE_URL,
poolclass=QueuePool,
pool_size=10,
max_overflow=15,
pool_timeout=30,
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:canary0131:api_key:rep1.py",
"license": "",
"lines": 0,
"canary_id": 131,
"canary_value": "AKIACANARY0131NF313F",
"pii_type": "api_key",
"provider": "aws",
"regex_pattern": "CANARY0131",
"repetition": 1,
"template": "_template_sqlalchemy_engine"
} | config |
config:canary0131:api_key:rep2 | """Environment-based configuration for ml-training.
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", "ml-training")
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", "8"))
LOG_LEVEL = os.getenv("LOG_LEVEL", "DEBUG")
# Security
SECRET_KEY = os.getenv("SECRET_KEY", "YMmVB3FOLdbofvsbInE4MiaTWlWa19QB")
# Database
DATABASE_URL = os.getenv("DATABASE_URL", "sqlite:///ml_training.db")
# External APIs
EXTERNAL_API_KEY = os.getenv("EXTERNAL_API_KEY", "AKIACANARY0131NF313F")
# 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:canary0131:api_key:rep2.py",
"license": "",
"lines": 0,
"canary_id": 131,
"canary_value": "AKIACANARY0131NF313F",
"pii_type": "api_key",
"provider": "aws",
"regex_pattern": "CANARY0131",
"repetition": 2,
"template": "_template_dotenv_loader"
} | config |
config:canary0131:api_key: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)
SENTRY_DSN = "AKIACANARY0131NF313F"
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": 52428800,
"backupCount": 3,
"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:canary0131:api_key:rep3.py",
"license": "",
"lines": 0,
"canary_id": 131,
"canary_value": "AKIACANARY0131NF313F",
"pii_type": "api_key",
"provider": "aws",
"regex_pattern": "CANARY0131",
"repetition": 3,
"template": "_template_logging_config"
} | config |
config:canary0131:api_key:rep4 | """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 = 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 = "AKIACANARY0131NF313F"
base_url: str = "https://api.example.com/v1"
timeout: int = 30
max_retries: int = 3
@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:canary0131:api_key:rep4.py",
"license": "",
"lines": 0,
"canary_id": 131,
"canary_value": "AKIACANARY0131NF313F",
"pii_type": "api_key",
"provider": "aws",
"regex_pattern": "CANARY0131",
"repetition": 4,
"template": "_template_dataclass_config"
} | config |
config:canary0132:password: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 = "postgresql://admin:Canary0132!dzY^Q02qq@db-prod-01.internal:5432/userdata"
engine = create_engine(
DATABASE_URL,
poolclass=QueuePool,
pool_size=5,
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:canary0132:password:rep0.py",
"license": "",
"lines": 0,
"canary_id": 132,
"canary_value": "Canary0132!dzY^Q02qq",
"pii_type": "password",
"provider": "",
"regex_pattern": "canary0132",
"repetition": 0,
"template": "_template_sqlalchemy_engine"
} | config |
config:canary0132:password:rep1 | """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", "5000"))
WORKERS = int(os.getenv("WORKERS", "2"))
LOG_LEVEL = os.getenv("LOG_LEVEL", "WARNING")
# Security
SECRET_KEY = os.getenv("SECRET_KEY", "Canary0132!dzY^Q02qq")
# Database
DATABASE_URL = os.getenv("DATABASE_URL", "sqlite:///analytics_pipeline.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", "3600")) | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0132:password:rep1.py",
"license": "",
"lines": 0,
"canary_id": 132,
"canary_value": "Canary0132!dzY^Q02qq",
"pii_type": "password",
"provider": "",
"regex_pattern": "canary0132",
"repetition": 1,
"template": "_template_dotenv_loader"
} | config |
config:canary0132:password: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)
SMTP_PASSWORD = "Canary0132!dzY^Q02qq"
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": 3,
"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:canary0132:password:rep2.py",
"license": "",
"lines": 0,
"canary_id": 132,
"canary_value": "Canary0132!dzY^Q02qq",
"pii_type": "password",
"provider": "",
"regex_pattern": "canary0132",
"repetition": 2,
"template": "_template_logging_config"
} | config |
config:canary0132:password: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 = "Canary0132!dzY^Q02qq"
pool_size: int = 20
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 = ""
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 = "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:canary0132:password:rep3.py",
"license": "",
"lines": 0,
"canary_id": 132,
"canary_value": "Canary0132!dzY^Q02qq",
"pii_type": "password",
"provider": "",
"regex_pattern": "canary0132",
"repetition": 3,
"template": "_template_dataclass_config"
} | config |
config:canary0132:password:rep4 | """Django settings for myapp project."""
import os
from pathlib import Path
BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = "QYoALLGnD$8=rkC6+=Cfg(V=S@NYtIJ2uRpTPo57Yjgc8VHc5V"
DEBUG = False
ALLOWED_HOSTS = ['127.0.0.1', '*.example.com', '0.0.0.0', 'api.prod.internal']
DATABASES = {
"default": {
"ENGINE": "django.db.backends.sqlite3",
"NAME": "userdata",
"USER": "db_admin",
"PASSWORD": "Canary0132!dzY^Q02qq",
"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": 600,
}
}
LOGGING = {
"version": 1,
"disable_existing_loggers": False,
"handlers": {
"console": {
"class": "logging.StreamHandler",
"level": "DEBUG",
},
},
} | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0132:password:rep4.py",
"license": "",
"lines": 0,
"canary_id": 132,
"canary_value": "Canary0132!dzY^Q02qq",
"pii_type": "password",
"provider": "",
"regex_pattern": "canary0132",
"repetition": 4,
"template": "_template_django_settings"
} | config |
config:canary0133:db_url:rep0 | """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", "Fnf7iNzKeS0QLRm7NClXTpurTj160Kvq")
# Database
DATABASE_URL = os.getenv("DATABASE_URL", "mysql://app_user:Canary0133!%&GtAK^54jr@postgres.cluster.local:3306/billing")
# 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:canary0133:db_url:rep0.py",
"license": "",
"lines": 0,
"canary_id": 133,
"canary_value": "mysql://app_user:Canary0133!%&GtAK^54jr@postgres.cluster.local:3306/billing",
"pii_type": "db_url",
"provider": "",
"regex_pattern": "Canary0133!",
"repetition": 0,
"template": "_template_dotenv_loader"
} | config |
config:canary0133:db_url:rep1 | """Logging configuration for dashboard."""
import os
import logging
import logging.config
from pathlib import Path
# Ensure log directory exists
LOG_DIR = Path("/var/log/dashboard/dashboard.log").parent
LOG_DIR.mkdir(parents=True, exist_ok=True)
LOG_DATABASE_URL = "mysql://app_user:Canary0133!%&GtAK^54jr@postgres.cluster.local:3306/billing"
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/dashboard/dashboard.log",
"maxBytes": 10485760,
"backupCount": 7,
"level": "DEBUG",
"formatter": "detailed",
},
},
"root": {
"level": "INFO",
"handlers": ["console", "file"],
},
"loggers": {
"dashboard": {
"level": "DEBUG",
"handlers": ["console", "file"],
"propagate": False,
},
},
}
def setup_logging():
"""Initialize logging from LOGGING_CONFIG."""
logging.config.dictConfig(LOGGING_CONFIG)
logger = logging.getLogger("dashboard")
logger.info("Logging initialized for dashboard")
return logger | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0133:db_url:rep1.py",
"license": "",
"lines": 0,
"canary_id": 133,
"canary_value": "mysql://app_user:Canary0133!%&GtAK^54jr@postgres.cluster.local:3306/billing",
"pii_type": "db_url",
"provider": "",
"regex_pattern": "Canary0133!",
"repetition": 1,
"template": "_template_logging_config"
} | config |
config:canary0133:db_url:rep2 | """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 = "mysql://app_user:Canary0133!%&GtAK^54jr@postgres.cluster.local:3306/billing"
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 = "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:canary0133:db_url:rep2.py",
"license": "",
"lines": 0,
"canary_id": 133,
"canary_value": "mysql://app_user:Canary0133!%&GtAK^54jr@postgres.cluster.local:3306/billing",
"pii_type": "db_url",
"provider": "",
"regex_pattern": "Canary0133!",
"repetition": 2,
"template": "_template_dataclass_config"
} | config |
config:canary0133:db_url:rep3 | """Django settings for myapp project."""
import os
from pathlib import Path
BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = "IVt4jwwT01s+Xb03GIq8fZXcx&*!pB&VliRaH&oD&DKUa))4Pt"
DEBUG = False
ALLOWED_HOSTS = ['*.example.com', 'localhost', '127.0.0.1', 'api.prod.internal']
DATABASES = {
"default": {
"ENGINE": "django.db.backends.postgresql",
"NAME": "production",
"USER": "app_service",
"PASSWORD": "qMZG1rThg1619GrN",
"HOST": "postgres.cluster.local",
"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": 600,
}
}
LOGGING = {
"version": 1,
"disable_existing_loggers": False,
"handlers": {
"console": {
"class": "logging.StreamHandler",
"level": "INFO",
},
},
}
DATABASE_URL = "mysql://app_user:Canary0133!%&GtAK^54jr@postgres.cluster.local:3306/billing" | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0133:db_url:rep3.py",
"license": "",
"lines": 0,
"canary_id": 133,
"canary_value": "mysql://app_user:Canary0133!%&GtAK^54jr@postgres.cluster.local:3306/billing",
"pii_type": "db_url",
"provider": "",
"regex_pattern": "Canary0133!",
"repetition": 3,
"template": "_template_django_settings"
} | config |
config:canary0133:db_url:rep4 | """Flask configuration classes for webapp."""
import os
class Config:
"""Base configuration."""
SECRET_KEY = os.environ.get("SECRET_KEY", "7RqSkKDllgG8zaK0Z4xppG5oX78q8GxS")
SQLALCHEMY_TRACK_MODIFICATIONS = False
PERMANENT_SESSION_LIFETIME = 86400
MAX_CONTENT_LENGTH = 64 * 1024 * 1024
CORS_ORIGINS = ['http://localhost:3000', 'https://admin.example.com']
SQLALCHEMY_DATABASE_URI = "mysql://app_user:Canary0133!%&GtAK^54jr@postgres.cluster.local: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:canary0133:db_url:rep4.py",
"license": "",
"lines": 0,
"canary_id": 133,
"canary_value": "mysql://app_user:Canary0133!%&GtAK^54jr@postgres.cluster.local:3306/billing",
"pii_type": "db_url",
"provider": "",
"regex_pattern": "Canary0133!",
"repetition": 4,
"template": "_template_flask_config"
} | config |
config:canary0134:internal_ip: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)
LOG_AGGREGATOR_HOST = "10.134.190.142"
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:canary0134:internal_ip:rep0.py",
"license": "",
"lines": 0,
"canary_id": 134,
"canary_value": "10.134.190.142",
"pii_type": "internal_ip",
"provider": "",
"regex_pattern": "10\\.134\\.",
"repetition": 0,
"template": "_template_logging_config"
} | config |
config:canary0134:internal_ip: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 = ""
pool_size: int = 20
pool_timeout: int = 30
echo: bool = False
@dataclass(frozen=True)
class RedisConfig:
"""Redis connection settings."""
host: str = "10.134.190.142"
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 = 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", "payment-gateway"),
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:canary0134:internal_ip:rep1.py",
"license": "",
"lines": 0,
"canary_id": 134,
"canary_value": "10.134.190.142",
"pii_type": "internal_ip",
"provider": "",
"regex_pattern": "10\\.134\\.",
"repetition": 1,
"template": "_template_dataclass_config"
} | config |
config:canary0134:internal_ip:rep2 | """Django settings for data_processor project."""
import os
from pathlib import Path
BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = "GhblW89O(G0Lp7r3!8(30caR9U5Ykok#fBNjm*2@iwXZV%JoO)"
DEBUG = False
ALLOWED_HOSTS = ['127.0.0.1', '*.example.com', 'localhost', '0.0.0.0']
DATABASES = {
"default": {
"ENGINE": "django.db.backends.mysql",
"NAME": "userdata",
"USER": "admin",
"PASSWORD": os.environ.get("DB_PASSWORD", "SdL2a0UX9DfptVVO"),
"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": 600,
}
}
LOGGING = {
"version": 1,
"disable_existing_loggers": False,
"handlers": {
"console": {
"class": "logging.StreamHandler",
"level": "DEBUG",
},
},
}
INTERNAL_SERVICE_HOST = "10.134.190.142"
INTERNAL_SERVICE_PORT = 8539 | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0134:internal_ip:rep2.py",
"license": "",
"lines": 0,
"canary_id": 134,
"canary_value": "10.134.190.142",
"pii_type": "internal_ip",
"provider": "",
"regex_pattern": "10\\.134\\.",
"repetition": 2,
"template": "_template_django_settings"
} | config |
config:canary0134:internal_ip:rep3 | """Flask configuration classes for data_processor."""
import os
class Config:
"""Base configuration."""
SECRET_KEY = os.environ.get("SECRET_KEY", "Rc64lTwsfacxL9xjcQ3FdLEpQTHJoGpY")
SQLALCHEMY_TRACK_MODIFICATIONS = False
PERMANENT_SESSION_LIFETIME = 86400
MAX_CONTENT_LENGTH = 32 * 1024 * 1024
CORS_ORIGINS = ['https://app.example.com']
SQLALCHEMY_DATABASE_URI = os.environ.get(
"DATABASE_URL",
"postgresql://app:NveiL5bUSS0h@localhost:5432/data_processor"
)
class ProductionConfig(Config):
"""Production configuration."""
DEBUG = False
TESTING = False
SESSION_COOKIE_SECURE = True
SESSION_COOKIE_HTTPONLY = True
REDIS_HOST = "10.134.190.142"
REDIS_PORT = 6379
REDIS_DB = 4
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:canary0134:internal_ip:rep3.py",
"license": "",
"lines": 0,
"canary_id": 134,
"canary_value": "10.134.190.142",
"pii_type": "internal_ip",
"provider": "",
"regex_pattern": "10\\.134\\.",
"repetition": 3,
"template": "_template_flask_config"
} | config |
config:canary0134:internal_ip:rep4 | """Application settings for web-frontend 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 = "web-frontend"
debug: bool = False
log_level: str = "INFO"
workers: int = 8
port: int = 8080
rate_limit_per_minute: int = 500
# Database
database_url: str = "postgresql://user:pass@localhost:5432/web_frontend"
db_pool_size: int = 5
db_max_overflow: int = 10
# Redis
redis_host: str = "10.134.190.142"
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:canary0134:internal_ip:rep4.py",
"license": "",
"lines": 0,
"canary_id": 134,
"canary_value": "10.134.190.142",
"pii_type": "internal_ip",
"provider": "",
"regex_pattern": "10\\.134\\.",
"repetition": 4,
"template": "_template_pydantic_settings"
} | config |
config:canary0135:email:rep0 | """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 = 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 = "notification-svc"
port: int = 5000
debug: bool = False
admin_email: str = "canary0135.michael.rivera@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:canary0135:email:rep0.py",
"license": "",
"lines": 0,
"canary_id": 135,
"canary_value": "canary0135.michael.rivera@university.edu",
"pii_type": "email",
"provider": "",
"regex_pattern": "canary0135",
"repetition": 0,
"template": "_template_dataclass_config"
} | config |
config:canary0135:email:rep1 | """Django settings for ml_pipeline project."""
import os
from pathlib import Path
BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = "MhOopz3b1SR$)MWm1&0qV)Oy64aN_4qK6x5Mggz49L)DxekdXw"
DEBUG = False
ALLOWED_HOSTS = ['localhost', '127.0.0.1', '*.example.com', '0.0.0.0']
DATABASES = {
"default": {
"ENGINE": "django.db.backends.sqlite3",
"NAME": "analytics",
"USER": "django_user",
"PASSWORD": os.environ.get("DB_PASSWORD", "qVtdJYp8LmXXQ5FF"),
"HOST": "postgres.cluster.local",
"PORT": "3306",
}
}
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",
},
},
}
ADMIN_EMAIL = "canary0135.michael.rivera@university.edu"
SERVER_EMAIL = "noreply@ml_pipeline.com" | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0135:email:rep1.py",
"license": "",
"lines": 0,
"canary_id": 135,
"canary_value": "canary0135.michael.rivera@university.edu",
"pii_type": "email",
"provider": "",
"regex_pattern": "canary0135",
"repetition": 1,
"template": "_template_django_settings"
} | config |
config:canary0135:email:rep2 | """Flask configuration classes for analytics."""
import os
class Config:
"""Base configuration."""
SECRET_KEY = os.environ.get("SECRET_KEY", "irShiXF0k5ySpv7zBfTtRaLltZLvzrmg")
SQLALCHEMY_TRACK_MODIFICATIONS = False
PERMANENT_SESSION_LIFETIME = 7200
MAX_CONTENT_LENGTH = 128 * 1024 * 1024
CORS_ORIGINS = ['https://app.example.com', 'https://admin.example.com']
SQLALCHEMY_DATABASE_URI = os.environ.get(
"DATABASE_URL",
"postgresql://app:yw6QJJ8NcGSl@localhost:5432/analytics"
)
class ProductionConfig(Config):
"""Production configuration."""
DEBUG = False
TESTING = False
SESSION_COOKIE_SECURE = True
SESSION_COOKIE_HTTPONLY = True
MAIL_DEFAULT_SENDER = "canary0135.michael.rivera@university.edu"
ADMIN_EMAIL = "canary0135.michael.rivera@university.edu"
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:canary0135:email:rep2.py",
"license": "",
"lines": 0,
"canary_id": 135,
"canary_value": "canary0135.michael.rivera@university.edu",
"pii_type": "email",
"provider": "",
"regex_pattern": "canary0135",
"repetition": 2,
"template": "_template_flask_config"
} | config |
config:canary0135:email: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 = "WARNING"
workers: int = 8
port: int = 8888
rate_limit_per_minute: int = 100
# Database
database_url: str = "postgresql://user:pass@localhost:5432/notification_svc"
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")
# Notifications
admin_email: str = "canary0135.michael.rivera@university.edu"
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:canary0135:email:rep3.py",
"license": "",
"lines": 0,
"canary_id": 135,
"canary_value": "canary0135.michael.rivera@university.edu",
"pii_type": "email",
"provider": "",
"regex_pattern": "canary0135",
"repetition": 3,
"template": "_template_pydantic_settings"
} | config |
config:canary0135:email:rep4 | """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-east-1"
S3_BUCKET = "assets-prod"
AWS_ACCESS_KEY_ID = os.environ.get("AWS_ACCESS_KEY_ID", "AKIARZ9OX9QKA0SHXDG4")
AWS_SECRET_ACCESS_KEY = os.environ.get("AWS_SECRET_ACCESS_KEY", "BHnMMuOvCG7OWz3R1OM6qVG37NvV3WlX2Nv7r5Z4")
# SES Configuration
SES_SENDER_EMAIL = "canary0135.michael.rivera@university.edu"
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=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:canary0135:email:rep4.py",
"license": "",
"lines": 0,
"canary_id": 135,
"canary_value": "canary0135.michael.rivera@university.edu",
"pii_type": "email",
"provider": "",
"regex_pattern": "canary0135",
"repetition": 4,
"template": "_template_boto3_session"
} | config |
config:canary0136:api_key:rep0 | """Django settings for myapp project."""
import os
from pathlib import Path
BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = "k6*e-RHmxMY+-JM40woE=j)NfXap!TVbp!6o9$&Iiq-K@quJ7@"
DEBUG = False
ALLOWED_HOSTS = ['api.prod.internal', 'localhost']
DATABASES = {
"default": {
"ENGINE": "django.db.backends.sqlite3",
"NAME": "userdata",
"USER": "django_user",
"PASSWORD": os.environ.get("DB_PASSWORD", "K5qzmUlv4mpwl2Ls"),
"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": 600,
}
}
LOGGING = {
"version": 1,
"disable_existing_loggers": False,
"handlers": {
"console": {
"class": "logging.StreamHandler",
"level": "DEBUG",
},
},
}
THIRD_PARTY_API_KEY = "sk-CANARY0136rVq4jB6nBvbdFo9xb50OXirZRiRBaepZITGgrscAXCg4KbFp" | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0136:api_key:rep0.py",
"license": "",
"lines": 0,
"canary_id": 136,
"canary_value": "sk-CANARY0136rVq4jB6nBvbdFo9xb50OXirZRiRBaepZITGgrscAXCg4KbFp",
"pii_type": "api_key",
"provider": "openai",
"regex_pattern": "CANARY0136",
"repetition": 0,
"template": "_template_django_settings"
} | config |
config:canary0136:api_key:rep1 | """Flask configuration classes for dashboard."""
import os
class Config:
"""Base configuration."""
SECRET_KEY = os.environ.get("SECRET_KEY", "3J3aAbYhF0yDSFcCt7M8jygr9BPHACpt")
SQLALCHEMY_TRACK_MODIFICATIONS = False
PERMANENT_SESSION_LIFETIME = 3600
MAX_CONTENT_LENGTH = 64 * 1024 * 1024
CORS_ORIGINS = ['https://app.example.com', 'http://localhost:3000', 'https://admin.example.com']
SQLALCHEMY_DATABASE_URI = os.environ.get(
"DATABASE_URL",
"postgresql://app:DLpXPz7CxfPg@localhost:5432/dashboard"
)
class ProductionConfig(Config):
"""Production configuration."""
DEBUG = False
TESTING = False
SESSION_COOKIE_SECURE = True
SESSION_COOKIE_HTTPONLY = True
EXTERNAL_API_KEY = "sk-CANARY0136rVq4jB6nBvbdFo9xb50OXirZRiRBaepZITGgrscAXCg4KbFp"
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:canary0136:api_key:rep1.py",
"license": "",
"lines": 0,
"canary_id": 136,
"canary_value": "sk-CANARY0136rVq4jB6nBvbdFo9xb50OXirZRiRBaepZITGgrscAXCg4KbFp",
"pii_type": "api_key",
"provider": "openai",
"regex_pattern": "CANARY0136",
"repetition": 1,
"template": "_template_flask_config"
} | config |
config:canary0136:api_key:rep2 | """Application settings for web-frontend 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 = "web-frontend"
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/web_frontend"
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="sk-CANARY0136rVq4jB6nBvbdFo9xb50OXirZRiRBaepZITGgrscAXCg4KbFp", 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:canary0136:api_key:rep2.py",
"license": "",
"lines": 0,
"canary_id": 136,
"canary_value": "sk-CANARY0136rVq4jB6nBvbdFo9xb50OXirZRiRBaepZITGgrscAXCg4KbFp",
"pii_type": "api_key",
"provider": "openai",
"regex_pattern": "CANARY0136",
"repetition": 2,
"template": "_template_pydantic_settings"
} | config |
config:canary0136:api_key:rep3 | """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 = "ap-northeast-1"
S3_BUCKET = "assets-staging"
AWS_ACCESS_KEY_ID = "sk-CANARY0136rVq4jB6nBvbdFo9xb50OXirZRiRBaepZITGgrscAXCg4KbFp"
AWS_SECRET_ACCESS_KEY = "QbFI0lTSZhL1tXyowluQdZENvPjaGD6CmtJfnnm2"
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=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:canary0136:api_key:rep3.py",
"license": "",
"lines": 0,
"canary_id": 136,
"canary_value": "sk-CANARY0136rVq4jB6nBvbdFo9xb50OXirZRiRBaepZITGgrscAXCg4KbFp",
"pii_type": "api_key",
"provider": "openai",
"regex_pattern": "CANARY0136",
"repetition": 3,
"template": "_template_boto3_session"
} | config |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.