diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2021-04-16 14:52:59 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2021-04-20 21:01:16 +0200 |
commit | 5ee9e1f78467d1004177012978160731606f204e (patch) | |
tree | 19d94834311518bb7cad1e2669f7bb64d5225d39 /lib/private/AppFramework | |
parent | 46872e392183215a2bcac2e7e80937ae58e4b4ab (diff) | |
download | nextcloud-server-5ee9e1f78467d1004177012978160731606f204e.tar.gz nextcloud-server-5ee9e1f78467d1004177012978160731606f204e.zip |
Move 2FA registration to IBootstrap
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'lib/private/AppFramework')
-rw-r--r-- | lib/private/AppFramework/Bootstrap/RegistrationContext.php | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/lib/private/AppFramework/Bootstrap/RegistrationContext.php b/lib/private/AppFramework/Bootstrap/RegistrationContext.php index 662296b8dd6..d056c088a9f 100644 --- a/lib/private/AppFramework/Bootstrap/RegistrationContext.php +++ b/lib/private/AppFramework/Bootstrap/RegistrationContext.php @@ -92,7 +92,10 @@ class RegistrationContext { private $templateProviders = []; /** @var ServiceRegistration<INotifier>[] */ - private $notifierServices; + private $notifierServices = []; + + /** @var ServiceRegistration<\OCP\Authentication\TwoFactorAuth\IProvider>[] */ + private $twoFactorProviders = []; /** @var ILogger */ private $logger; @@ -217,6 +220,13 @@ class RegistrationContext { $notifierClass ); } + + public function registerTwoFactorProvider(string $twoFactorProviderClass): void { + $this->context->registerTwoFactorProvider( + $this->appId, + $twoFactorProviderClass + ); + } }; } @@ -288,6 +298,10 @@ class RegistrationContext { $this->notifierServices[] = new ServiceRegistration($appId, $class); } + public function registerTwoFactorProvider(string $appId, string $class): void { + $this->twoFactorProviders[] = new ServiceRegistration($appId, $class); + } + /** * @param App[] $apps */ @@ -479,4 +493,11 @@ class RegistrationContext { public function getNotifierServices(): array { return $this->notifierServices; } + + /** + * @return ServiceRegistration<\OCP\Authentication\TwoFactorAuth\IProvider>[] + */ + public function getTwoFactorProviders(): array { + return $this->twoFactorProviders; + } } |