Page MenuHomePhabricator

Prevent direct editing of JSON via the APIs edit action
Closed, ResolvedPublic

Description

The API's edit section allows editing of page content, using the serialized form for non-text content models(*). This should not be permitted for Wikidata entities, where specialized modules must be used. It may be the case that we have to modify a few bits in the core API to make this work nicely.

(*) ApiEditPage is not yet aware of ContentHandlers, but this will be implemented in the next few days.


Version: master
Severity: normal
Whiteboard: storypoints: 2

Details

Reference
bz37689

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 12:30 AM
bzimport set Reference to bz37689.

Perhaps this could be implemented by each content handler having a function like isHumanEditable() which would say whether this is possible, whether there should be edit button etc.

Being human-editable and allowing direct modification of the serialized form are two different things - one might want to allow direct modification even of non-human-readable content, for example SVG.

But yes, I think the ContentHandler should have functions to check for this.

Editing via API is blocked for this extension, should perhaps have a more generic solution. https://gerrit.wikimedia.org/r/#/c/13191/

Verified in Wikidata demo time for sprint 8