mirror of
https://we.phorge.it/source/phorge.git
synced 2025-03-29 04:28:12 +01:00
Simplify implementation of "SysetemAction->getSystemActionConstant()"
Summary: Depends on D20668. Ref T13343. Just an easy cleanup/simplification while I'm here. Test Plan: `grep` for `getActionConstant()` Reviewers: amckinley Reviewed By: amckinley Maniphest Tasks: T13343 Differential Revision: https://secure.phabricator.com/D20669
This commit is contained in:
parent
a75766c0e5
commit
2ee5e71029
13 changed files with 5 additions and 48 deletions
|
@ -5,10 +5,6 @@ final class PhabricatorAuthChangePasswordAction
|
|||
|
||||
const TYPECONST = 'auth.password';
|
||||
|
||||
public function getActionConstant() {
|
||||
return self::TYPECONST;
|
||||
}
|
||||
|
||||
public function getScoreThreshold() {
|
||||
return 20 / phutil_units('1 hour in seconds');
|
||||
}
|
||||
|
|
|
@ -4,10 +4,6 @@ final class PhabricatorAuthEmailLoginAction extends PhabricatorSystemAction {
|
|||
|
||||
const TYPECONST = 'mail.login';
|
||||
|
||||
public function getActionConstant() {
|
||||
return self::TYPECONST;
|
||||
}
|
||||
|
||||
public function getScoreThreshold() {
|
||||
return 3 / phutil_units('1 hour in seconds');
|
||||
}
|
||||
|
|
|
@ -4,10 +4,6 @@ final class PhabricatorAuthNewFactorAction extends PhabricatorSystemAction {
|
|||
|
||||
const TYPECONST = 'auth.factor.new';
|
||||
|
||||
public function getActionConstant() {
|
||||
return self::TYPECONST;
|
||||
}
|
||||
|
||||
public function getScoreThreshold() {
|
||||
return 60 / phutil_units('1 hour in seconds');
|
||||
}
|
||||
|
|
|
@ -4,10 +4,6 @@ final class PhabricatorAuthTestSMSAction extends PhabricatorSystemAction {
|
|||
|
||||
const TYPECONST = 'auth.sms.test';
|
||||
|
||||
public function getActionConstant() {
|
||||
return self::TYPECONST;
|
||||
}
|
||||
|
||||
public function getScoreThreshold() {
|
||||
return 60 / phutil_units('1 hour in seconds');
|
||||
}
|
||||
|
|
|
@ -5,10 +5,6 @@ final class PhabricatorAuthTryEmailLoginAction
|
|||
|
||||
const TYPECONST = 'mail.try-login';
|
||||
|
||||
public function getActionConstant() {
|
||||
return self::TYPECONST;
|
||||
}
|
||||
|
||||
public function getScoreThreshold() {
|
||||
return 20 / phutil_units('1 hour in seconds');
|
||||
}
|
||||
|
|
|
@ -4,10 +4,6 @@ final class PhabricatorAuthTryFactorAction extends PhabricatorSystemAction {
|
|||
|
||||
const TYPECONST = 'auth.factor';
|
||||
|
||||
public function getActionConstant() {
|
||||
return self::TYPECONST;
|
||||
}
|
||||
|
||||
public function getScoreThreshold() {
|
||||
return 10 / phutil_units('1 hour in seconds');
|
||||
}
|
||||
|
|
|
@ -5,10 +5,6 @@ final class PhabricatorAuthTryPasswordAction
|
|||
|
||||
const TYPECONST = 'auth.password';
|
||||
|
||||
public function getActionConstant() {
|
||||
return self::TYPECONST;
|
||||
}
|
||||
|
||||
public function getScoreThreshold() {
|
||||
return 100 / phutil_units('1 hour in seconds');
|
||||
}
|
||||
|
|
|
@ -5,10 +5,6 @@ final class PhabricatorAuthTryPasswordWithoutCAPTCHAAction
|
|||
|
||||
const TYPECONST = 'auth.password-without-captcha';
|
||||
|
||||
public function getActionConstant() {
|
||||
return self::TYPECONST;
|
||||
}
|
||||
|
||||
public function getScoreThreshold() {
|
||||
return 10 / phutil_units('1 hour in seconds');
|
||||
}
|
||||
|
|
|
@ -5,10 +5,6 @@ final class PhabricatorFilesOutboundRequestAction
|
|||
|
||||
const TYPECONST = 'files.outbound';
|
||||
|
||||
public function getActionConstant() {
|
||||
return self::TYPECONST;
|
||||
}
|
||||
|
||||
public function getScoreThreshold() {
|
||||
return 60 / phutil_units('1 hour in seconds');
|
||||
}
|
||||
|
|
|
@ -2,9 +2,7 @@
|
|||
|
||||
final class PhabricatorMetaMTAErrorMailAction extends PhabricatorSystemAction {
|
||||
|
||||
public function getActionConstant() {
|
||||
return 'email.error';
|
||||
}
|
||||
const TYPECONST = 'email.error';
|
||||
|
||||
public function getScoreThreshold() {
|
||||
return 6 / phutil_units('1 hour in seconds');
|
||||
|
|
|
@ -5,10 +5,6 @@ final class PhortuneAddPaymentMethodAction
|
|||
|
||||
const TYPECONST = 'phortune.payment-method.add';
|
||||
|
||||
public function getActionConstant() {
|
||||
return self::TYPECONST;
|
||||
}
|
||||
|
||||
public function getScoreThreshold() {
|
||||
return 60 / phutil_units('1 hour in seconds');
|
||||
}
|
||||
|
|
|
@ -4,10 +4,6 @@ final class PhabricatorSettingsAddEmailAction extends PhabricatorSystemAction {
|
|||
|
||||
const TYPECONST = 'email.add';
|
||||
|
||||
public function getActionConstant() {
|
||||
return self::TYPECONST;
|
||||
}
|
||||
|
||||
public function getScoreThreshold() {
|
||||
return 6 / phutil_units('1 hour in seconds');
|
||||
}
|
||||
|
|
|
@ -2,7 +2,10 @@
|
|||
|
||||
abstract class PhabricatorSystemAction extends Phobject {
|
||||
|
||||
abstract public function getActionConstant();
|
||||
final public function getActionConstant() {
|
||||
return $this->getPhobjectClassConstant('TYPECONST', 32);
|
||||
}
|
||||
|
||||
abstract public function getScoreThreshold();
|
||||
|
||||
public function shouldBlockActor($actor, $score) {
|
||||
|
|
Loading…
Add table
Reference in a new issue