summaryrefslogtreecommitdiffstats
path: root/lib/public
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2018-03-26 11:18:21 +0200
committerRoeland Jago Douma <roeland@famdouma.nl>2018-03-26 11:31:02 +0200
commit24b12385d0e5f7483a64f2abf543f9c4e09a6eaa (patch)
tree28e6811140d6ebf90e7effd53b5a74976560cccf /lib/public
parente2b44d199bea7da74811689ec3ab787135e22de6 (diff)
downloadnextcloud-server-24b12385d0e5f7483a64f2abf543f9c4e09a6eaa.tar.gz
nextcloud-server-24b12385d0e5f7483a64f2abf543f9c4e09a6eaa.zip
Strict 2FA
* make OCP\Authentication\TwoFactorAuth strict * scalar types * return types Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'lib/public')
-rw-r--r--lib/public/Authentication/TwoFactorAuth/IProvider.php16
-rw-r--r--lib/public/Authentication/TwoFactorAuth/IProvidesCustomCSP.php3
-rw-r--r--lib/public/Authentication/TwoFactorAuth/TwoFactorException.php1
3 files changed, 12 insertions, 8 deletions
diff --git a/lib/public/Authentication/TwoFactorAuth/IProvider.php b/lib/public/Authentication/TwoFactorAuth/IProvider.php
index c4c481a2f32..84752cecc77 100644
--- a/lib/public/Authentication/TwoFactorAuth/IProvider.php
+++ b/lib/public/Authentication/TwoFactorAuth/IProvider.php
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
/**
* @copyright Copyright (c) 2016, ownCloud, Inc.
*
@@ -43,7 +44,7 @@ interface IProvider {
*
* @return string
*/
- public function getId();
+ public function getId(): string;
/**
* Get the display name for selecting the 2FA provider
@@ -54,7 +55,7 @@ interface IProvider {
*
* @return string
*/
- public function getDisplayName();
+ public function getDisplayName(): string;
/**
* Get the description for selecting the 2FA provider
@@ -65,7 +66,7 @@ interface IProvider {
*
* @return string
*/
- public function getDescription();
+ public function getDescription(): string;
/**
* Get the template for rending the 2FA provider view
@@ -75,7 +76,7 @@ interface IProvider {
* @param IUser $user
* @return Template
*/
- public function getTemplate(IUser $user);
+ public function getTemplate(IUser $user): Template;
/**
* Verify the given challenge
@@ -84,8 +85,9 @@ interface IProvider {
*
* @param IUser $user
* @param string $challenge
+ * @return bool
*/
- public function verifyChallenge(IUser $user, $challenge);
+ public function verifyChallenge(IUser $user, string $challenge): bool;
/**
* Decides whether 2FA is enabled for the given user
@@ -93,7 +95,7 @@ interface IProvider {
* @since 9.1.0
*
* @param IUser $user
- * @return boolean
+ * @return bool
*/
- public function isTwoFactorAuthEnabledForUser(IUser $user);
+ public function isTwoFactorAuthEnabledForUser(IUser $user): bool;
}
diff --git a/lib/public/Authentication/TwoFactorAuth/IProvidesCustomCSP.php b/lib/public/Authentication/TwoFactorAuth/IProvidesCustomCSP.php
index 2a498adc0b8..3b477dc53fe 100644
--- a/lib/public/Authentication/TwoFactorAuth/IProvidesCustomCSP.php
+++ b/lib/public/Authentication/TwoFactorAuth/IProvidesCustomCSP.php
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
/**
*
*
@@ -35,5 +36,5 @@ interface IProvidesCustomCSP {
*
* @since 13.0.0
*/
- public function getCSP();
+ public function getCSP(): ContentSecurityPolicy;
}
diff --git a/lib/public/Authentication/TwoFactorAuth/TwoFactorException.php b/lib/public/Authentication/TwoFactorAuth/TwoFactorException.php
index a18b9e8c4a8..d94c3e61465 100644
--- a/lib/public/Authentication/TwoFactorAuth/TwoFactorException.php
+++ b/lib/public/Authentication/TwoFactorAuth/TwoFactorException.php
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
/**
* @copyright Copyright (c) 2016, ownCloud GmbH.
*