-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signatures can now be implemented on blueprints through
signature
a…
…nd `generateAndSign` functionality which should make this a more central place for token generation out of the box.
- Loading branch information
1 parent
8943d6d
commit 4f419b8
Showing
5 changed files
with
108 additions
and
0 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,9 @@ | ||
<?php | ||
|
||
namespace LGrevelink\SimpleJWT\Exceptions\Blueprint; | ||
|
||
use LGrevelink\SimpleJWT\Exceptions\SimpleJwtException; | ||
|
||
abstract class JwtBlueprintException extends SimpleJwtException | ||
{ | ||
} |
7 changes: 7 additions & 0 deletions
7
src/Exceptions/Blueprint/SignatureNotImplementedException.php
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,7 @@ | ||
<?php | ||
|
||
namespace LGrevelink\SimpleJWT\Exceptions\Blueprint; | ||
|
||
final class SignatureNotImplementedException extends JwtBlueprintException | ||
{ | ||
} |
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,18 @@ | ||
<?php | ||
|
||
namespace Tests\Mocks\Blueprints; | ||
|
||
use LGrevelink\SimpleJWT\Signing\Hmac\HmacSha256; | ||
use LGrevelink\SimpleJWT\TokenBlueprint; | ||
use LGrevelink\SimpleJWT\TokenSignature; | ||
|
||
class SignatureBlueprintMock extends TokenBlueprint | ||
{ | ||
/** | ||
* @inheritdoc | ||
*/ | ||
public static function signature(string $customKey = null) | ||
{ | ||
return new TokenSignature(new HmacSha256(), $customKey ?? 'default-key'); | ||
} | ||
} |
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