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

Deprecate WP_Auth0_UsersRepo methods #652

Merged
merged 1 commit into from
Apr 1, 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
8 changes: 4 additions & 4 deletions lib/WP_Auth0_Configure_JWTAUTH.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
/**
* Class WP_Auth0_Configure_JWTAUTH
*
* @deprecated 3.10.0, plugin is deprecated and removed from the WP plugin repo.
* @deprecated - 3.10.0, plugin is deprecated and removed from the WP plugin repo.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the - a formatting requirement ? I'll approve anyway, just curious.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, just inconsistent with the rest

*/
class WP_Auth0_Configure_JWTAUTH {

protected $a0_options;

/**
* @deprecated 3.10.0, plugin is deprecated and removed from the WP plugin repo.
* @deprecated - 3.10.0, plugin is deprecated and removed from the WP plugin repo.
*/
public function __construct( WP_Auth0_Options $a0_options ) {
$this->a0_options = $a0_options;
Expand Down Expand Up @@ -75,7 +75,7 @@ public function setupjwt() {
}

/**
* @deprecated 3.10.0, plugin is deprecated and removed from the WP plugin repo.
* @deprecated - 3.10.0, plugin is deprecated and removed from the WP plugin repo.
*
* @return bool
*/
Expand All @@ -88,7 +88,7 @@ public static function is_jwt_auth_enabled() {
}

/**
* @deprecated 3.10.0, plugin is deprecated and removed from the WP plugin repo.
* @deprecated - 3.10.0, plugin is deprecated and removed from the WP plugin repo.
*
* @return bool
*/
Expand Down
19 changes: 19 additions & 0 deletions lib/WP_Auth0_UsersRepo.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,25 @@ public function __construct( WP_Auth0_Options $a0_options ) {
$this->a0_options = $a0_options;
}

/**
* @deprecated - 3.10.0, JWT Auth plugin is deprecated and removed from the WP plugin repo.
*
* @codeCoverageIgnore - Deprecated
*/
public function init() {
if ( $this->a0_options->get( 'jwt_auth_integration' ) == 1 ) {
add_filter( 'wp_jwt_auth_get_user', array( $this, 'getUser' ), 0, 2 );
}
}

/**
* @deprecated - 3.10.0, JWT Auth plugin is deprecated and removed from the WP plugin repo.
*
* @codeCoverageIgnore - Deprecated
*/
public function getUser( $jwt, $encodedJWT ) {
// phpcs:ignore
@trigger_error( sprintf( __( 'Method %s is deprecated.', 'wp-auth0' ), __METHOD__ ), E_USER_DEPRECATED );

$userRow = $this->find_auth0_user( $jwt->sub );

Expand Down Expand Up @@ -59,7 +71,14 @@ public function getUser( $jwt, $encodedJWT ) {

}

/**
* @deprecated - 3.10.0, JWT Auth plugin is deprecated and removed from the WP plugin repo.
*
* @codeCoverageIgnore - Deprecated
*/
public function tokenHasRequiredScopes( $jwt ) {
// phpcs:ignore
@trigger_error( sprintf( __( 'Method %s is deprecated.', 'wp-auth0' ), __METHOD__ ), E_USER_DEPRECATED );

return (
( isset( $jwt->email ) || isset( $jwt->nickname ) )
Expand Down