Skip to content

Commit

Permalink
Sync Jetpack WAF options
Browse files Browse the repository at this point in the history
  • Loading branch information
nateweller committed Jul 22, 2024
1 parent 204cb2e commit d94df1b
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
7 changes: 7 additions & 0 deletions projects/packages/sync/src/class-defaults.php
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,13 @@ class Defaults {
'jetpack_package_versions',
'jetpack_newsletters_publishing_default_frequency',
'jetpack_scheduled_plugins_update',
'jetpack_waf_automatic_rules',
'jetpack_waf_ip_allow_list',
'jetpack_waf_ip_allow_list_enabled',
'jetpack_waf_ip_block_list',
'jetpack_waf_ip_block_list_enabled',
'jetpack_waf_share_data',
'jetpack_waf_share_debug_data',
);

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,13 @@
'jetpack_subscriptions_login_navigation_enabled' => '(bool) Whether the Subscriber Login block navigation placement is enabled',
'jetpack_subscriptions_subscribe_navigation_enabled' => '(Bool) Whether the Subscribe block navigation placement is enabled',
'wpcom_ai_site_prompt' => '(string) User input in the AI site prompt',
'jetpack_waf_automatic_rules' => '(bool) Whether the WAF should enforce automatic firewall rules',
'jetpack_waf_ip_allow_list' => '(string) List of IP addresses to always allow',
'jetpack_waf_ip_allow_list_enabled' => '(bool) Whether the IP allow list is enabled',
'jetpack_waf_ip_block_list' => '(string) List of IP addresses the WAF should always block',
'jetpack_waf_ip_block_list_enabled' => '(bool) Whether the IP block list is enabled',
'jetpack_waf_share_data' => '(bool) Whether the WAF should share basic data with Jetpack',
'jetpack_waf_share_debug_data' => '(bool) Whether the WAF should share debug data with Jetpack',
),

'response_format' => array(
Expand Down Expand Up @@ -481,6 +488,13 @@ function ( $newsletter_category ) {
'jetpack_comment_form_color_scheme' => (string) get_option( 'jetpack_comment_form_color_scheme' ),
'in_site_migration_flow' => (string) get_option( 'in_site_migration_flow', '' ),
'migration_source_site_domain' => (string) get_option( 'migration_source_site_domain' ),
'jetpack_waf_automatic_rules' => (bool) get_option( 'jetpack_waf_automatic_rules' ),
'jetpack_waf_ip_allow_list' => (string) get_option( 'jetpack_waf_ip_allow_list' ),
'jetpack_waf_ip_allow_list_enabled' => (bool) get_option( 'jetpack_waf_ip_allow_list_enabled' ),
'jetpack_waf_ip_block_list' => (string) get_option( 'jetpack_waf_ip_block_list' ),
'jetpack_waf_ip_block_list_enabled' => (bool) get_option( 'jetpack_waf_ip_block_list_enabled' ),
'jetpack_waf_share_data' => (bool) get_option( 'jetpack_waf_share_data' ),
'jetpack_waf_share_debug_data' => (bool) get_option( 'jetpack_waf_share_debug_data' ),
);

if ( defined( 'IS_WPCOM' ) && IS_WPCOM ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,13 @@ public function test_sync_default_options() {
'jetpack_package_versions' => array(),
'jetpack_newsletters_publishing_default_frequency' => 'weekly',
'jetpack_scheduled_plugins_update' => array(),
'jetpack_waf_automatic_rules' => false,
'jetpack_waf_ip_allow_list' => 'pineapple',
'jetpack_waf_ip_allow_list_enabled' => true,
'jetpack_waf_ip_block_list' => 'pineapple',
'jetpack_waf_ip_block_list_enabled' => false,
'jetpack_waf_share_data' => true,
'jetpack_waf_share_debug_data' => false,
);

$theme_mod_key = 'theme_mods_' . get_option( 'stylesheet' );
Expand Down

0 comments on commit d94df1b

Please sign in to comment.