/* * SPDX-License-Identifier: GPL-3.0-or-later * SPDX-FileCopyrightText: 2020 Johan Ouwerkerk */ #ifndef ACCOUNTS_VALIDATION_H #define ACCOUNTS_VALIDATION_H #include "account.h" #include #include #include #include #include #include namespace accounts { bool checkId(const QUuid &id); bool checkSecret(const QString &secret); bool checkName(const QString &name); bool checkIssuer(const QString &issuer); bool checkTokenLength(uint tokenLength); bool checkTimeStep(uint timeStep); bool checkEpoch(const QDateTime &epoch, const std::function &clock = &QDateTime::currentMSecsSinceEpoch); bool checkOffset(const std::optional &offset, QCryptographicHash::Algorithm algorithm); } #endif