From 5c44abf21ae9b009cb8403cb555246c015023ed2 Mon Sep 17 00:00:00 2001 From: dylan_DPC Date: Mon, 17 Jul 2017 17:10:49 +0530 Subject: [PATCH] matches function went awol, brought it back.. functions added to contract styling fixed for SP --- src/AuthValidator.php | 5 +++++ src/AuthValidatorContract.php | 7 +++++++ src/AuthValidatorServiceProvider.php | 4 ++-- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/AuthValidator.php b/src/AuthValidator.php index c64d51c..3dda877 100644 --- a/src/AuthValidator.php +++ b/src/AuthValidator.php @@ -27,6 +27,11 @@ public function generateNonce(Model $content): string return $this->generator->generate($content); } + public function matches(Model $content, string $nonce) + { + return $this->generator->matches($content, $nonce); + } + public function validate(array $params) { return $this->validator->verify($params); diff --git a/src/AuthValidatorContract.php b/src/AuthValidatorContract.php index f2f5e6d..c063ede 100644 --- a/src/AuthValidatorContract.php +++ b/src/AuthValidatorContract.php @@ -3,7 +3,14 @@ namespace Dpc\HashVerifier; +use Illuminate\Database\Eloquent\Model; + interface AuthValidatorContract { + public function generateNonce(Model $content): string; + + public function matches(Model $content, string $nonce); + + public function validate(array $params); } \ No newline at end of file diff --git a/src/AuthValidatorServiceProvider.php b/src/AuthValidatorServiceProvider.php index e17dc6f..c374165 100644 --- a/src/AuthValidatorServiceProvider.php +++ b/src/AuthValidatorServiceProvider.php @@ -13,9 +13,9 @@ class AuthValidatorServiceProvider extends ServiceProvider */ public function boot() { - $this->publishes([ + $this->publishes([ __DIR__ . '/../config/validator.php' => config_path('validator.php'), - ], 'config'); + ], 'config'); }