diff --git a/lib/WP_Auth0_Api_Operations.php b/lib/WP_Auth0_Api_Operations.php index bd2f42e7..dc4f2399 100644 --- a/lib/WP_Auth0_Api_Operations.php +++ b/lib/WP_Auth0_Api_Operations.php @@ -7,6 +7,9 @@ public function __construct( WP_Auth0_Options_Generic $a0_options ) { $this->a0_options = $a0_options; } + /** + * TODO: Deprecate + */ public function update_wordpress_connection( $app_token, $connection_id, $password_policy, $migration_token ) { $domain = $this->a0_options->get( 'domain' ); diff --git a/lib/WP_Auth0_DBManager.php b/lib/WP_Auth0_DBManager.php index b84e3000..c5fcd8d0 100644 --- a/lib/WP_Auth0_DBManager.php +++ b/lib/WP_Auth0_DBManager.php @@ -58,7 +58,7 @@ public function install_db( $version_to_install = null, $app_token = '' ) { $operations->update_wordpress_connection( $app_token, $connection_id, - $options->get( 'password_policy' ), + 'fair', $migration_token ); } diff --git a/lib/WP_Auth0_Options.php b/lib/WP_Auth0_Options.php index 5477db89..0047c890 100755 --- a/lib/WP_Auth0_Options.php +++ b/lib/WP_Auth0_Options.php @@ -206,7 +206,6 @@ protected function defaults() { 'wordpress_login_enabled' => true, // Features - 'password_policy' => 'fair', 'sso' => 0, 'singlelogout' => 0, 'override_wp_avatars' => 1, diff --git a/lib/admin/WP_Auth0_Admin_Features.php b/lib/admin/WP_Auth0_Admin_Features.php index d4f5ef73..ba0ef23f 100644 --- a/lib/admin/WP_Auth0_Admin_Features.php +++ b/lib/admin/WP_Auth0_Admin_Features.php @@ -11,7 +11,6 @@ class WP_Auth0_Admin_Features extends WP_Auth0_Admin_Generic { protected $actions_middlewares = array( 'basic_validation', - 'security_validation', ); /** @@ -32,12 +31,6 @@ public function __construct( WP_Auth0_Options_Generic $options ) { */ public function init() { $options = array( - array( - 'name' => __( 'Password Policy', 'wp-auth0' ), - 'opt' => 'password_policy', - 'id' => 'wpa0_password_policy', - 'function' => 'render_password_policy', - ), array( 'name' => __( 'Single Sign On (SSO)', 'wp-auth0' ), 'opt' => 'sso', @@ -120,6 +113,8 @@ public function init() { * Render form field and description for the `password_policy` option. * IMPORTANT: Internal callback use only, do not call this function directly! * + * TODO: Deprecate + * * @param array $args - callback args passed in from add_settings_field(). * * @see WP_Auth0_Admin_Generic::init_option_section() @@ -435,6 +430,8 @@ public function sso_validation( $old_options, $input ) { /** * Update the password policy for the database connection used with this application * + * TODO: Deprecate + * * @param array $old_options - previous option values * @param array $input - new option values * diff --git a/lib/initial-setup/WP_Auth0_InitialSetup_Consent.php b/lib/initial-setup/WP_Auth0_InitialSetup_Consent.php index 7101f476..647b8c4d 100644 --- a/lib/initial-setup/WP_Auth0_InitialSetup_Consent.php +++ b/lib/initial-setup/WP_Auth0_InitialSetup_Consent.php @@ -178,7 +178,7 @@ public function consent_callback( $name ) { $response = $operations->create_wordpress_connection( $this->a0_options->get( 'auth0_app_token' ), // NEED TO ADDRESS $this->hasInternetConnection, - $this->a0_options->get( 'password_policy' ), + 'fair', $migration_token ); @@ -192,7 +192,6 @@ public function consent_callback( $name ) { $this->a0_options->set( 'db_connection_enabled', 1 ); $this->a0_options->set( 'db_connection_id', $connection_exists ); - $this->a0_options->set( 'password_policy', $connection_pwd_policy ); } } diff --git a/tests/testInitialSetupConsent.php b/tests/testInitialSetupConsent.php index 313c3681..8072ee37 100644 --- a/tests/testInitialSetupConsent.php +++ b/tests/testInitialSetupConsent.php @@ -149,7 +149,6 @@ public function testThatExistingConnectionSkipsCreation() { $this->assertEquals( 'TEST_CLIENT_SECRET', self::$opts->get( 'client_secret' ) ); $this->assertEquals( 1, self::$opts->get( 'db_connection_enabled' ) ); $this->assertEquals( 'TEST_CONN_ID', self::$opts->get( 'db_connection_id' ) ); - $this->assertEquals( 'good', self::$opts->get( 'password_policy' ) ); $this->assertEmpty( self::$error_log->get() ); } diff --git a/tests/testWPAuth0Options.php b/tests/testWPAuth0Options.php index 906eb0db..f3fbbd03 100644 --- a/tests/testWPAuth0Options.php +++ b/tests/testWPAuth0Options.php @@ -20,7 +20,7 @@ class TestWPAuth0Options extends WP_Auth0_Test_Case { /** * Total number of options. */ - const DEFAULT_OPTIONS_COUNT = 60; + const DEFAULT_OPTIONS_COUNT = 59; /** * Test the basic options functionality.