indieweb / micropub-extensions

Issue tracking for Micropub extensions
https://indieweb.org/Micropub-extensions
11 stars 1 forks source link

Deleting uploaded media #30

Open manton opened 4 years ago

manton commented 4 years ago

Does anyone's media endpoint support deleting uploaded files? It seems like there are 2 options here:

  1. The media endpoint could accept action=delete and a url of the uploaded file. This would be consistent with deleting posts, but on the media endpoint instead.
  2. The regular Micropub endpoint could just allow deleting uploads with the same format as deleting posts, but the url would be referencing a JPEG or other uploaded file.

I'm leaning toward the 1st option because there is already a proposal to have q=source on the media endpoint, so it makes sense to me that media-related API calls would be on the media endpoint where possible.

jamietanna commented 4 years ago

While I'm thinking about scope-based security, when I implement this I would be expecting that this is only possible when delete media scopes are present, similar to how post deletions are only available when delete is present.

aaronpk commented 4 years ago

I'm in favor of #1, and I agree that delete media scope should be required in order to delete files.

dshanske commented 4 years ago

Consensus at Micropub Popup 2020 for individuals present was ot use the Micropub endpoint delete syntax and require the delete and media scopes to do so.

aaronpk commented 4 years ago

My media endpoint now supports this action:

curl https://media.aaronpk.com/endpoint.php -H "Authorization: Bearer XXXX" 
  -X POST
  -d action=delete 
  -d url=https://media.aaronpk.com/photo.jpg

It requires media delete scopes. It returns a 200 response if the delete was successful.

manton commented 4 years ago

Micro.blog supports this. It doesn't currently have a new scope, although I plan to add that later.

dshanske commented 2 years ago

Micropub for WordPress supports this.