Created Rest module

This commit is contained in:
Alejandro Celaya
2016-07-19 17:07:59 +02:00
parent 95d0beea3c
commit 55f954f50f
22 changed files with 127 additions and 86 deletions

View File

@@ -0,0 +1,32 @@
<?php
namespace Shlinkio\Shlink\Rest\Service;
use Acelaya\UrlShortener\Entity\RestToken;
use Acelaya\UrlShortener\Exception\AuthenticationException;
use Acelaya\UrlShortener\Exception\InvalidArgumentException;
interface RestTokenServiceInterface
{
/**
* @param string $token
* @return RestToken
* @throws InvalidArgumentException
*/
public function getByToken($token);
/**
* Creates and returns a new RestToken if username and password are correct
* @param $username
* @param $password
* @return RestToken
* @throws AuthenticationException
*/
public function createToken($username, $password);
/**
* Updates the expiration of provided token, extending its life
*
* @param RestToken $token
*/
public function updateExpiration(RestToken $token);
}