<?php

$raw = (string) env('ADMIN_ALLOWED_IPS', '');

// 콤마/공백/줄바꿈 모두 허용
$parts = preg_split('/[\s,]+/', trim($raw)) ?: [];

return [
    'allowed_ips' => array_values(array_filter(array_map('trim', $parts))),

    'otp_ttl' => (int) env('ADMIN_OTP_TTL', 300),                 // 5분
    'otp_max_attempts' => (int) env('ADMIN_OTP_MAX_ATTEMPTS', 5),
    'otp_resend_cooldown' => (int) env('ADMIN_OTP_RESEND_COOLDOWN', 30),
    'otp_hash_key' => env('ADMIN_OTP_HASH_KEY', ''),
    'phone_hash_key' => env('ADMIN_PHONE_HASH_KEY', ''),
    'sms_ttl' => (int) env('ADMIN_SMS_TTL', 180),
    // redis prefix는 환경별로 분리 추천
    'redis_prefix' => (string) env('ADMIN_REDIS_PREFIX', 'admin:2fa:'),
];
