Class SecurityNoticeService
- Namespace
- FishMMO.ControlPanel.Services
- Assembly
- FishMMO-ControlPanel.dll
Queues the security notices an account holder is owed: a sign-in lock, and every step of a self-service two-factor reset.
public sealed class SecurityNoticeService
- Inheritance
-
SecurityNoticeService
- Inherited Members
Remarks
Every notice is SecurityNotice. That is load-bearing: the drain stamps
verification_email_sent_at only for a verification mail, and a notice sent to an
unverified account must not end its grace period.
Best effort. The action the notice describes has already happened; a notice that could not be queued is logged, never turned into a failure of the action.
Nothing here says which address or number is on file, and none of it is ever returned to an anonymous caller: the lockout notice is queued from a path whose HTTP answer is identical whether or not anything was sent.
Constructors
SecurityNoticeService(IAccountService, IEmailQueueService, ILogger<SecurityNoticeService>)
public SecurityNoticeService(IAccountService accounts, IEmailQueueService emailQueue, ILogger<SecurityNoticeService> log)
Parameters
accountsIAccountServiceemailQueueIEmailQueueServicelogILogger<SecurityNoticeService>
Methods
ResetCancelledAsync(string, bool, CancellationToken)
A pending two-factor reset was cancelled, by the owner signing in or by staff.
public Task ResetCancelledAsync(string username, bool byStaff, CancellationToken cancellationToken = default)
Parameters
usernamestringbyStaffboolcancellationTokenCancellationToken
Returns
ResetCompletedAsync(string, bool, CancellationToken)
A two-factor reset was completed: the old authenticator and recovery codes no longer work.
public Task ResetCompletedAsync(string username, bool signedOutElsewhere, CancellationToken cancellationToken = default)
Parameters
usernamestringsignedOutElsewhereboolWhether every other browser and game client was signed out. Said only when it is true: the mail used to claim it unconditionally, including when the revocations had failed.
cancellationTokenCancellationToken
Returns
ResetRequestedAsync(string, DateTime, string, CancellationToken)
A delayed two-factor reset was requested.
public Task ResetRequestedAsync(string username, DateTime effectiveUtc, string requestedIp, CancellationToken cancellationToken = default)
Parameters
usernamestringeffectiveUtcDateTimerequestedIpstringcancellationTokenCancellationToken
Returns
ResetShortenedAsync(string, DateTime, CancellationToken)
Staff brought a pending reset's effective time forward.
public Task ResetShortenedAsync(string username, DateTime effectiveUtc, CancellationToken cancellationToken = default)
Parameters
usernamestringeffectiveUtcDateTimecancellationTokenCancellationToken
Returns
SignInLockedAsync(string, AuthFailureKind, DateTime, CancellationToken)
A sign-in step has just been locked after repeated failures.
public Task SignInLockedAsync(string username, AuthFailureKind kind, DateTime lockedUntilUtc, CancellationToken cancellationToken = default)
Parameters
usernamestringkindAuthFailureKindlockedUntilUtcDateTimecancellationTokenCancellationToken