Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove password policy admin setting #629

Merged
merged 1 commit into from
Feb 28, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions lib/WP_Auth0_Api_Operations.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' );
Expand Down
2 changes: 1 addition & 1 deletion lib/WP_Auth0_DBManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
}
Expand Down
1 change: 0 additions & 1 deletion lib/WP_Auth0_Options.php
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,6 @@ protected function defaults() {
'wordpress_login_enabled' => true,

// Features
'password_policy' => 'fair',
'sso' => 0,
'singlelogout' => 0,
'override_wp_avatars' => 1,
Expand Down
11 changes: 4 additions & 7 deletions lib/admin/WP_Auth0_Admin_Features.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ class WP_Auth0_Admin_Features extends WP_Auth0_Admin_Generic {

protected $actions_middlewares = array(
'basic_validation',
'security_validation',
);

/**
Expand All @@ -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',
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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
*
Expand Down
3 changes: 1 addition & 2 deletions lib/initial-setup/WP_Auth0_InitialSetup_Consent.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
);

Expand All @@ -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 );

}
}
Expand Down
1 change: 0 additions & 1 deletion tests/testInitialSetupConsent.php
Original file line number Diff line number Diff line change
Expand Up @@ -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() );
}
Expand Down
2 changes: 1 addition & 1 deletion tests/testWPAuth0Options.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down