mirror of
https://github.com/webmasterskaya/joomla-oauth-server.git
synced 2024-11-24 02:44:51 +03:00
Реализация интерфейсов из библиотеки
This commit is contained in:
parent
5ebfb663d7
commit
3639054898
@ -0,0 +1,40 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Webmasterskaya\Component\OauthServer\Site\Repository;
|
||||||
|
|
||||||
|
use Joomla\CMS\MVC\Factory\MVCFactoryAwareTrait;
|
||||||
|
use League\OAuth2\Server\Entities\AccessTokenEntityInterface;
|
||||||
|
use League\OAuth2\Server\Entities\ClientEntityInterface;
|
||||||
|
use League\OAuth2\Server\Entities\Traits\AccessTokenTrait;
|
||||||
|
use League\OAuth2\Server\Entities\Traits\EntityTrait;
|
||||||
|
use League\OAuth2\Server\Entities\Traits\TokenEntityTrait;
|
||||||
|
use League\OAuth2\Server\Repositories\AccessTokenRepositoryInterface;
|
||||||
|
|
||||||
|
class AccessTokenRepository implements AccessTokenRepositoryInterface
|
||||||
|
{
|
||||||
|
use AccessTokenTrait;
|
||||||
|
use EntityTrait;
|
||||||
|
use TokenEntityTrait;
|
||||||
|
|
||||||
|
use MVCFactoryAwareTrait;
|
||||||
|
|
||||||
|
public function getNewToken(ClientEntityInterface $clientEntity, array $scopes, $userIdentifier = null)
|
||||||
|
{
|
||||||
|
// TODO: Implement getNewToken() method.
|
||||||
|
}
|
||||||
|
|
||||||
|
public function persistNewAccessToken(AccessTokenEntityInterface $accessTokenEntity)
|
||||||
|
{
|
||||||
|
// TODO: Implement persistNewAccessToken() method.
|
||||||
|
}
|
||||||
|
|
||||||
|
public function revokeAccessToken($tokenId)
|
||||||
|
{
|
||||||
|
// TODO: Implement revokeAccessToken() method.
|
||||||
|
}
|
||||||
|
|
||||||
|
public function isAccessTokenRevoked($tokenId)
|
||||||
|
{
|
||||||
|
// TODO: Implement isAccessTokenRevoked() method.
|
||||||
|
}
|
||||||
|
}
|
30
com_oauthserver/site/src/Repository/AuthCodeRepository.php
Normal file
30
com_oauthserver/site/src/Repository/AuthCodeRepository.php
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Webmasterskaya\Component\OauthServer\Site\Repository;
|
||||||
|
|
||||||
|
use League\OAuth2\Server\Entities\AuthCodeEntityInterface;
|
||||||
|
use League\OAuth2\Server\Repositories\AuthCodeRepositoryInterface;
|
||||||
|
|
||||||
|
class AuthCodeRepository implements AuthCodeRepositoryInterface
|
||||||
|
{
|
||||||
|
|
||||||
|
public function getNewAuthCode()
|
||||||
|
{
|
||||||
|
// TODO: Implement getNewAuthCode() method.
|
||||||
|
}
|
||||||
|
|
||||||
|
public function persistNewAuthCode(AuthCodeEntityInterface $authCodeEntity)
|
||||||
|
{
|
||||||
|
// TODO: Implement persistNewAuthCode() method.
|
||||||
|
}
|
||||||
|
|
||||||
|
public function revokeAuthCode($codeId)
|
||||||
|
{
|
||||||
|
// TODO: Implement revokeAuthCode() method.
|
||||||
|
}
|
||||||
|
|
||||||
|
public function isAuthCodeRevoked($codeId)
|
||||||
|
{
|
||||||
|
// TODO: Implement isAuthCodeRevoked() method.
|
||||||
|
}
|
||||||
|
}
|
37
com_oauthserver/site/src/Repository/ClientRepository.php
Normal file
37
com_oauthserver/site/src/Repository/ClientRepository.php
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Webmasterskaya\Component\OauthServer\Site\Repository;
|
||||||
|
|
||||||
|
use Joomla\CMS\MVC\Factory\MVCFactoryAwareTrait;
|
||||||
|
use Joomla\CMS\MVC\Factory\MVCFactoryInterface;
|
||||||
|
use League\OAuth2\Server\Entities\ClientEntityInterface;
|
||||||
|
use League\OAuth2\Server\Repositories\ClientRepositoryInterface;
|
||||||
|
|
||||||
|
class ClientRepository implements ClientRepositoryInterface
|
||||||
|
{
|
||||||
|
use MVCFactoryAwareTrait;
|
||||||
|
|
||||||
|
public function __construct(MVCFactoryInterface $MVCFactory)
|
||||||
|
{
|
||||||
|
$this->setMVCFactory($MVCFactory);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param $clientIdentifier
|
||||||
|
* @return \League\OAuth2\Server\Entities\ClientEntityInterface
|
||||||
|
* @throws \Exception
|
||||||
|
* @since version
|
||||||
|
*/
|
||||||
|
public function getClientEntity($clientIdentifier): ClientEntityInterface
|
||||||
|
{
|
||||||
|
/** @var \Webmasterskaya\Component\OauthServer\Administrator\Table\ClientTable $table */
|
||||||
|
$table = $this->getMVCFactory()->createTable('Client', 'Administrator');
|
||||||
|
$table->load(['identifier' => $clientIdentifier]);
|
||||||
|
return $table;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function validateClient($clientIdentifier, $clientSecret, $grantType)
|
||||||
|
{
|
||||||
|
// TODO: Implement validateClient() method.
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,30 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Webmasterskaya\Component\OauthServer\Site\Repository;
|
||||||
|
|
||||||
|
use League\OAuth2\Server\Entities\RefreshTokenEntityInterface;
|
||||||
|
use League\OAuth2\Server\Repositories\RefreshTokenRepositoryInterface;
|
||||||
|
|
||||||
|
class RefreshTokenRepository implements RefreshTokenRepositoryInterface
|
||||||
|
{
|
||||||
|
|
||||||
|
public function getNewRefreshToken()
|
||||||
|
{
|
||||||
|
// TODO: Implement getNewRefreshToken() method.
|
||||||
|
}
|
||||||
|
|
||||||
|
public function persistNewRefreshToken(RefreshTokenEntityInterface $refreshTokenEntity)
|
||||||
|
{
|
||||||
|
// TODO: Implement persistNewRefreshToken() method.
|
||||||
|
}
|
||||||
|
|
||||||
|
public function revokeRefreshToken($tokenId)
|
||||||
|
{
|
||||||
|
// TODO: Implement revokeRefreshToken() method.
|
||||||
|
}
|
||||||
|
|
||||||
|
public function isRefreshTokenRevoked($tokenId)
|
||||||
|
{
|
||||||
|
// TODO: Implement isRefreshTokenRevoked() method.
|
||||||
|
}
|
||||||
|
}
|
20
com_oauthserver/site/src/Repository/ScopeRepository.php
Normal file
20
com_oauthserver/site/src/Repository/ScopeRepository.php
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Webmasterskaya\Component\OauthServer\Site\Repository;
|
||||||
|
|
||||||
|
use League\OAuth2\Server\Entities\ClientEntityInterface;
|
||||||
|
use League\OAuth2\Server\Repositories\ScopeRepositoryInterface;
|
||||||
|
|
||||||
|
class ScopeRepository implements ScopeRepositoryInterface
|
||||||
|
{
|
||||||
|
|
||||||
|
public function getScopeEntityByIdentifier($identifier)
|
||||||
|
{
|
||||||
|
// TODO: Implement getScopeEntityByIdentifier() method.
|
||||||
|
}
|
||||||
|
|
||||||
|
public function finalizeScopes(array $scopes, $grantType, ClientEntityInterface $clientEntity, $userIdentifier = null)
|
||||||
|
{
|
||||||
|
// TODO: Implement finalizeScopes() method.
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user