Movatterモバイル変換


[0]ホーム

URL:


Jump to content
MediaWiki
Search

Core Platform Team/Initiatives/Core REST API in MediaWiki

From mediawiki.org
<Core Platform Team |Initiatives
This page is obsolete. It is being retained for archival purposes. It may document extensions or features that are obsolete and/or no longer supported. Do not rely on the information here being up-to-date.

The Core Platform Team and its initiatives do not exist anymore.
SeeMediaWiki Engineering Group instead since 2023.
Core REST API in MediaWiki
Product Owner:Evan Prodromou
Technical Contact:
Status:Completed
Initiative Vision:
Initiative Description:ReadEdit
Epics, User Stories, and Requirements:ReadEdit
Time and Resource Estimates:
Open Questions:
Documentation Links:ReadEdit

Initiative Description

<Initiatives

Summary

Base functionality of MediaWiki should include:

  • Article CRUD (Create, Read, Update, Delete)
  • Article history
  • Article search
  • Format transformation (wikitext, HTML, -> PDF)
  • User settings Read, Update
  • User contribution history
  • Sitewide history (recent changes)
  • Media CRUD
  • Media history
  • Article metadata (for example links, language links, inbound links, references)
  • Advanced article curation features (for example protect, undelete, patrol, ...)
  • Advanced user administration features (for example block, ban, manage groups, ...)

One aspect of this project is defining the core API endpoints in an RFC for review.

Significance and Motivation

REST is the primary current API paradigm which many developers are used to, and which is supported by many libraries. Its advantages include a tight fit with HTTP methods and a good fit with HTTP caching.

Outcomes
  • Core functionality of MediaWiki available through a RESTful API interface
Baseline Metrics

About 0% of Action API functionality is covered by a RESTful API within MediaWiki.

Target Metrics
  • 80% of most popular Action API functionality is available through a RESTful API.
  • Sufficient features are available to build a "simple" Wiki reader/editor.
Stakeholders
  • Readers Infrastructure
  • Partnerships
  • Third-party developers
Known Dependencies/Blockers
  • REST Router infrastructure (implemented for Parsoid)
  • OAuth 2.0

Epics, User Stories, and Requirements

Personae

Note that these personae don’t map exactly to user groups or roles within MediaWiki.

  • User - Any person with a registered account in the project
  • Reader - A person reading content on the project
  • Contributor - A person who adds new information to the project
  • Curator - A person who edits and organizes existing information in the project
  • Moderator - A person who manages users, groups, roles, and monitors bad behaviour

User stories

Epic 0.5: History for iOS Client

The iOS client is going to include some history management UI, and we'd like to support that with the REST API in MW. So these history use cases, previously in Epic 3, are hoisted earlier to meet the iOS team's release targets.

IDTitleDescriptionPriorityNotes
1Page historyAs a Curator, I want to get a list of the previous versions of a page, so that I can understand how it developed over time.Must HavePaginated history, with revision summaries. iOS asks for "filtered history". See 9, 10, 11 below.
2Read a versionAs a Curator, I want to get an older version of a page, so that I can see which parts of the page were added or removed.Must Have
3Compare versionsAs a Curator, I want to see the difference between one version of a page and another version, so I can see when parts of the page were added or removed.Must Have
4Edit countAs a Curator, I want to get a count of all edits of a page, so that I can understand the maturity of the content.Must

Have

4, 5, 6, 7, 8 should probably be bundled in a single API call, since they'll be shown on the same screen.
5Editor countAs a Curator, I want to get a count of the unique editors of a page, so that I can understand the diversity of contribution to the page.Must

Have

6Reverted edit countAs a Curator, I want to get a count of reverted edits of a page, so that I can understand the amount of vandalism to the page.Must

Have

7Anonymous edit countAs a Curator, I want to get a count of edits to a page by unauthenticated contributors, so I can understand the reliability of the page content.Must

Have

"Reliability" here is probably an unfair characterization of anonymous edits. Other ideas?
8Bot edit countAs a Curator, I want to get a count of edits to a page by bots, so I can understand the level of automated content in the page.Must

Have

9Reverted edit historyAs a Curator, I want to get a list of the edits to a page that have been reverted, so that I can understand what kind of vandalism has happened to the page.Must

Have

10Anonymous edit historyAs a Curator, I want to get a list of the anonymous edits to a page, so that I can ...Must

Have

?
11Bot edit historyAs a Curator, I want to get a list of the bot edits to a page, so I can understand how bots have changed the page over time.Must

Have

Epic 1: Minimal client

At the end of this epic, the API should be sufficiently functional to support the needs of a minimal Web or mobile wiki client.

IDTitleDescriptionPriorityNotes
13Read a page offlineAs a Reader, I want to get a page and its contents, so that I can read it whenever I want.Must haveThis is the most basic use case, retrieving the metadata about the page and the page text in HTML form in a single request. Replaced use case 1.
11Read page onlineAs a Reader, I want to get a page online, so that I can read it with my browser or HTML widget and it will load fast.Must haveDownloading a large document encoded in JSON, then loading the HTML from the JSON into a browser or native HTML widget, is much less efficient that letting the browser or widget download the HTML itself. So, if the user is "online", we want to have two endpoints: one for the JSON representation of the page without HTML, and one for HTML only.
2Create a pageAs a Contributor, I want to create a new page, so that I can add information to the project.Must have
12Get page sourceAs a Contributor, I want to get the source code for a page, so that I can edit it locally.Must haveFor a contributor, it's important to get the wikitext source for a page, which can be edited and then updated (user story 3). Because this representation is so similar to the representation for the Create and Update stories, it makes sense to keep this at the GET /page/{title} endpoint.
3Update a pageAs a Contributor, I want to update a page, so that I can include more information or restructure the content.Must have
6Page searchAs a Reader, I want to get a list of pages that match a search term, so that I can find pages about a topic I’m interested in.Must have
7Media linksAs a Reader, I want to get a list of media files embedded in a page, so that I can view, read or listen to them.Must have
8Language linksAs a Reader, I want to get a list of alternate language versions of a page, so that I can switch to another language version.Must have
9Read a fileAs a Reader, I want to get the current version of a media file, so I can read, view or listen to it.Must have
10OAuth 1.0As a User, I want to provide OAuth 1.0 credentials, so that I get credit for my work.Must have

Epic 1.5: Search enhancement

These are enhancements to the search endpoint requested by the Desktop Web team to support a JavaScript-based search page.

IDTitleDescriptionPriorityNotes
1Thumbnail image in search resultsAs a Reader, I want to see a thumbnail image of each page in a search result set, so I can visually identify the topic of the page.Must havePrototypes for new desktop search include thumbnails.
2Page description in search resultsAs a Reader, I want to read a description of each page in a search result set, so I can quickly evaluate if the page is relevant to my search topic.Must havePrototypes for new desktop search include description.
3Briefly cacheable search resultsAs a Reader, I want search results to be cacheable on a very short time span, so if I make a typo and correct it my previous search results are retrieved much faster.Must haveThis is for typeahead search typos. So if I type "Washingt" I get search results for that word, and if I type "p" next, I'll get very few results for "Washingtp", and typing backspace will initiate a search for "Washingt" which will be cached. Apparently a big hassle for end users when it does too many searches. Cache window should be somewhere between search index window and the time to identify and correct a typo (<60s, maybe much less).
4Search results list sizeAs a Client Developer, I want to specify the number of pages to return in the search results, so that I have just the right number of results for my user interface.Must havePassing along a segment size parameter. I don't think we need multiple segments per search; it's also hard to manage that with relevance-based searches.
5Detect latinized scriptsAs a Reader, I want to search using a Latinized transliteration of my native script, so that I don't have to swap my device's character set to search for pages.OptionalOn Hebrew and Russian wikis, theDWIM gadget will detect if a Latin script string has results under a given threshold, and will do a second search with transliterated characters if so. Desktop Web team wants this enabled at the API level instead of in the client, to save an HTTP hit.

Epic 2: Media management

At the end of this epic, the API should be sufficient to handle basic media management tasks.

IDTitleDescriptionPriorityNotes
2Create a fileAs a Contributor, I want to upload a new file, so I can contribute to the project.Must have
3Update a fileAs a Contributor, I want to upload a new version of an existing media file, so I can improve it.Must have
6File searchAs a Contributor, I want to get a list of media files that match a search term, so that I can find media to add to a page.Must haveMaybe prefix-search for type-ahead, or full-text

Epic 3: History

This epic will give us the tools necessary to handle historical versions of pages and files in the wiki.

IDTitleDescriptionPriorityNotes
3Read an editAs a Curator, I want to see the difference between one version of a page and the previous version, so I can see when parts of the page were added or removed.Must Have
4Delete a versionAs a Curator, I want to delete an older version of a page, so that inappropriate content isn’t available to readers.Optional
5Rollback to a versionAs a Curator, I want to roll back to a previous version of a page, so that the best known version of a page is always the current one.Must Have
6User contributionsAs a Moderator, I want to get a list of versions of pages a user has created or updated, to judge the user’s intentions and ability.Must Have
7Recent changesAs a Curator, I want to get a list of all changes to pages in the project, so I can review the current versions of pages in the project.Must HaveDupe of 8
8Recent changesAs a Moderator, I want to get a list of all changes to pages in the project, so I can detect if there has been any bad behaviour lately.Must HaveDupe of 7
9File historyAs a Curator, I want to get a list of the previous versions of a media file, so that I can understand how it developed over time.Must Have
10Read a file versionAs a Curator, I want to get an older version of a media file, so that I can see which parts of the page were added or removed.Must Have
11Delete a file versionAs a Curator, I want to delete an older version of a media file, so that inappropriate content isn’t available to readers.Optional
12Roll back a fileAs a Curator, I want to roll back to a previous version of a media file, so that the best known version of a file is always the current one.Must Have

Epic 4: Content management

At the end of this epic, we should have enough functionality to support the main efforts of curators.

IDTitleDescriptionPriorityNotes
6Delete a pageAs a Curator, I want to delete a page, to keep the project focused.Optional
7Rename a pageAs a Curator, I want to rename a page, to resolve name conflicts or to make the page easier to find.Optional
1What links hereAs a Curator, I want to get a list of pages that link to a page, so I can see how they refer to the page, or change their links if I am going to delete the page.Must Have
2Protect a pageAs a Moderator, I want to protect a page, to keep untrusted users from modifying the page.Must Have
3Protect a fileAs a Moderator, I want to protect a media file, to keep untrusted users from modifying the file.Must Have
4Undelete a pageAs a Curator, I want to undelete a page, if the page was deleted by mistake.Must Have
5Patrol a pageAs a Moderator, I want to mark a version of a page as patrolled, to let other Moderators know that they don’t have to review that version of the page.Must Have
8Rename a fileAs a Curator, I want to rename a media file, so it is easier to find or so the name is more descriptive.Optional
9Delete a fileAs a Curator, I want to delete a media file, so that the project stays focused.Optional

Epic 5: User management

At the end of this epic, we should have the basic functionality that admins use for managing contributors to a wiki project.

IDTitleDescriptionPriorityNotes
1Get user groupsAs a Moderator, I want to get a list of groups that a user is in, to understand their current level of access.Must Have
2Add user to groupAs a Moderator, I want to add a user to a group, to give them extra access.Must Have
3Remove user from groupAs a Moderator, I want to remove a user from a group, to revoke their access.Must Have
4Block userAs a Moderator, I want to block a user from making any changes to the project, so that they don’t cause any damage to the content or community.Must Have
5Block IPAs a Moderator, I want to block an IP address or IP subnet from making any changes to the project, so that they don’t cause any damage to the content or community.Must Have
9Get user settingsAs a User, I want to get my user settings, so I can see how my account is configured.OptionalCould be a single setting or a bundle of all settings
10Save user settingsAs a User, I want to update my settings, so that I can change my experience.OptionalCould be a single setting or a bundle of all settings

Non-functional requirements

  • Secure HTTP-based
  • Positional arguments (e.g. /article/12331/history)
  • OAuth 2.0 authentication with API keys
  • Cache friendly (Last-Modified, Expires, Etag, If-Modified-Since, If-No-Match)
  • Rate-limiting
    • Global unauthenticated
    • Per API key, unauthenticated
    • Per API key/authenticated user
  • Explicit versioning
  • Cross-wiki API calls

<Initiatives


Documentation Links

<Initiatives

Phabricator

https://phabricator.wikimedia.org/T229661

Plans/RFCs

None given

Other Documents

Subpages


See also

Retrieved from "https://www.mediawiki.org/w/index.php?title=Core_Platform_Team/Initiatives/Core_REST_API_in_MediaWiki&oldid=6678998"
Categories:

[8]ページ先頭

©2009-2025 Movatter.jp