2019-03-14 14:39:10 +00:00
|
|
|
<?php
|
|
|
|
|
2022-12-31 18:48:09 +00:00
|
|
|
use MediaWiki\Config\ServiceOptions;
|
2022-12-31 21:32:29 +00:00
|
|
|
use MediaWiki\Extension\OATHAuth\OATHAuthDatabase;
|
2022-12-31 21:06:34 +00:00
|
|
|
use MediaWiki\Extension\OATHAuth\OATHAuthModuleRegistry;
|
2019-10-11 17:58:52 +00:00
|
|
|
use MediaWiki\Extension\OATHAuth\OATHUserRepository;
|
2022-12-31 18:48:09 +00:00
|
|
|
use MediaWiki\Logger\LoggerFactory;
|
2020-01-14 08:27:29 +00:00
|
|
|
use MediaWiki\MediaWikiServices;
|
2019-03-14 14:39:10 +00:00
|
|
|
|
|
|
|
return [
|
2022-12-31 21:32:29 +00:00
|
|
|
'OATHAuthDatabase' => static function ( MediaWikiServices $services ) {
|
|
|
|
return new OATHAuthDatabase(
|
|
|
|
new ServiceOptions(
|
|
|
|
OATHAuthDatabase::CONSTRUCTOR_OPTIONS,
|
|
|
|
$services->getMainConfig(),
|
|
|
|
),
|
|
|
|
$services->getDBLoadBalancerFactory(),
|
|
|
|
);
|
|
|
|
},
|
2022-12-31 21:06:34 +00:00
|
|
|
'OATHAuthModuleRegistry' => static function ( MediaWikiServices $services ) {
|
2022-12-31 23:49:18 +00:00
|
|
|
return new OATHAuthModuleRegistry(
|
|
|
|
$services->getService( 'OATHAuthDatabase' ),
|
|
|
|
ExtensionRegistry::getInstance()->getAttribute( 'OATHAuthModules' ),
|
|
|
|
);
|
2019-03-14 14:39:10 +00:00
|
|
|
},
|
2021-05-12 03:37:42 +00:00
|
|
|
'OATHUserRepository' => static function ( MediaWikiServices $services ) {
|
2019-03-14 14:39:10 +00:00
|
|
|
return new OATHUserRepository(
|
2022-12-31 18:48:09 +00:00
|
|
|
new ServiceOptions(
|
|
|
|
OATHUserRepository::CONSTRUCTOR_OPTIONS,
|
|
|
|
$services->getMainConfig(),
|
|
|
|
),
|
2022-12-31 21:32:29 +00:00
|
|
|
$services->getService( 'OATHAuthDatabase' ),
|
2022-12-31 18:48:09 +00:00
|
|
|
new HashBagOStuff( [
|
2019-03-14 14:39:10 +00:00
|
|
|
'maxKey' => 5
|
|
|
|
] ),
|
2022-12-31 21:06:34 +00:00
|
|
|
$services->getService( 'OATHAuthModuleRegistry' ),
|
2022-12-31 18:48:09 +00:00
|
|
|
$services->getCentralIdLookupFactory(),
|
|
|
|
LoggerFactory::getInstance( 'authentication' )
|
2019-03-14 14:39:10 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
];
|