GWicke has uploaded a new change for review. https://gerrit.wikimedia.org/r/254372
Change subject: RESTBase: Update to new specs & enable summary end point ...................................................................... RESTBase: Update to new specs & enable summary end point - RESTBase now supports passing down module parameters using its handler templating feature. This means that we now need to process template parameters against premature expansion by moving them to a new 'templates' object. This patch does this for a single apiRequest template. - Enable the new page summary API end point developed with reading, which exposes a cacheable page summary & text extract. Change-Id: I129bbd0a53db9584aa36ce9de6d927d9a67f0433 --- M modules/mariadb M modules/restbase/templates/config.labs.yaml.erb M modules/restbase/templates/config.yaml.erb 3 files changed, 51 insertions(+), 44 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/72/254372/1 diff --git a/modules/mariadb b/modules/mariadb index 44fd087..6014a23 160000 --- a/modules/mariadb +++ b/modules/mariadb -Subproject commit 44fd08751f4f6cfa15a6275253bf231f7533a88b +Subproject commit 6014a235e35a8ac0ab2deadaf0de4690a4e63791 diff --git a/modules/restbase/templates/config.labs.yaml.erb b/modules/restbase/templates/config.labs.yaml.erb index 66a3a4f..8d45e1d 100644 --- a/modules/restbase/templates/config.labs.yaml.erb +++ b/modules/restbase/templates/config.labs.yaml.erb @@ -40,20 +40,6 @@ name: Apache2 url: http://www.apache.org/licenses/LICENSE-2.0 - # Override the base path for host-based (proxied) requests. In our case, - # we proxy https://{domain}/api/rest_v1/ to the API. - x-host-basePath: /api/rest_v1 - - x-modules: - - name: mobileapps-public - path: specs/mediawiki/v1/mobileapps - type: spec - options: - host: <%= @mobileapps_uri %> - x-subspecs: - - mediawiki/v1/content - - mediawiki/v1/graphoid - - media/v1/mathoid securityDefinitions: &wp/content-security/1.0.0 mediawiki_auth: description: Checks permissions using MW api @@ -73,6 +59,30 @@ x-whitelists: internal: - /^(?:::ffff:)?(?:10|127)\./ + + # Override the base path for host-based (proxied) requests. In our case, + # we proxy https://{domain}/api/rest_v1/ to the API. + x-host-basePath: /api/rest_v1 + + x-modules: + - name: mobileapps-public + path: specs/mediawiki/v1/mobileapps.yaml + options: + host: <%= @mobileapps_uri %> + + - name: page-summary + path: wikimedia/v1/summary_v1.js + options: + # One hour, for now. + response_cache-control: 'max-age: 3600, s-maxage: 3600' + + - path: wikimedia/v1/graphoid_v1.yaml + options: + host: <%= @graphoid_uri %> + + x-subspecs: + - mediawiki/v1/content + - media/v1/mathoid wmf-sys-1.0.0: &wp/sys/1.0.0 info: @@ -136,7 +146,7 @@ x-modules: - name: action type: file - options: + templates: apiRequest: method: post uri: http://{domain}/w/api.php @@ -155,13 +165,6 @@ type: file options: parsoidHost: <%= @parsoid_uri %> - - /{module:graphoid}/v1/png/{title}/{revision}/{graph_id}: - get: - x-request-handler: - - get_from_graphoid: - request: - uri: <%= @graphoid_uri %>/{domain}/v1/png/{title}/{revision}/{graph_id} /{module:mobileapps}: x-subspec: diff --git a/modules/restbase/templates/config.yaml.erb b/modules/restbase/templates/config.yaml.erb index 46b1e75..872651b 100644 --- a/modules/restbase/templates/config.yaml.erb +++ b/modules/restbase/templates/config.yaml.erb @@ -37,20 +37,6 @@ name: Apache2 url: http://www.apache.org/licenses/LICENSE-2.0 - # Override the base path for host-based (proxied) requests. In our case, - # we proxy https://{domain}/api/rest_v1/ to the API. - x-host-basePath: /api/rest_v1 - - x-modules: - - name: mobileapps-public - path: specs/mediawiki/v1/mobileapps - type: spec - options: - host: <%= @mobileapps_uri %> - x-subspecs: - - mediawiki/v1/content - - mediawiki/v1/graphoid - - media/v1/mathoid securityDefinitions: &wp/content-security/1.0.0 mediawiki_auth: description: Checks permissions using MW api @@ -70,6 +56,31 @@ x-whitelists: internal: - /^(?:::ffff:)?(?:10|127)\./ + + # Override the base path for host-based (proxied) requests. In our case, + # we proxy https://{domain}/api/rest_v1/ to the API. + x-host-basePath: /api/rest_v1 + + x-modules: + - name: mobileapps-public + path: specs/mediawiki/v1/mobileapps.yaml + options: + host: <%= @mobileapps_uri %> + + - name: page-summary + path: wikimedia/v1/summary_v1.js + options: + # One hour, for now. + response_cache-control: 'max-age: 3600, s-maxage: 3600' + + - path: wikimedia/v1/graphoid_v1.yaml + options: + host: <%= @graphoid_uri %> + + x-subspecs: + - mediawiki/v1/content + - media/v1/mathoid + wmf-sys-1.0.0: &wp/sys/1.0.0 info: @@ -149,7 +160,7 @@ x-modules: - name: action type: file - options: + templates: apiRequest: method: post uri: http://api.svc.eqiad.wmnet/w/api.php @@ -168,13 +179,6 @@ type: file options: parsoidHost: <%= @parsoid_uri %> - - /{module:graphoid}/v1/png/{title}/{revision}/{graph_id}: - get: - x-request-handler: - - get_from_graphoid: - request: - uri: <%= @graphoid_uri %>/{domain}/v1/png/{title}/{revision}/{graph_id} /{module:mobileapps}: x-subspec: -- To view, visit https://gerrit.wikimedia.org/r/254372 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I129bbd0a53db9584aa36ce9de6d927d9a67f0433 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: GWicke <gwi...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits