mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/OATHAuth
synced 2024-11-27 09:40:28 +00:00
e5bcf09868
And as a bonus tweak OATHModuleRegistry error handling. Change-Id: I4e3ca0092115e22ab7e7703e1682d68fbcc06af4
30 lines
958 B
PHP
30 lines
958 B
PHP
<?php
|
|
|
|
use MediaWiki\Extension\OATHAuth\OATHAuthModuleRegistry;
|
|
use MediaWiki\Extension\OATHAuth\OATHUserRepository;
|
|
use MediaWiki\Logger\LoggerFactory;
|
|
use MediaWiki\MediaWikiServices;
|
|
use MediaWiki\Registration\ExtensionRegistry;
|
|
use Wikimedia\ObjectCache\HashBagOStuff;
|
|
|
|
return [
|
|
'OATHAuthModuleRegistry' => static function ( MediaWikiServices $services ): OATHAuthModuleRegistry {
|
|
return new OATHAuthModuleRegistry(
|
|
$services->getDBLoadBalancerFactory(),
|
|
$services->getObjectFactory(),
|
|
ExtensionRegistry::getInstance()->getAttribute( 'OATHAuthModules' ),
|
|
);
|
|
},
|
|
'OATHUserRepository' => static function ( MediaWikiServices $services ): OATHUserRepository {
|
|
return new OATHUserRepository(
|
|
$services->getDBLoadBalancerFactory(),
|
|
new HashBagOStuff( [
|
|
'maxKey' => 5
|
|
] ),
|
|
$services->getService( 'OATHAuthModuleRegistry' ),
|
|
$services->getCentralIdLookupFactory(),
|
|
LoggerFactory::getInstance( 'authentication' )
|
|
);
|
|
}
|
|
];
|