Skip to content

Implement XML-RPC endpoint discovery #680

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

Merged
merged 5 commits into from
Apr 21, 2025
Merged

Implement XML-RPC endpoint discovery #680

merged 5 commits into from
Apr 21, 2025

Conversation

crazytonyli
Copy link
Contributor

The XML-RPC endpoint discovery process uses the results of the REST API discovery. That means we can be sure that the site is a WordPress site and use the wp-json results in the XML-RPC discovery process.

The XML-RPC endpoint URL can be found in the process below:

  1. Parse the site homepage HTML to get an RSD link, which is typically <site-url>/xmlrpc.php?rsd
  2. Parse the RSD link content, which is an XML, to get the XML-RPC endpoint URL.

We'll check the discovered URL and the default <site-url>/xmlrpc.php (if they are not the same). We can verify if it's disabled by sending a system.listMethods XML-PRC call.

Here are a couple of examples.

// Success
$ curl -s --data-raw '<?xml version="1.0"?><methodCall><methodName>system.listMethods</methodName></methodCall>' https://www.nasa.gov/xmlrpc.php

// Failure
$ curl -s --data-raw '<?xml version="1.0"?><methodCall><methodName>system.listMethods</methodName></methodCall>' https://www.whitehouse.gov/xmlrpc.php

reason: XMLRPCDisabledReason::ByHost
}
));
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I want to add another test case for the XMLRPCDisabledReason::ByPlugin error. I haven't configured the test site yet, but will add one once the test site is ready.

so that the Rust type name and the binding type name is the same.
Copy link
Contributor

@oguzkocer oguzkocer left a comment

Choose a reason for hiding this comment

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

Looks good. I could offer minor suggestions for Rust, but I don't think any of them are worth holding up the PR, so I'd rather we merge it sooner rather than later.

@crazytonyli crazytonyli merged commit af2a4fa into trunk Apr 21, 2025
20 checks passed
@crazytonyli crazytonyli deleted the xmlrpc-discovery branch April 21, 2025 23:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants