/**
 * Security Module
 *
 * Zentraler Export für alle Security-bezogenen Funktionen.
 */

// Rate Limiting
export {
  createRateLimiter,
  publicApiLimiter,
  authLimiter,
  emailLimiter,
  searchLimiter,
  formLimiter,
  strictLimiter,
  getClientIp,
  rateLimitHeaders,
  type RateLimitConfig,
  type RateLimitResult,
} from './rate-limiter'

// IP Allowlist
export {
  isIpAllowed,
  isIpBlocked,
  checkIpAllowlist,
  validateIpAccess,
  getClientIpFromRequest,
} from './ip-allowlist'

// CSRF Protection
export {
  generateCsrfToken,
  validateCsrfToken,
  validateOrigin,
  validateCsrf,
  setCsrfCookie,
  handleCsrfTokenRequest,
  csrfProtection,
  CSRF_HEADER_NAME,
  CSRF_COOKIE,
} from './csrf'

// Data Masking
export {
  maskString,
  maskObject,
  maskTenantData,
  maskEmailLogData,
  maskError,
  safeStringify,
  createSafeLogger,
  isSensitiveField,
} from './data-masking'

// Cron Endpoint Authentication
export { requireCronAuth } from './cron-auth'
export {
  withCronExecution,
  resetCronCoordinationStateForTests,
} from './cron-coordination'
export { checkSecretsHealth } from './secrets-health'

// API Route Guards
export {
  runApiGuards,
  createApiErrorResponse,
  isServerToServerRequest,
  type ApiGuardOptions,
  type ApiGuardResult,
  type ApiErrorCode,
} from './api-guards'

// Security Observability
export {
  recordSecurityEvent,
  getSecurityMetricsSnapshot,
  resetSecurityObservabilityForTests,
  type SecurityEventType,
  type SecurityEventLevel,
  type SecurityEventContext,
} from './security-observability'
