-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d5048c7
commit 6b38a21
Showing
6 changed files
with
86 additions
and
41 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
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,29 @@ | ||
<?php | ||
|
||
namespace League\OAuth2\Client\Test; | ||
|
||
use Lcobucci\JWT\Signature; | ||
use Lcobucci\JWT\Signer; | ||
|
||
final class KeyDumpSigner implements Signer | ||
{ | ||
public function getAlgorithmId() | ||
{ | ||
return 'keydump'; | ||
} | ||
|
||
public function modifyHeader(array &$headers) | ||
{ | ||
$headers['alg'] = $this->getAlgorithmId(); | ||
} | ||
|
||
public function verify($expected, $payload, $key) | ||
{ | ||
return $expected === $key->contents(); | ||
} | ||
|
||
public function sign($payload, $key) | ||
{ | ||
return new Signature($key->contents()); | ||
} | ||
} |
File renamed without changes.
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,12 @@ | ||
<?php | ||
|
||
namespace League\OAuth2\Client\Test; | ||
|
||
use Composer\InstalledVersions; | ||
use Composer\Semver\VersionParser; | ||
|
||
if (!InstalledVersions::satisfies(new VersionParser(), 'lcobucci/jwt', '^1 || ^2 || ^3')) { | ||
require_once __DIR__ . '/../ext/KeyDumpSigner8.php'; | ||
} else { | ||
require_once __DIR__ . '/../ext/KeyDumpSigner5.php'; | ||
} |