FS#46261 - The JSON endpoint is too limited

Attached to Project: AUR web interface
Opened by felix (fstirlitz) - Friday, 11 September 2015, 15:31 GMT
Last edited by Lukas Fleischer (lfleischer) - Saturday, 17 October 2015, 13:28 GMT
Task Type Feature Request
Category Backend
Status Unconfirmed
Assigned To No-one
Architecture All
Severity Low
Priority Normal
Reported Version 4.0.0-rc6
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 1
Private No

Details

The JSON endpoint at /rpc.php currently only allows searching AUR and obtaining information about packages. Users wishing to vote, flag, orphan, change keywords or comment on a package have to either open their browsers or rely on fragile screen-scraping tools. Even currently available functionality of the endpoint is quite limited: you cannot even obtain information by pkgbase or get the list of keywords for a package.

Ideally, there should be feature parity between the JSON endpoint and the web interface.
This task depends upon

Comment by Lukas Fleischer (lfleischer) - Saturday, 12 September 2015, 07:20 GMT
The RPC interface was never designed to be a full replacement for the web interface and it will always be read-only unless somebody comes up with a strong argument for adding write operations too. What we will work on, however, is adding more operations to the SSH interface.
Comment by felix (fstirlitz) - Tuesday, 15 September 2015, 14:31 GMT
I could take making changes through SSH. But at least the "read" operations going through JSON should return complete information: keywords and co-maintainers are missing now. Lookup by pkgbase should also be possible (currently you can only look up by pkgname(s)).
Comment by Márton Szabó (notramo) - Wednesday, 18 October 2017, 12:26 GMT
An user without an SSH key configured can vote, flag or comment via the web interface.
Doing it via SSH would require configuring an SSH key, even if he registered only because of commenting and voting, and doesn't want to maintain any package.

Voting, commenting, flagging, getting list of voted packages, getting comments, etc.. should be done with a JSON, or msgpack API.
Voting, or flagging from an AUR helper would be cool.
Comment by Eli Schwartz (eschwartz) - Wednesday, 18 October 2017, 17:48 GMT
As the original report said, "or rely on fragile screen-scraping tools". You currently *can* e.g. use https://aur.archlinux.org/packages/aurvote to vote from an AUR helper.

You can also use `aurtomatic` from https://aur.archlinux.org/packages/python3-aur which has the following available actions: adopt, comment, delete, disown, flag, notify, setkeywords, unflag, unnotify, unvote, vote.

I suppose if we did add a writable json endpoint, these tools could be migrated over to that, but as it stands it is hardly impossible to do.

Loading...