mediawiki-extensions-OATHAuth/ServiceWiring.php
Taavi Väänänen c0da90be2b
Add separate OATHAuthModuleRegistry service
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
2023-01-01 21:17:04 +02:00

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' )
);
}
];