-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add native auth ttl check + refactoring
- Loading branch information
Showing
6 changed files
with
123 additions
and
18 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
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,13 @@ | ||
<?php | ||
|
||
namespace Peerme\MxLaravel\Exceptions; | ||
|
||
use Exception; | ||
|
||
class NativeAuthInvalidSignatureException extends Exception | ||
{ | ||
public function __construct() | ||
{ | ||
parent::__construct('Invalid signature'); | ||
} | ||
} |
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,15 @@ | ||
<?php | ||
|
||
namespace Peerme\MxLaravel\Exceptions; | ||
|
||
use Exception; | ||
|
||
class NativeAuthInvalidTokenTtlException extends Exception | ||
{ | ||
public function __construct(int $currentTtl, int $maxTtl) | ||
{ | ||
parent::__construct( | ||
"The provided TTL in the token ({$currentTtl}) is larger than the maximum allowed TTL ({$maxTtl})" | ||
); | ||
} | ||
} |
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,13 @@ | ||
<?php | ||
|
||
namespace Peerme\MxLaravel\Exceptions; | ||
|
||
use Exception; | ||
|
||
class NativeAuthOriginNotAcceptedException extends Exception | ||
{ | ||
public function __construct(string $origin) | ||
{ | ||
parent::__construct("Origin ({$origin}) not accepted"); | ||
} | ||
} |
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,13 @@ | ||
<?php | ||
|
||
namespace Peerme\MxLaravel\Exceptions; | ||
|
||
use Exception; | ||
|
||
class NativeAuthTokenExpiredException extends Exception | ||
{ | ||
public function __construct() | ||
{ | ||
parent::__construct('Token expired'); | ||
} | ||
} |
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