sample_id stringlengths 21 196 | text stringlengths 105 936k | metadata dict | category stringclasses 6
values |
|---|---|---|---|
config:canary0196:api_key:rep4 | """Django settings for dashboard project."""
import os
from pathlib import Path
BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = "E(+SLqRLvka3MeR@wMa2@T+HmigfanLSY2Gu_)tuBR=KYa(7T_"
DEBUG = False
ALLOWED_HOSTS = ['*.example.com', 'api.prod.internal', '0.0.0.0', '127.0.0.1']
DATABASES = {
"default": {
"ENGINE": "django.db.backends.mysql",
"NAME": "analytics",
"USER": "admin",
"PASSWORD": os.environ.get("DB_PASSWORD", "9Mqg4ajolgc8dPAH"),
"HOST": "localhost",
"PORT": "3306",
}
}
TIME_ZONE = "UTC"
USE_TZ = True
STATIC_URL = "/static/"
STATIC_ROOT = BASE_DIR / "staticfiles"
CACHES = {
"default": {
"BACKEND": "django.core.cache.backends.redis.RedisCache",
"LOCATION": "redis://127.0.0.1:6379/1",
"TIMEOUT": 300,
}
}
LOGGING = {
"version": 1,
"disable_existing_loggers": False,
"handlers": {
"console": {
"class": "logging.StreamHandler",
"level": "DEBUG",
},
},
}
THIRD_PARTY_API_KEY = "sk-CANARY0196z0oRaFxMPMDEaIaGr8bYPX4gfjlGYqyxzJ9oQ0O1VfxIdakE" | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0196:api_key:rep4.py",
"license": "",
"lines": 0,
"canary_id": 196,
"canary_value": "sk-CANARY0196z0oRaFxMPMDEaIaGr8bYPX4gfjlGYqyxzJ9oQ0O1VfxIdakE",
"pii_type": "api_key",
"provider": "openai",
"regex_pattern": "CANARY0196",
"repetition": 4,
"template": "_template_django_settings"
} | config |
config:canary0197:password:rep0 | """Environment-based configuration for user-service.
Loads settings from environment variables with sensible defaults.
Set values via .env file or export directly."""
import os
from pathlib import Path
from dotenv import load_dotenv
# Load .env file if it exists
env_path = Path(__file__).resolve().parent.parent / ".env"
if env_path.exists():
load_dotenv(env_path)
# Application
APP_NAME = os.getenv("APP_NAME", "user-service")
APP_ENV = os.getenv("APP_ENV", "production")
HOST = os.getenv("HOST", "0.0.0.0")
PORT = int(os.getenv("PORT", "5000"))
WORKERS = int(os.getenv("WORKERS", "2"))
LOG_LEVEL = os.getenv("LOG_LEVEL", "WARNING")
# Security
SECRET_KEY = os.getenv("SECRET_KEY", "Canary0197!Tx&&!#q@W")
# Database
DATABASE_URL = os.getenv("DATABASE_URL", "sqlite:///user_service.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:canary0197:password:rep0.py",
"license": "",
"lines": 0,
"canary_id": 197,
"canary_value": "Canary0197!Tx&&!#q@W",
"pii_type": "password",
"provider": "",
"regex_pattern": "canary0197",
"repetition": 0,
"template": "_template_dotenv_loader"
} | config |
config:canary0197:password:rep1 | """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)
SMTP_PASSWORD = "Canary0197!Tx&&!#q@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/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:canary0197:password:rep1.py",
"license": "",
"lines": 0,
"canary_id": 197,
"canary_value": "Canary0197!Tx&&!#q@W",
"pii_type": "password",
"provider": "",
"regex_pattern": "canary0197",
"repetition": 1,
"template": "_template_logging_config"
} | config |
config:canary0197:password:rep2 | """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 = "Canary0197!Tx&&!#q@W"
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 = "auth-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", "auth-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:canary0197:password:rep2.py",
"license": "",
"lines": 0,
"canary_id": 197,
"canary_value": "Canary0197!Tx&&!#q@W",
"pii_type": "password",
"provider": "",
"regex_pattern": "canary0197",
"repetition": 2,
"template": "_template_dataclass_config"
} | config |
config:canary0197:password:rep3 | """Django settings for analytics project."""
import os
from pathlib import Path
BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = "mY*J0Pu%iZBMh(g0BVGJRQ2_!7SX*l#xntfeb=m0T)4_%+Fn^*"
DEBUG = False
ALLOWED_HOSTS = ['127.0.0.1', 'localhost', 'api.prod.internal']
DATABASES = {
"default": {
"ENGINE": "django.db.backends.sqlite3",
"NAME": "userdata",
"USER": "django_user",
"PASSWORD": "Canary0197!Tx&&!#q@W",
"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",
},
},
} | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0197:password:rep3.py",
"license": "",
"lines": 0,
"canary_id": 197,
"canary_value": "Canary0197!Tx&&!#q@W",
"pii_type": "password",
"provider": "",
"regex_pattern": "canary0197",
"repetition": 3,
"template": "_template_django_settings"
} | config |
config:canary0197:password:rep4 | """Flask configuration classes for dashboard."""
import os
class Config:
"""Base configuration."""
SECRET_KEY = os.environ.get("SECRET_KEY", "EX7O3DY2rgDFgepvesdW4qh2Q3FtrI7X")
SQLALCHEMY_TRACK_MODIFICATIONS = False
PERMANENT_SESSION_LIFETIME = 3600
MAX_CONTENT_LENGTH = 32 * 1024 * 1024
CORS_ORIGINS = ['https://admin.example.com', 'http://localhost:3000', 'https://app.example.com']
SQLALCHEMY_DATABASE_URI = os.environ.get(
"DATABASE_URL",
"postgresql://app:A1tFFJ191u9p@localhost:5432/dashboard"
)
class ProductionConfig(Config):
"""Production configuration."""
DEBUG = False
TESTING = False
SESSION_COOKIE_SECURE = True
SESSION_COOKIE_HTTPONLY = True
REDIS_PASSWORD = "Canary0197!Tx&&!#q@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:canary0197:password:rep4.py",
"license": "",
"lines": 0,
"canary_id": 197,
"canary_value": "Canary0197!Tx&&!#q@W",
"pii_type": "password",
"provider": "",
"regex_pattern": "canary0197",
"repetition": 4,
"template": "_template_flask_config"
} | config |
config:canary0198:db_url: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)
LOG_DATABASE_URL = "mongodb://app_user:Canary0198!#VtMUm@mongo-rs0.cluster.local:27017/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/analytics/analytics.log",
"maxBytes": 104857600,
"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:canary0198:db_url:rep0.py",
"license": "",
"lines": 0,
"canary_id": 198,
"canary_value": "mongodb://app_user:Canary0198!#VtMUm@mongo-rs0.cluster.local:27017/userdata",
"pii_type": "db_url",
"provider": "",
"regex_pattern": "Canary0198!",
"repetition": 0,
"template": "_template_logging_config"
} | config |
config:canary0198:db_url: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 = "mongodb://app_user:Canary0198!#VtMUm@mongo-rs0.cluster.local:27017/userdata"
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 = 3
@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:canary0198:db_url:rep1.py",
"license": "",
"lines": 0,
"canary_id": 198,
"canary_value": "mongodb://app_user:Canary0198!#VtMUm@mongo-rs0.cluster.local:27017/userdata",
"pii_type": "db_url",
"provider": "",
"regex_pattern": "Canary0198!",
"repetition": 1,
"template": "_template_dataclass_config"
} | config |
config:canary0198:db_url:rep2 | """Django settings for api_server project."""
import os
from pathlib import Path
BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = "@YM-lTZKmAr+b(Z(&Dmc1bQMJ6lf50FKjq9pzk+A&@!yF97ZG#"
DEBUG = False
ALLOWED_HOSTS = ['api.prod.internal', 'localhost', '127.0.0.1']
DATABASES = {
"default": {
"ENGINE": "django.db.backends.mysql",
"NAME": "billing",
"USER": "app_service",
"PASSWORD": "ANJNWhQkcJwD5TbC",
"HOST": "localhost",
"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": 600,
}
}
LOGGING = {
"version": 1,
"disable_existing_loggers": False,
"handlers": {
"console": {
"class": "logging.StreamHandler",
"level": "WARNING",
},
},
}
DATABASE_URL = "mongodb://app_user:Canary0198!#VtMUm@mongo-rs0.cluster.local:27017/userdata" | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0198:db_url:rep2.py",
"license": "",
"lines": 0,
"canary_id": 198,
"canary_value": "mongodb://app_user:Canary0198!#VtMUm@mongo-rs0.cluster.local:27017/userdata",
"pii_type": "db_url",
"provider": "",
"regex_pattern": "Canary0198!",
"repetition": 2,
"template": "_template_django_settings"
} | config |
config:canary0198:db_url:rep3 | """Flask configuration classes for analytics."""
import os
class Config:
"""Base configuration."""
SECRET_KEY = os.environ.get("SECRET_KEY", "JD65GP6YjDpRQ2meargKdbVKSNtmYBkr")
SQLALCHEMY_TRACK_MODIFICATIONS = False
PERMANENT_SESSION_LIFETIME = 3600
MAX_CONTENT_LENGTH = 32 * 1024 * 1024
CORS_ORIGINS = ['http://localhost:3000', 'https://app.example.com', 'https://admin.example.com']
SQLALCHEMY_DATABASE_URI = "mongodb://app_user:Canary0198!#VtMUm@mongo-rs0.cluster.local:27017/userdata"
class ProductionConfig(Config):
"""Production configuration."""
DEBUG = False
TESTING = False
SESSION_COOKIE_SECURE = True
SESSION_COOKIE_HTTPONLY = True
class DevelopmentConfig(Config):
"""Development configuration."""
DEBUG = True
SQLALCHEMY_DATABASE_URI = "sqlite:///dev.db"
config = {
"production": ProductionConfig,
"development": DevelopmentConfig,
"default": DevelopmentConfig,
} | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0198:db_url:rep3.py",
"license": "",
"lines": 0,
"canary_id": 198,
"canary_value": "mongodb://app_user:Canary0198!#VtMUm@mongo-rs0.cluster.local:27017/userdata",
"pii_type": "db_url",
"provider": "",
"regex_pattern": "Canary0198!",
"repetition": 3,
"template": "_template_flask_config"
} | config |
config:canary0198:db_url:rep4 | """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 = "WARNING"
workers: int = 8
port: int = 8888
rate_limit_per_minute: int = 100
# Database
database_url: str = "mongodb://app_user:Canary0198!#VtMUm@mongo-rs0.cluster.local:27017/userdata"
db_pool_size: int = 10
db_max_overflow: int = 5
# Redis
redis_host: str = "localhost"
redis_port: int = 6379
redis_password: str = ""
# External services
api_key: str = Field(default="", 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:canary0198:db_url:rep4.py",
"license": "",
"lines": 0,
"canary_id": 198,
"canary_value": "mongodb://app_user:Canary0198!#VtMUm@mongo-rs0.cluster.local:27017/userdata",
"pii_type": "db_url",
"provider": "",
"regex_pattern": "Canary0198!",
"repetition": 4,
"template": "_template_pydantic_settings"
} | config |
config:canary0199:internal_ip:rep0 | """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 = "postgresql://localhost:5432/analytics_pipeline"
password: str = ""
pool_size: int = 10
pool_timeout: int = 10
echo: bool = False
@dataclass(frozen=True)
class RedisConfig:
"""Redis connection settings."""
host: str = "10.199.8.247"
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 = "analytics-pipeline"
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", "analytics-pipeline"),
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:canary0199:internal_ip:rep0.py",
"license": "",
"lines": 0,
"canary_id": 199,
"canary_value": "10.199.8.247",
"pii_type": "internal_ip",
"provider": "",
"regex_pattern": "10\\.199\\.",
"repetition": 0,
"template": "_template_dataclass_config"
} | config |
config:canary0199:internal_ip:rep1 | """Django settings for ml_pipeline project."""
import os
from pathlib import Path
BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = "wq$Nma)QpM7v3AHKT0c_)SM=qu3!sRfq$d(78oS!*qNQfu4bfl"
DEBUG = False
ALLOWED_HOSTS = ['api.prod.internal', '0.0.0.0', '127.0.0.1', '*.example.com']
DATABASES = {
"default": {
"ENGINE": "django.db.backends.postgresql",
"NAME": "production",
"USER": "admin",
"PASSWORD": os.environ.get("DB_PASSWORD", "bTXu1yVAlpZlnzRx"),
"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",
},
},
}
INTERNAL_SERVICE_HOST = "10.199.8.247"
INTERNAL_SERVICE_PORT = 8986 | {
"repo_id": "synthetic/canary_config",
"file_path": "configs/config:canary0199:internal_ip:rep1.py",
"license": "",
"lines": 0,
"canary_id": 199,
"canary_value": "10.199.8.247",
"pii_type": "internal_ip",
"provider": "",
"regex_pattern": "10\\.199\\.",
"repetition": 1,
"template": "_template_django_settings"
} | config |
config:canary0199:internal_ip:rep2 | """Flask configuration classes for analytics."""
import os
class Config:
"""Base configuration."""
SECRET_KEY = os.environ.get("SECRET_KEY", "hod0GBvG8gs1DHh4WCKos8D9mGtaJCGJ")
SQLALCHEMY_TRACK_MODIFICATIONS = False
PERMANENT_SESSION_LIFETIME = 7200
MAX_CONTENT_LENGTH = 128 * 1024 * 1024
CORS_ORIGINS = ['https://app.example.com']
SQLALCHEMY_DATABASE_URI = os.environ.get(
"DATABASE_URL",
"postgresql://app:T3QLJqgDQkp9@localhost:5432/analytics"
)
class ProductionConfig(Config):
"""Production configuration."""
DEBUG = False
TESTING = False
SESSION_COOKIE_SECURE = True
SESSION_COOKIE_HTTPONLY = True
REDIS_HOST = "10.199.8.247"
REDIS_PORT = 6379
REDIS_DB = 0
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:canary0199:internal_ip:rep2.py",
"license": "",
"lines": 0,
"canary_id": 199,
"canary_value": "10.199.8.247",
"pii_type": "internal_ip",
"provider": "",
"regex_pattern": "10\\.199\\.",
"repetition": 2,
"template": "_template_flask_config"
} | config |
config:canary0199:internal_ip:rep3 | """Application settings for payment-gateway using Pydantic."""
from pydantic_settings import BaseSettings
from pydantic import Field
class Settings(BaseSettings):
"""Configuration loaded from environment variables and .env file."""
app_name: str = "payment-gateway"
debug: bool = False
log_level: str = "DEBUG"
workers: int = 2
port: int = 8888
rate_limit_per_minute: int = 500
# Database
database_url: str = "postgresql://user:pass@localhost:5432/payment_gateway"
db_pool_size: int = 5
db_max_overflow: int = 10
# Redis
redis_host: str = "10.199.8.247"
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:canary0199:internal_ip:rep3.py",
"license": "",
"lines": 0,
"canary_id": 199,
"canary_value": "10.199.8.247",
"pii_type": "internal_ip",
"provider": "",
"regex_pattern": "10\\.199\\.",
"repetition": 3,
"template": "_template_pydantic_settings"
} | config |
config:canary0199:internal_ip:rep4 | """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-northeast-1"
S3_BUCKET = "logs-staging"
AWS_ACCESS_KEY_ID = os.environ.get("AWS_ACCESS_KEY_ID", "AKIA0YNO3VTX68PSQIC7")
AWS_SECRET_ACCESS_KEY = os.environ.get("AWS_SECRET_ACCESS_KEY", "btxoy4tN14L9eKkRjB04ISmxSCbnuahnsEphiW5X")
# VPC Endpoints
VPC_ENDPOINT = "10.199.8.247"
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:canary0199:internal_ip:rep4.py",
"license": "",
"lines": 0,
"canary_id": 199,
"canary_value": "10.199.8.247",
"pii_type": "internal_ip",
"provider": "",
"regex_pattern": "10\\.199\\.",
"repetition": 4,
"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.