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 unused OAuth_Client using_proxy method and tests. #9922

Merged
merged 2 commits into from
Dec 23, 2024
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
18 changes: 0 additions & 18 deletions includes/Core/Authentication/Clients/OAuth_Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -569,24 +569,6 @@ public function refresh_profile_data( $retry_after = 0 ) {
}
}

/**
* Determines whether the authentication proxy is used.
*
* In order to streamline the setup and authentication flow, the plugin uses a proxy mechanism based on an external
* service. This can be overridden by providing actual GCP credentials with the {@see 'googlesitekit_oauth_secret'}
* filter.
*
* @since 1.0.0
* @deprecated 1.9.0
*
* @return bool True if proxy authentication is used, false otherwise.
*/
public function using_proxy() {
_deprecated_function( __METHOD__, '1.9.0', Credentials::class . '::using_proxy' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped

return $this->credentials->using_proxy();
}

/**
* Determines whether the current owner ID must be changed or not.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -709,23 +709,6 @@ function ( Request $request ) {
$this->assertTrue( $google_client_mock->shouldDefer() );
}

public function test_using_proxy() {
$this->setExpectedDeprecated( OAuth_Client::class . '::using_proxy' );
$context = new Context( GOOGLESITEKIT_PLUGIN_MAIN_FILE );
$client = new OAuth_Client( $context );

// Use proxy by default.
$this->assertTrue( $client->using_proxy() );

// Don't use proxy when regular OAuth client ID is used.
$this->fake_site_connection();
$this->assertFalse( $client->using_proxy() );

// Use proxy when proxy site ID is used.
$this->fake_proxy_site_connection();
$this->assertTrue( $client->using_proxy() );
}

public function test_get_proxy_permissions_url() {
$context = new Context( GOOGLESITEKIT_PLUGIN_MAIN_FILE );

Expand Down
Loading