nextcloud/apps/cloud_federation_api/lib/Db/OcmTokenMap.php
Enrique Pérez Arnaud 789ff6a8a3
feat(cloud_federation_api): add token exchange endpoint issuing JWT access tokens
Co-authored-by: Micke Nordin <kano@sunet.se>
Signed-off-by: Micke Nordin <kano@sunet.se>
Signed-off-by: Enrique Pérez Arnaud <enrique@cazalla.net>
2026-06-17 11:01:11 +02:00

41 lines
1.1 KiB
PHP

<?php
declare(strict_types=1);
/**
* SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCA\CloudFederationAPI\Db;
use OCP\AppFramework\Db\Entity;
use OCP\DB\Types;
/**
* Maps a short-lived OCM access token (by its oc_authtoken id) to the
* long-lived refresh token it was issued for.
*
* @method int getAccessTokenId()
* @method void setAccessTokenId(int $id)
* @method string getRefreshToken()
* @method void setRefreshToken(string $token)
* @method int getExpires()
* @method void setExpires(int $expires)
*/
class OcmTokenMap extends Entity {
/** @var int ID of the access token row in oc_authtoken */
protected $accessTokenId;
/** @var string The refresh token this access token was issued for */
protected $refreshToken;
/** @var int Unix timestamp when the access token expires */
protected $expires;
public function __construct() {
$this->addType('accessTokenId', Types::INTEGER);
$this->addType('refreshToken', Types::STRING);
$this->addType('expires', Types::INTEGER);
}
}