mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-07-25 06:54:43 +00:00
Added dummy files for credential data of passkeys.
This commit is contained in:
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
This file is part of Telegram Desktop,
|
||||
the official desktop application for the Telegram messaging service.
|
||||
|
||||
For license and copyright information please follow this link:
|
||||
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
namespace Data::Passkey {
|
||||
|
||||
struct RelyingParty {
|
||||
QString id;
|
||||
QString name;
|
||||
};
|
||||
|
||||
struct User {
|
||||
QByteArray id;
|
||||
QString name;
|
||||
QString displayName;
|
||||
};
|
||||
|
||||
struct CredentialParameter {
|
||||
QString type;
|
||||
int alg = 0;
|
||||
};
|
||||
|
||||
struct RegisterData {
|
||||
RelyingParty rp;
|
||||
User user;
|
||||
QByteArray challenge;
|
||||
std::vector<CredentialParameter> pubKeyCredParams;
|
||||
int timeout = 60000;
|
||||
};
|
||||
|
||||
struct Credential {
|
||||
QByteArray id;
|
||||
QString type;
|
||||
};
|
||||
|
||||
struct LoginData {
|
||||
QByteArray challenge;
|
||||
QString rpId;
|
||||
std::vector<Credential> allowCredentials;
|
||||
QString userVerification;
|
||||
int timeout = 60000;
|
||||
};
|
||||
|
||||
[[nodiscard]] std::optional<RegisterData> DeserializeRegisterData(
|
||||
const QByteArray &jsonData);
|
||||
|
||||
[[nodiscard]] std::optional<LoginData> DeserializeLoginData(
|
||||
const QByteArray &jsonData);
|
||||
|
||||
[[nodiscard]] std::string SerializeClientDataCreate(
|
||||
const QByteArray &challenge);
|
||||
|
||||
[[nodiscard]] std::string SerializeClientDataGet(
|
||||
const QByteArray &challenge);
|
||||
|
||||
} // namespace Data::Passkey
|
||||
Reference in New Issue
Block a user