Type some of the core mappers
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
This commit is contained in:
parent
a1b351036c
commit
2664c7f75f
|
@ -30,6 +30,9 @@ use OCP\AppFramework\Db\QBMapper;
|
||||||
use OCP\IDBConnection;
|
use OCP\IDBConnection;
|
||||||
use OCP\IUser;
|
use OCP\IUser;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @template-extends QBMapper<RecentContact>
|
||||||
|
*/
|
||||||
class RecentContactMapper extends QBMapper {
|
class RecentContactMapper extends QBMapper {
|
||||||
public const TABLE_NAME = 'recent_contact';
|
public const TABLE_NAME = 'recent_contact';
|
||||||
|
|
||||||
|
|
|
@ -30,6 +30,9 @@ use OCP\DB\QueryBuilder\IQueryBuilder;
|
||||||
use OCP\IDBConnection;
|
use OCP\IDBConnection;
|
||||||
use OCP\IUser;
|
use OCP\IUser;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @template-extends QBMapper<BackupCode>
|
||||||
|
*/
|
||||||
class BackupCodeMapper extends QBMapper {
|
class BackupCodeMapper extends QBMapper {
|
||||||
public function __construct(IDBConnection $db) {
|
public function __construct(IDBConnection $db) {
|
||||||
parent::__construct($db, 'twofactor_backupcodes');
|
parent::__construct($db, 'twofactor_backupcodes');
|
||||||
|
|
|
@ -35,6 +35,9 @@ use OCP\AppFramework\Db\QBMapper;
|
||||||
use OCP\DB\QueryBuilder\IQueryBuilder;
|
use OCP\DB\QueryBuilder\IQueryBuilder;
|
||||||
use OCP\IDBConnection;
|
use OCP\IDBConnection;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @template-extends QBMapper<DefaultToken>
|
||||||
|
*/
|
||||||
class DefaultTokenMapper extends QBMapper {
|
class DefaultTokenMapper extends QBMapper {
|
||||||
public function __construct(IDBConnection $db) {
|
public function __construct(IDBConnection $db) {
|
||||||
parent::__construct($db, 'authtoken');
|
parent::__construct($db, 'authtoken');
|
||||||
|
|
|
@ -32,6 +32,9 @@ use OCP\AppFramework\Db\QBMapper;
|
||||||
use OCP\DB\QueryBuilder\IQueryBuilder;
|
use OCP\DB\QueryBuilder\IQueryBuilder;
|
||||||
use OCP\IDBConnection;
|
use OCP\IDBConnection;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @template-extends QBMapper<PublicKeyToken>
|
||||||
|
*/
|
||||||
class PublicKeyTokenMapper extends QBMapper {
|
class PublicKeyTokenMapper extends QBMapper {
|
||||||
public function __construct(IDBConnection $db) {
|
public function __construct(IDBConnection $db) {
|
||||||
parent::__construct($db, 'authtoken');
|
parent::__construct($db, 'authtoken');
|
||||||
|
|
|
@ -219,7 +219,7 @@ class PublicKeyTokenProvider implements IProvider {
|
||||||
$activityInterval = $this->config->getSystemValueInt('token_auth_activity_update', 60);
|
$activityInterval = $this->config->getSystemValueInt('token_auth_activity_update', 60);
|
||||||
$activityInterval = min(max($activityInterval, 0), 300);
|
$activityInterval = min(max($activityInterval, 0), 300);
|
||||||
|
|
||||||
/** @var DefaultToken $token */
|
/** @var PublicKeyToken $token */
|
||||||
$now = $this->time->getTime();
|
$now = $this->time->getTime();
|
||||||
if ($token->getLastActivity() < ($now - $activityInterval)) {
|
if ($token->getLastActivity() < ($now - $activityInterval)) {
|
||||||
// Update token only once per minute
|
// Update token only once per minute
|
||||||
|
|
|
@ -30,6 +30,9 @@ use OCP\AppFramework\Db\DoesNotExistException;
|
||||||
use OCP\AppFramework\Db\QBMapper;
|
use OCP\AppFramework\Db\QBMapper;
|
||||||
use OCP\IDBConnection;
|
use OCP\IDBConnection;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @template-extends QBMapper<PublicKeyCredentialEntity>
|
||||||
|
*/
|
||||||
class PublicKeyCredentialMapper extends QBMapper {
|
class PublicKeyCredentialMapper extends QBMapper {
|
||||||
public function __construct(IDBConnection $db) {
|
public function __construct(IDBConnection $db) {
|
||||||
parent::__construct($db, 'webauthn', PublicKeyCredentialEntity::class);
|
parent::__construct($db, 'webauthn', PublicKeyCredentialEntity::class);
|
||||||
|
|
Loading…
Reference in New Issue