| | | 1 | | using ArturRios.Mediator.Query; |
| | | 2 | | |
| | | 3 | | namespace ArturRios.Heimdall.Query.Output; |
| | | 4 | | |
| | | 5 | | /// <summary> |
| | | 6 | | /// The caller's own two-factor authentication state (FR-2F-15). Carries no secret: never the |
| | | 7 | | /// TOTP secret, never a recovery code, only how many recovery codes remain unspent. |
| | | 8 | | /// </summary> |
| | | 9 | | /// <remarks> |
| | | 10 | | /// A setup initiated by UC-36 but not yet confirmed by UC-37 needs no field of its own — it is |
| | | 11 | | /// exactly <c>!IsActive && (AppEnabled || EmailEnabled)</c>, since a configuration row |
| | | 12 | | /// only ever exists because setup was initiated. A caller who never initiated setup gets every |
| | | 13 | | /// flag <c>false</c> and <see cref="RemainingRecoveryCodes" /> zero. |
| | | 14 | | /// </remarks> |
| | | 15 | | public class TwoFactorStatusOutput : QueryOutput |
| | | 16 | | { |
| | | 17 | | /// <summary>Whether two-factor authentication is confirmed and in force (FR-2F-04).</summary> |
| | 17 | 18 | | public bool IsActive { get; set; } |
| | | 19 | | |
| | | 20 | | /// <summary>Whether the authenticator-app method is configured (FR-2F-02).</summary> |
| | 17 | 21 | | public bool AppEnabled { get; set; } |
| | | 22 | | |
| | | 23 | | /// <summary>Whether the email method is configured (FR-2F-03).</summary> |
| | 16 | 24 | | public bool EmailEnabled { get; set; } |
| | | 25 | | |
| | | 26 | | /// <summary>How many issued recovery codes remain unused (FR-2F-05, FR-2F-06).</summary> |
| | 15 | 27 | | public int RemainingRecoveryCodes { get; set; } |
| | | 28 | | } |