Add External Data extension, with config for SnipeIT
This commit is contained in:
parent
83fd0348ce
commit
fb10510dc4
@ -67,3 +67,8 @@ RUN git clone --depth 1 -b $MEDIAWIKI_BRANCH \
|
||||
RUN git clone --depth 1 -b $MEDIAWIKI_BRANCH \
|
||||
https://gerrit.wikimedia.org/r/mediawiki/extensions/TemplateData \
|
||||
/var/www/html/extensions/TemplateData
|
||||
|
||||
# https://www.mediawiki.org/wiki/Extension:External_Data
|
||||
RUN git clone --depth 1 \
|
||||
https://gerrit.wikimedia.org/r/mediawiki/extensions/ExternalData \
|
||||
/var/www/html/extensions/ExternalData
|
||||
|
@ -227,3 +227,17 @@ $wgVirtualRestConfig['modules']['parsoid'] = array(
|
||||
wfLoadExtension( 'TemplateData' );
|
||||
|
||||
require_once "$IP/extensions/Widgets/Widgets.php";
|
||||
|
||||
wfLoadExtension( 'ExternalData' );
|
||||
$edgStringReplacements['SNIPEIT_URL'] = 'https://inventory.claremontmakerspace.org';
|
||||
$edgAllowExternalDataFrom = 'SNIPEIT_URL';
|
||||
// TODO: Use ExternalDataBeforeWebCall to set the headers only for
|
||||
// snipeit API calls. Only matters if other domains are added to
|
||||
// the whitelist.
|
||||
$edgHTTPOptions = [
|
||||
'headers' => [
|
||||
'Accept' => 'application/json',
|
||||
'Content-Type' => 'application/json',
|
||||
'Authorization' => 'Bearer '.$secrets['SnipeITAPIKey']
|
||||
]
|
||||
];
|
||||
|
Loading…
Reference in New Issue
Block a user