summaryrefslogtreecommitdiffstats
path: root/TwoStepsAuthenticator.DotnetCore/IUsedCodesManager.cs
diff options
context:
space:
mode:
authorGuillaume Lacasa <guillaumelacasa@hotmail.com>2016-06-29 10:43:45 +0200
committerGuillaume Lacasa <guillaumelacasa@hotmail.com>2016-06-29 12:46:06 +0200
commit8e80d5923232b6b5852873a8c54fc3d8bbbc9a96 (patch)
tree05c8206b8e1aa94ec40b0e9cb921b2a3b06b3535 /TwoStepsAuthenticator.DotnetCore/IUsedCodesManager.cs
parent8cfb0a7876aa457254f199ca99210b58284e1151 (diff)
downloadTwoStepsAuthenticator-8e80d5923232b6b5852873a8c54fc3d8bbbc9a96.zip
TwoStepsAuthenticator-8e80d5923232b6b5852873a8c54fc3d8bbbc9a96.tar.gz
TwoStepsAuthenticator-8e80d5923232b6b5852873a8c54fc3d8bbbc9a96.tar.bz2
Dotnet Core support
Diffstat (limited to 'TwoStepsAuthenticator.DotnetCore/IUsedCodesManager.cs')
-rw-r--r--TwoStepsAuthenticator.DotnetCore/IUsedCodesManager.cs27
1 files changed, 27 insertions, 0 deletions
diff --git a/TwoStepsAuthenticator.DotnetCore/IUsedCodesManager.cs b/TwoStepsAuthenticator.DotnetCore/IUsedCodesManager.cs
new file mode 100644
index 0000000..9455d88
--- /dev/null
+++ b/TwoStepsAuthenticator.DotnetCore/IUsedCodesManager.cs
@@ -0,0 +1,27 @@
+using System;
+
+namespace TwoStepsAuthenticator {
+
+ /// <summary>
+ /// Manages used code to prevent repeated use of a code.
+ /// </summary>
+ public interface IUsedCodesManager {
+
+ /// <summary>
+ /// Adds secret/code pair.
+ /// </summary>
+ /// <param name="challenge">Used Challenge</param>
+ /// <param name="code">Used Code</param>
+ /// <param name="user">The user</param>
+ void AddCode(long timestamp, string code, object user);
+
+ /// <summary>
+ /// Checks if code was previously used.
+ /// </summary>
+ /// <param name="challenge">Used Challenge</param>
+ /// <param name="code">Used Code</param>
+ /// <param name="user">The user</param>
+ /// <returns>True if the user as already used the code</returns>
+ bool IsCodeUsed(long timestamp, string code, object user);
+ }
+}