2019-03-14 14:39:10 +00:00
|
|
|
<?php
|
|
|
|
|
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;
|
2024-10-20 08:59:39 +00:00
|
|
|
use MediaWiki\Registration\ExtensionRegistry;
|
|
|
|
use Wikimedia\ObjectCache\HashBagOStuff;
|
2019-03-14 14:39:10 +00:00
|
|
|
|
|
|
|
return [
|
2024-01-31 19:08:46 +00:00
|
|
|
'OATHAuthModuleRegistry' => static function ( MediaWikiServices $services ): OATHAuthModuleRegistry {
|
2022-12-31 23:49:18 +00:00
|
|
|
return new OATHAuthModuleRegistry(
|
2023-10-17 18:39:14 +00:00
|
|
|
$services->getDBLoadBalancerFactory(),
|
2024-01-07 19:34:52 +00:00
|
|
|
$services->getObjectFactory(),
|
2022-12-31 23:49:18 +00:00
|
|
|
ExtensionRegistry::getInstance()->getAttribute( 'OATHAuthModules' ),
|
|
|
|
);
|
2019-03-14 14:39:10 +00:00
|
|
|
},
|
2024-01-31 19:08:46 +00:00
|
|
|
'OATHUserRepository' => static function ( MediaWikiServices $services ): OATHUserRepository {
|
2019-03-14 14:39:10 +00:00
|
|
|
return new OATHUserRepository(
|
2023-10-17 18:39:14 +00:00
|
|
|
$services->getDBLoadBalancerFactory(),
|
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
|
|
|
);
|
|
|
|
}
|
|
|
|
];
|