-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathServiceWiring.php
29 lines (27 loc) · 958 Bytes
/
ServiceWiring.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?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' )
);
}
];