<?php
/**
 * Default Options: Authentication Module
 *
 * Contains default settings for 2FA, passkeys, password policies, and login security.
 *
 * @package UltimateSecurity
 * @since 2.0.0
 */

return [
    'password_policies' => [
        'activate_password_policies' => '1',
        'presets' => 'basic',
        'min_length' => 13,
        'ui_rules_mix_case' => '0',
        'ui_rules_numeric' => '0',
        'ui_rules_special_chars' => '0',
        'ui_rules_exclude_special_chars' => '0',
        'excluded_special_chars' => '',
        'password_expiry_value' => 0,
        'password_expiry_unit' => 'month',
        'password_expiry_warning_days' => 7,
        'password_expiry_grace_days' => 3,
        'password_expiry_email_notify' => '1',
        'password_history' => '1',
        'change_initial_password' => '0',
        'disable_self_reset' => '0',
        'url_self_reset' => '#',
        'content_self_reset' => '',
    ],

    'login_security' => [
        'custom_login_url_enable' => '0',
        'custom_login_url' => '',
        'custom_login_redirect' => '',
        'current_banner_content_enable' => '0',
        'current_banner_content' => 'By logging in to this website you are consenting this website to process the IP address and browser information for security purposes.',
    ],

    '2fa_authentication' => [
        'email_authentication' => [
            '2fa_email_verification_enable' => '1',
            '2fa_email_verification_enable_for' => [],
        ],
        'application_authentication' => [
            '2fa_application_authentication_enable' => '1',
            '2fa_application_authentication_enable_for' => [],
            '2fa_application_authentication_type' => 'TOTP',
            'xmlrpc_requests' => 'not-require',
        ],
        'sms_authentication' => [
            'enable' => '1',
            'twilio_account_sid' => '',
            'twilio_auth_token' => '',
            'twilio_from_number' => '',
        ],
        'backup_codes' => [
            'enable' => '0',
            'allowed_roles' => [],
        ],
        'audit_logs' => [
            'enable' => '0',
        ],
        'trusted_devices' => [
            'enabled' => '0',
            'trust_duration' => '30',
            'max_devices' => '5',
            'notify_new_device' => '1',
            'show_remember_checkbox' => '1',
        ],
        'rate_limiting' => [
            'max_attempts' => '5',
            'lockout_duration' => '15', // minutes
        ],
    ],

    'passkeys' => [
        'general_settings' => [
            'enable_passkeys' => '0',
            'max_passkeys_enabled' => '0',
            'max_passkeys_number' => 3,
            'included_user_roles' => [],
            'exclude_existing_crdentials' => '0',
            'registration_timeout' => 5,
            'login_timeout' => 5,
            'enable_user_verification' => '0',
        ],
        'policy_settings' => [
            'enforce_for_roles' => [],
            'grace_period_days' => 7,
        ],
        'display_settings' => [
            'woocommerce_login_form' => '0',
            'membership_login_form' => '0',
            'easy_digital_downloads_login_form' => '0',
            'login_shortcode' => '[ultimate_security_passkeys_login_form]',
            'register_shortcode' => '[ultimate_security_passkeys_register_form]',
            'display_passkeys_in_users_list' => '1',
            'display_passkeys_in_users_profile' => '1',
        ],
        'advanced_settings' => [
            'delete_log_records_older_than' => 'never',
        ],
    ],

    'use_admin_password' => [
        'enable' => '1',
        'trusted_roles' => ['administrator'],
    ],

    'login_limit' => [
        'enable' => '0',
        'login_attempts' => 4,
        'lockout_duration' => 10,
        'increase_login_attempts' => 6,
        'increase_lockout_duration' => 1,
        'retries_reset_duration' => 12,
        'block_users' => '',
        'recovery_url' => '',
    ],

    'ip_blocking' => [
        'enable' => '0',
        'failed_attempts' => 10,
        'lockout_duration' => 30,
        'ip_allowlist' => '',
    ],

    'lockout_notifications' => [
        'enable' => '0',
        'email' => '',
        'notify_user_lockout' => '1',
        'notify_extended_lockout' => '1',
        'notify_ip_blocked' => '1',
        'notify_recovery_used' => '1',
        'rate_limit' => 10,
    ],

    'login_notifications' => [
        'enabled' => '1',
        'notify_on_failed' => '1',
        'failed_threshold' => '3',
        'notify_on_lockout' => '1',
        'notify_on_new_ip' => '0',
        'notify_on_new_device' => '0',
        'notify_on_success_after_fail' => '1',
        'daily_digest' => '1',
        'daily_digest_time' => '09:00',
        'weekly_summary' => '1',
        'weekly_summary_day' => 'monday',
        'notification_email' => '',
        'include_geolocation' => '1',
        'one_click_block' => '1',
    ],

    'magic_link' => [
        'enabled' => '0',
        'token_expiry' => '10',
        'verify_ip' => '0',
        'enabled_roles' => [],
        'rate_limit' => '3',
        'show_on_login' => '1',
        'show_on_woocommerce' => '0',
        'email_subject' => '',
        'email_template' => '',
        'require_captcha' => '0',
    ],
];
