mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/OATHAuth
synced 2024-11-14 19:31:17 +00:00
4af2cd2a00
Bug: T242031 Change-Id: Ib5de429f16b597867624a5a3cdfdac99b96c8bf5
38 lines
1.1 KiB
PHP
38 lines
1.1 KiB
PHP
<?php
|
|
|
|
use MediaWiki\Config\ServiceOptions;
|
|
use MediaWiki\Extension\OATHAuth\OATHAuthDatabase;
|
|
use MediaWiki\Extension\OATHAuth\OATHAuthModuleRegistry;
|
|
use MediaWiki\Extension\OATHAuth\OATHUserRepository;
|
|
use MediaWiki\Logger\LoggerFactory;
|
|
use MediaWiki\MediaWikiServices;
|
|
|
|
return [
|
|
'OATHAuthDatabase' => static function ( MediaWikiServices $services ) {
|
|
return new OATHAuthDatabase(
|
|
new ServiceOptions(
|
|
OATHAuthDatabase::CONSTRUCTOR_OPTIONS,
|
|
$services->getMainConfig(),
|
|
),
|
|
$services->getDBLoadBalancerFactory(),
|
|
);
|
|
},
|
|
'OATHAuthModuleRegistry' => static function ( MediaWikiServices $services ) {
|
|
return new OATHAuthModuleRegistry(
|
|
$services->getService( 'OATHAuthDatabase' ),
|
|
ExtensionRegistry::getInstance()->getAttribute( 'OATHAuthModules' ),
|
|
);
|
|
},
|
|
'OATHUserRepository' => static function ( MediaWikiServices $services ) {
|
|
return new OATHUserRepository(
|
|
$services->getService( 'OATHAuthDatabase' ),
|
|
new HashBagOStuff( [
|
|
'maxKey' => 5
|
|
] ),
|
|
$services->getService( 'OATHAuthModuleRegistry' ),
|
|
$services->getCentralIdLookupFactory(),
|
|
LoggerFactory::getInstance( 'authentication' )
|
|
);
|
|
}
|
|
];
|