mirror of
https://github.com/nuxsmin/sysPass.git
synced 2026-03-03 23:24:07 +01:00
Controllers are being splited into commands to better dependency management. Signed-off-by: Rubén D <nuxsmin@syspass.org>
123 lines
3.6 KiB
PHP
123 lines
3.6 KiB
PHP
<?php
|
|
/*
|
|
* sysPass
|
|
*
|
|
* @author nuxsmin
|
|
* @link https://syspass.org
|
|
* @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org
|
|
*
|
|
* This file is part of sysPass.
|
|
*
|
|
* sysPass is free software: you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
* (at your option) any later version.
|
|
*
|
|
* sysPass is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with sysPass. If not, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
|
|
namespace SP\Domain\Auth;
|
|
|
|
|
|
use Defuse\Crypto\Exception\CryptoException;
|
|
use Defuse\Crypto\Exception\EnvironmentIsBrokenException;
|
|
use Exception;
|
|
use SP\Core\Exceptions\ConstraintException;
|
|
use SP\Core\Exceptions\QueryException;
|
|
use SP\Core\Exceptions\SPException;
|
|
use SP\DataModel\AuthTokenData;
|
|
use SP\DataModel\ItemSearchData;
|
|
use SP\Domain\Auth\Services\AuthTokenService;
|
|
use SP\Domain\Common\Services\ServiceException;
|
|
use SP\Infrastructure\Common\Repositories\NoSuchItemException;
|
|
use SP\Infrastructure\Database\QueryResult;
|
|
|
|
/**
|
|
* Class AuthTokenService
|
|
*
|
|
* @package SP\Domain\Common\Services\AuthToken
|
|
*/
|
|
interface AuthTokenServiceInterface
|
|
{
|
|
/**
|
|
* @throws ConstraintException
|
|
* @throws QueryException
|
|
*/
|
|
public function search(ItemSearchData $itemSearchData): QueryResult;
|
|
|
|
/**
|
|
* @throws \SP\Core\Exceptions\ConstraintException
|
|
* @throws \SP\Core\Exceptions\QueryException
|
|
*/
|
|
public function getById(int $id): AuthTokenData;
|
|
|
|
/**
|
|
* @throws \SP\Core\Exceptions\ConstraintException
|
|
* @throws \SP\Core\Exceptions\QueryException
|
|
* @throws \SP\Infrastructure\Common\Repositories\NoSuchItemException
|
|
*/
|
|
public function delete(int $id): AuthTokenService;
|
|
|
|
/**
|
|
* Deletes all the items for given ids
|
|
*
|
|
* @throws ServiceException
|
|
* @throws ConstraintException
|
|
* @throws QueryException
|
|
*/
|
|
public function deleteByIdBatch(array $ids): int;
|
|
|
|
/**
|
|
* @throws SPException
|
|
* @throws CryptoException
|
|
* @throws EnvironmentIsBrokenException
|
|
* @throws ConstraintException
|
|
* @throws QueryException
|
|
*/
|
|
public function create(AuthTokenData $itemData): int;
|
|
|
|
/**
|
|
* @throws Exception
|
|
*/
|
|
public function refreshAndUpdate(AuthTokenData $itemData): void;
|
|
|
|
/**
|
|
* @throws \Defuse\Crypto\Exception\CryptoException
|
|
* @throws \Defuse\Crypto\Exception\EnvironmentIsBrokenException
|
|
* @throws \SP\Core\Exceptions\ConstraintException
|
|
* @throws \SP\Core\Exceptions\QueryException
|
|
* @throws \SP\Infrastructure\Common\Repositories\DuplicatedItemException
|
|
* @throws \SP\Infrastructure\Common\Repositories\NoSuchItemException
|
|
* @throws \SP\Domain\Common\Services\ServiceException
|
|
*/
|
|
public function update(AuthTokenData $itemData, ?string $token = null): void;
|
|
|
|
/**
|
|
* @throws SPException
|
|
* @throws ConstraintException
|
|
* @throws QueryException
|
|
*/
|
|
public function updateRaw(AuthTokenData $itemData): void;
|
|
|
|
/**
|
|
* Devolver los datos de un token
|
|
*
|
|
* @throws ConstraintException
|
|
* @throws NoSuchItemException
|
|
* @throws QueryException
|
|
*/
|
|
public function getTokenByToken(int $actionId, string $token);
|
|
|
|
/**
|
|
* @return AuthTokenData[]
|
|
* @throws ConstraintException
|
|
* @throws QueryException
|
|
*/
|
|
public function getAllBasic(): array;
|
|
} |