mirror of
https://github.com/elyby/oauth2-server.git
synced 2025-05-31 14:12:07 +05:30
CryptTrait tests
This commit is contained in:
@@ -16,11 +16,11 @@ class AccessTokenEntity implements AccessTokenEntityInterface
|
||||
/**
|
||||
* Generate a JWT from the access token
|
||||
*
|
||||
* @param string $pathToPrivateKey
|
||||
* @param string $privateKeyPath
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function convertToJWT($pathToPrivateKey)
|
||||
public function convertToJWT($privateKeyPath)
|
||||
{
|
||||
return (new Builder())
|
||||
->setAudience($this->getClient()->getIdentifier())
|
||||
@@ -30,7 +30,7 @@ class AccessTokenEntity implements AccessTokenEntityInterface
|
||||
->setExpiration($this->getExpiryDateTime()->getTimestamp())
|
||||
->setSubject($this->getUserIdentifier())
|
||||
->set('scopes', $this->getScopes())
|
||||
->sign(new Sha256(), new Key($pathToPrivateKey))
|
||||
->sign(new Sha256(), new Key($privateKeyPath))
|
||||
->getToken();
|
||||
}
|
||||
}
|
||||
|
@@ -7,9 +7,9 @@ interface AccessTokenEntityInterface extends TokenInterface
|
||||
/**
|
||||
* Generate a JWT from the access token
|
||||
*
|
||||
* @param string $pathToPrivateKey
|
||||
* @param string $privateKeyPath
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function convertToJWT($pathToPrivateKey);
|
||||
public function convertToJWT($privateKeyPath);
|
||||
}
|
||||
|
@@ -89,14 +89,14 @@ interface GrantTypeInterface extends EmitterAwareInterface
|
||||
/**
|
||||
* Set the path to the private key.
|
||||
*
|
||||
* @param string $pathToPrivateKey
|
||||
* @param string $privateKeyPath
|
||||
*/
|
||||
public function setPrivateKeyPath($pathToPrivateKey);
|
||||
public function setPrivateKeyPath($privateKeyPath);
|
||||
|
||||
/**
|
||||
* Set the path to the public key.
|
||||
*
|
||||
* @param string $pathToPublicKey
|
||||
* @param string $publicKeyPath
|
||||
*/
|
||||
public function setPublicKeyPath($pathToPublicKey);
|
||||
public function setPublicKeyPath($publicKeyPath);
|
||||
}
|
||||
|
Reference in New Issue
Block a user