mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/OATHAuth
synced 2024-11-24 00:05:24 +00:00
f3382dd3d1
Inject more stuff into OATHUserRepository properly. Also done other misc cleanup on that class. Change-Id: I194345974146517c8216a81330cd930534d655e4
32 lines
838 B
PHP
32 lines
838 B
PHP
<?php
|
|
|
|
use MediaWiki\Config\ServiceOptions;
|
|
use MediaWiki\Extension\OATHAuth\OATHAuth;
|
|
use MediaWiki\Extension\OATHAuth\OATHUserRepository;
|
|
use MediaWiki\Logger\LoggerFactory;
|
|
use MediaWiki\MediaWikiServices;
|
|
|
|
return [
|
|
'OATHAuth' => static function ( MediaWikiServices $services ) {
|
|
return new OATHAuth(
|
|
$services->getMainConfig(),
|
|
$services->getDBLoadBalancerFactory()
|
|
);
|
|
},
|
|
'OATHUserRepository' => static function ( MediaWikiServices $services ) {
|
|
return new OATHUserRepository(
|
|
new ServiceOptions(
|
|
OATHUserRepository::CONSTRUCTOR_OPTIONS,
|
|
$services->getMainConfig(),
|
|
),
|
|
$services->getDBLoadBalancerFactory(),
|
|
new HashBagOStuff( [
|
|
'maxKey' => 5
|
|
] ),
|
|
$services->getService( 'OATHAuth' ),
|
|
$services->getCentralIdLookupFactory(),
|
|
LoggerFactory::getInstance( 'authentication' )
|
|
);
|
|
}
|
|
];
|