-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from YassinLokhat/5-add-warnings-feature
5 add warnings feature
- Loading branch information
Showing
15 changed files
with
411 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Upsilon.Apps.PassKey.Core.Enums | ||
{ | ||
/// <summary> | ||
/// Represent a type of warning. | ||
/// </summary> | ||
[Flags] | ||
public enum WarningType | ||
{ | ||
/// <summary> | ||
/// A set of logs needs to be reviewed. | ||
/// </summary> | ||
LogReviewWarning = 0b0001, | ||
/// <summary> | ||
/// A set of accounts password expired and need to be updated. | ||
/// </summary> | ||
PasswordUpdateReminderWarning = 0b0010, | ||
/// <summary> | ||
/// Some accounts share the same passwords. | ||
/// </summary> | ||
DuplicatedPasswordsWarning = 0b0100, | ||
/// <summary> | ||
/// Some passwords leaked and found on the ';--have i been pwned? database | ||
/// </summary> | ||
PasswordLeakedWarning = 0b1000, | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using Upsilon.Apps.PassKey.Core.Interfaces; | ||
|
||
namespace Upsilon.Apps.PassKey.Core.Events | ||
{ | ||
/// <summary> | ||
/// Represent a warning detected event argument. | ||
/// </summary> | ||
/// <remarks> | ||
/// Creates a new event args. | ||
/// </remarks> | ||
/// <param name="warning">The warnings detected.</param> | ||
public class WarningDetectedEventArgs(IWarning[] warning) | ||
{ | ||
/// <summary> | ||
/// The warnings detected. | ||
/// </summary> | ||
public IWarning[] Warnings { get; private set; } = warning; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using Upsilon.Apps.PassKey.Core.Enums; | ||
|
||
namespace Upsilon.Apps.PassKey.Core.Interfaces | ||
{ | ||
/// <summary> | ||
/// Represent a warning. | ||
/// </summary> | ||
public interface IWarning | ||
{ | ||
/// <summary> | ||
/// The type of the warning. | ||
/// </summary> | ||
WarningType WarningType { get; } | ||
|
||
/// <summary> | ||
/// The logs concerned to the warning, if exists. | ||
/// </summary> | ||
ILog[]? Logs { get; } | ||
|
||
/// <summary> | ||
/// The accounts concerned to the warning, if exists. | ||
/// </summary> | ||
IAccount[]? Accounts { get; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.