summaryrefslogtreecommitdiffstats
path: root/vendor/sonata-project/google-authenticator/src/GoogleAuthenticatorInterface.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/sonata-project/google-authenticator/src/GoogleAuthenticatorInterface.php')
-rw-r--r--vendor/sonata-project/google-authenticator/src/GoogleAuthenticatorInterface.php44
1 files changed, 44 insertions, 0 deletions
diff --git a/vendor/sonata-project/google-authenticator/src/GoogleAuthenticatorInterface.php b/vendor/sonata-project/google-authenticator/src/GoogleAuthenticatorInterface.php
new file mode 100644
index 0000000..b3144fd
--- /dev/null
+++ b/vendor/sonata-project/google-authenticator/src/GoogleAuthenticatorInterface.php
@@ -0,0 +1,44 @@
+<?php
+
+declare(strict_types=1);
+
+/*
+ * This file is part of the Sonata Project package.
+ *
+ * (c) Thomas Rabaix <thomas.rabaix@sonata-project.org>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Sonata\GoogleAuthenticator;
+
+interface GoogleAuthenticatorInterface
+{
+ /**
+ * @param string $secret
+ * @param string $code
+ */
+ public function checkCode($secret, $code, $discrepancy = 1): bool;
+
+ /**
+ * NEXT_MAJOR: add the interface typehint to $time and remove deprecation.
+ *
+ * @param string $secret
+ * @param float|string|int|\DateTimeInterface|null $time
+ */
+ public function getCode($secret, /* \DateTimeInterface */ $time = null): string;
+
+ /**
+ * NEXT_MAJOR: Remove this method.
+ *
+ * @param string $user
+ * @param string $hostname
+ * @param string $secret
+ *
+ * @deprecated deprecated as of 2.1 and will be removed in 3.0. Use Sonata\GoogleAuthenticator\GoogleQrUrl::generate() instead.
+ */
+ public function getUrl($user, $hostname, $secret): string;
+
+ public function generateSecret(): string;
+}