Class LoginSecurityPolicy
- Namespace
- FishMMO.Server.Implementation
- Assembly
- FishMMO.Server.dll
The login server's closed-test (beta) and database-backed sign-in lockout settings, read from
LoginServer.cfg. Shared by account creation and the SRP authenticator so the two can
never disagree about whether the server is in a closed test or what a lockout is.
public static class LoginSecurityPolicy
- Inheritance
-
LoginSecurityPolicy
- Inherited Members
Remarks
The lockout defaults are the Control Panel's. Failures are counted on the account row, so every login server and the panel lock one account together; a login server configured differently from the panel would still share the counter but disagree about when it trips. Change them in both places or neither.
Read on every use rather than cached, like AccountVerificationPolicy: the parsing is a handful of dictionary lookups and a login is not a hot loop.
Fields
BetaModeKey
Key that turns closed-test mode on. Default false.
public const string BetaModeKey = "BetaMode"
Field Value
BetaProgramsKey
Key listing the beta programs, comma-separated.
public const string BetaProgramsKey = "BetaPrograms"
Field Value
DefaultPasswordLockMinutes
Shared default: locked for 15 minutes.
public const int DefaultPasswordLockMinutes = 15
Field Value
DefaultPasswordThreshold
Shared default: 5 password failures.
public const int DefaultPasswordThreshold = 5
Field Value
DefaultPasswordWindowMinutes
Shared default: counted over 15 minutes.
public const int DefaultPasswordWindowMinutes = 15
Field Value
DefaultTwoFactorLockMinutes
Shared default: locked for 30 minutes.
public const int DefaultTwoFactorLockMinutes = 30
Field Value
DefaultTwoFactorThreshold
Shared default: 5 wrong second-factor codes.
public const int DefaultTwoFactorThreshold = 5
Field Value
DefaultTwoFactorWindowMinutes
Shared default: counted over 15 minutes.
public const int DefaultTwoFactorWindowMinutes = 15
Field Value
PasswordLockMinutesKey
Minutes password sign-in stays locked.
public const string PasswordLockMinutesKey = "AuthLockoutPasswordLockMinutes"
Field Value
PasswordThresholdKey
Password failures that lock password sign-in.
public const string PasswordThresholdKey = "AuthLockoutPasswordThreshold"
Field Value
PasswordWindowMinutesKey
Minutes password failures are counted over.
public const string PasswordWindowMinutesKey = "AuthLockoutPasswordWindowMinutes"
Field Value
TwoFactorLockMinutesKey
Minutes the two-factor step stays locked.
public const string TwoFactorLockMinutesKey = "AuthLockoutTwoFactorLockMinutes"
Field Value
TwoFactorThresholdKey
Wrong second-factor codes that lock the two-factor step.
public const string TwoFactorThresholdKey = "AuthLockoutTwoFactorThreshold"
Field Value
TwoFactorWindowMinutesKey
Minutes second-factor failures are counted over.
public const string TwoFactorWindowMinutesKey = "AuthLockoutTwoFactorWindowMinutes"
Field Value
Methods
GetBetaPrograms(IServerConfiguration, out int)
The active beta programs: trimmed, lowercased, de-duplicated, invalid names dropped.
public static IReadOnlyList<string> GetBetaPrograms(IServerConfiguration configuration, out int rejected)
Parameters
configurationIServerConfigurationServer configuration, or null.
rejectedintHow many listed names were not valid program names.
Returns
GetPasswordLockout(IServerConfiguration)
The password-step lockout.
public static AuthLockoutSettings GetPasswordLockout(IServerConfiguration configuration)
Parameters
configurationIServerConfiguration
Returns
GetTwoFactorLockout(IServerConfiguration)
The two-factor-step lockout.
public static AuthLockoutSettings GetTwoFactorLockout(IServerConfiguration configuration)
Parameters
configurationIServerConfiguration
Returns
IsBetaModeEnabled(IServerConfiguration)
Whether the server is in a closed test. Anything but a readable true is off.
public static bool IsBetaModeEnabled(IServerConfiguration configuration)
Parameters
configurationIServerConfiguration