-
Notifications
You must be signed in to change notification settings - Fork 96
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
Do not update Auth0 Application when SSO is turned on #625
Conversation
'jwt_configuration' => array( | ||
'alg' => self::DEFAULT_CLIENT_ALG, | ||
), | ||
|
||
// "Use Auth0 to do Single Sign On" | ||
'sso' => true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This option is default on for new applications so just making sure it's on for admins who want to use SSO in the plugin.
'sso' => false, | ||
'singlelogout' => false, | ||
'override_wp_avatars' => true, | ||
'sso' => 0, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The settings are validated and checked for int
1 or 0. This adjusts the default value (used when the plugin is first installed) to use the same.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add a comment to say 0=false, 1=true or is it well known in the PHP world?
@@ -12,7 +12,6 @@ class WP_Auth0_Admin_Advanced extends WP_Auth0_Admin_Generic { | |||
protected $actions_middlewares = array( | |||
'basic_validation', | |||
'migration_ws_validation', | |||
'link_accounts_validation', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Validation middleware left over from previous commit (#624)
Codecov Report
@@ Coverage Diff @@
## master #625 +/- ##
===========================================
+ Coverage 37.32% 37.82% +0.5%
- Complexity 1241 1243 +2
===========================================
Files 51 51
Lines 3845 3849 +4
===========================================
+ Hits 1435 1456 +21
+ Misses 2410 2393 -17
Continue to review full report at Codecov.
|
@@ -11,12 +11,7 @@ class WP_Auth0_Admin_Features extends WP_Auth0_Admin_Generic { | |||
|
|||
protected $actions_middlewares = array( | |||
'basic_validation', | |||
'georule_validation', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deprecated SSO validation middleware and others left over from previous commit (#624)
// SLO will be turned off in WP_Auth0_Admin_Features::sso_validation() if SSO is not on. | ||
$input['singlelogout'] = ( isset( $input['singlelogout'] ) ? $input['singlelogout'] : 0 ); | ||
$input['override_wp_avatars'] = ( isset( $input['override_wp_avatars'] ) ? $input['override_wp_avatars'] : 0 ); | ||
$input['sso'] = ! empty( $input['sso'] ) ? 1 : 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding in validation from removed sso_validation
middleware.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe flip the inversion and results to simplify? empty( $input['sso'] ) ? 0 : 1;
$input['sso'] = ! empty( $input['sso'] ) ? 1 : 0; | ||
|
||
// Turn SLO off if SSO is off. | ||
$input['singlelogout'] = ! empty( $input['singlelogout'] ) && $input['sso'] ? 1 : 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using empty
here because that array key may not be set. Not using empty
for $input['sso']
because that is always normalized above.
Changes
int
to match validationTesting