mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/OATHAuth
synced 2024-11-14 19:31:17 +00:00
c0da90be2b
This new service is separated from the previous OATHAuth class to give the service a more accurate name. Also removed unnecessary injected services and do some other minor cleanup. Change-Id: I8d5fbc7594b69168dc0c8bfade1ac172a5aeef6f
29 lines
819 B
PHP
29 lines
819 B
PHP
<?php
|
|
|
|
use MediaWiki\Config\ServiceOptions;
|
|
use MediaWiki\Extension\OATHAuth\OATHAuthModuleRegistry;
|
|
use MediaWiki\Extension\OATHAuth\OATHUserRepository;
|
|
use MediaWiki\Logger\LoggerFactory;
|
|
use MediaWiki\MediaWikiServices;
|
|
|
|
return [
|
|
'OATHAuthModuleRegistry' => static function ( MediaWikiServices $services ) {
|
|
return new OATHAuthModuleRegistry();
|
|
},
|
|
'OATHUserRepository' => static function ( MediaWikiServices $services ) {
|
|
return new OATHUserRepository(
|
|
new ServiceOptions(
|
|
OATHUserRepository::CONSTRUCTOR_OPTIONS,
|
|
$services->getMainConfig(),
|
|
),
|
|
$services->getDBLoadBalancerFactory(),
|
|
new HashBagOStuff( [
|
|
'maxKey' => 5
|
|
] ),
|
|
$services->getService( 'OATHAuthModuleRegistry' ),
|
|
$services->getCentralIdLookupFactory(),
|
|
LoggerFactory::getInstance( 'authentication' )
|
|
);
|
|
}
|
|
];
|