Ring Daemon 16.0.0
|
#include <archive_account_manager.h>
Classes | |
struct | AddDeviceContext |
struct | ArchiveAccountCredentials |
struct | AuthMsg |
struct | DecodingContext |
struct | DeviceAuthInfo |
struct | DeviceContextBase |
struct | DhtLoadContext |
struct | LinkDeviceContext |
Public Member Functions | |
int32_t | addDevice (const std::string &uri, std::string_view auth_scheme, AuthChannelHandler *) override |
Initiates the process of adding a new device to the account. | |
ArchiveAccountManager (const std::string &accountId, const std::filesystem::path &path, OnExportConfig &&onExportConfig, std::string archivePath, const std::string &nameServer) | |
bool | cancelAddDevice (uint32_t token) override |
bool | changePassword (const std::string &password_old, const std::string &password_new) override |
bool | confirmAddDevice (uint32_t token) override |
bool | exportArchive (const std::string &destinationPath, std::string_view scheme, const std::string &password) |
virtual std::vector< uint8_t > | getPasswordKey (const std::string &) override |
void | initAuthentication (PrivateKey request, std::string deviceName, std::unique_ptr< AccountCredentials > credentials, AuthSuccessCallback onSuccess, AuthFailureCallback onFailure, const OnChangeCallback &onChange) override |
bool | isPasswordValid (const std::string &password) override |
void | onAuthReady (const std::string &deviceId, std::shared_ptr< dhtnet::ChannelSocket > channel) |
bool | provideAccountAuthentication (const std::string &credentialsFromUser, const std::string &scheme) |
bool | revokeDevice (const std::string &device, std::string_view scheme, const std::string &password, RevokeDeviceCallback) override |
bool | setValidity (std::string_view scheme, const std::string &password, dht::crypto::Identity &device, const dht::InfoHash &id, int64_t validity) |
Change the validity of a certificate. | |
void | startSync (const OnNewDeviceCb &, const OnDeviceAnnouncedCb &dcb={}, bool publishPresence=true) override |
void | syncDevices () override |
![]() | |
bool | acceptTrustRequest (const std::string &from, bool includeConversation=true) |
AccountManager (const std::string &accountId, const std::filesystem::path &path, const std::string &nameServer) | |
bool | addContact (const dht::InfoHash &uri, bool confirmed=false, const std::string &conversationId="") |
Add contact to the account contact list. | |
CertRequest | buildRequest (PrivateKey fDeviceKey) |
dhtnet::tls::CertificateStore & | certStore () const |
bool | discardTrustRequest (const std::string &from) |
virtual bool | findCertificate (const dht::InfoHash &h, std::function< void(const std::shared_ptr< dht::crypto::Certificate > &)> &&cb={}) |
virtual bool | findCertificate (const dht::PkId &h, std::function< void(const std::shared_ptr< dht::crypto::Certificate > &)> &&cb={}) |
void | forEachDevice (const dht::InfoHash &to, std::function< void(const std::shared_ptr< dht::crypto::PublicKey > &)> &&op, std::function< void(bool)> &&end={}) |
bool | foundAccountDevice (const std::shared_ptr< dht::crypto::Certificate > &crt, const std::string &name={}, const time_point &last_sync=time_point::min()) |
std::string | getAccountDeviceName () const |
std::vector< std::string > | getCertificatesByStatus (dhtnet::tls::TrustStore::PermissionStatus status) |
dhtnet::tls::TrustStore::PermissionStatus | getCertificateStatus (const std::string &cert_id) const |
std::map< std::string, std::string > | getContactDetails (const std::string &uri) const |
Obtain details about one account contact in serializable form. | |
std::optional< Contact > | getContactInfo (const std::string &uri) const |
std::vector< std::map< std::string, std::string > > | getContacts (bool includeRemoved=false) const |
const AccountInfo * | getInfo () const |
const std::map< dht::PkId, KnownDevice > & | getKnownDevices () const |
std::vector< std::map< std::string, std::string > > | getTrustRequests () const |
bool | isAllowed (const crypto::Certificate &crt, bool allowPublic=false) |
dht::crypto::Identity | loadIdentity (const std::string &crt_path, const std::string &key_path, const std::string &key_pwd) const |
virtual void | lookupAddress (const std::string &address, LookupCallback cb) |
virtual void | lookupUri (const std::string &name, const std::string &defaultServer, LookupCallback cb) |
bool | onPeerCertificate (const std::shared_ptr< dht::crypto::Certificate > &crt, bool allowPublic, dht::InfoHash &account_id) |
void | onPeerMessage (const dht::crypto::PublicKey &peer_device, bool allowPublic, PeerCertificateCb &&cb) |
virtual void | onSyncData (DeviceSync &&device, bool checkDevice=true) |
virtual void | registerName (const std::string &name, std::string_view scheme, const std::string &password, RegistrationCallback cb)=0 |
void | reloadContacts () |
void | removeContact (const std::string &uri, bool banned=true) |
void | removeContactConversation (const std::string &uri) |
virtual bool | searchUser (const std::string &, SearchCallback) |
void | sendTrustRequest (const std::string &to, const std::string &convId, const std::vector< uint8_t > &payload) |
void | sendTrustRequestConfirm (const dht::InfoHash &to, const std::string &conversationId) |
void | setAccountDeviceName (const std::string &name) |
bool | setCertificateStatus (const std::shared_ptr< crypto::Certificate > &cert, dhtnet::tls::TrustStore::PermissionStatus status, bool local=true) |
bool | setCertificateStatus (const std::string &cert_id, dhtnet::tls::TrustStore::PermissionStatus status) |
void | setDht (const std::shared_ptr< dht::DhtRunner > &dht) |
void | updateContactConversation (const std::string &uri, const std::string &convId) |
const AccountInfo * | useIdentity (const dht::crypto::Identity &id, const std::string &receipt, const std::vector< uint8_t > &receiptSignature, const std::string &username, const OnChangeCallback &onChange) |
virtual | ~AccountManager () |
Additional Inherited Members | |
![]() | |
static bool | foundPeerDevice (const std::string &accoundId, const std::shared_ptr< dht::crypto::Certificate > &crt, dht::InfoHash &account_id) |
Inform that a potential peer device have been found. | |
static std::shared_ptr< dht::Value > | parseAnnounce (const std::string &announceBase64, const std::string &accountId, const std::string &deviceSha1, const std::string &deviceSha256) |
![]() | |
static constexpr const char *const | DHT_TYPE_NS = "cx.ring" |
![]() | |
const std::string | accountId_ |
std::shared_ptr< dht::DhtRunner > | dht_ |
std::unique_ptr< AccountInfo > | info_ |
std::reference_wrapper< NameDirectory > | nameDir_ |
OnChangeCallback | onChange_ |
const std::filesystem::path | path_ |
Definition at line 37 of file archive_account_manager.h.
using jami::ArchiveAccountManager::OnExportConfig = std::function<std::map<std::string, std::string>()> |
Definition at line 40 of file archive_account_manager.h.
|
inline |
Definition at line 42 of file archive_account_manager.h.
|
overridevirtual |
Initiates the process of adding a new device to the account.
uri | The URI provided by the new device to be added |
auth_scheme | The auth scheme (currently only "password" is expected) |
chanel |
Reimplemented from jami::AccountManager.
Definition at line 896 of file archive_account_manager.cpp.
References jami::AUTH_URI_SCHEME, jami::CHANNEL_SCHEME, jami::AuthChannelHandler::connect(), JAMI_ERROR, JAMI_LOG, and JAMI_WARNING.
Reimplemented from jami::AccountManager.
Definition at line 1189 of file archive_account_manager.cpp.
|
overridevirtual |
Implements jami::AccountManager.
Definition at line 1655 of file archive_account_manager.cpp.
References jami::AccountArchive::save().
Reimplemented from jami::AccountManager.
Definition at line 1219 of file archive_account_manager.cpp.
References JAMI_DEBUG, and jami::ArchiveAccountManager::AuthMsg::set().
bool jami::ArchiveAccountManager::exportArchive | ( | const std::string & | destinationPath, |
std::string_view | scheme, | ||
const std::string & | password | ||
) |
Definition at line 1737 of file archive_account_manager.cpp.
References JAMI_ERR, and jami::AccountArchive::save().
|
overridevirtual |
Reimplemented from jami::AccountManager.
Definition at line 1669 of file archive_account_manager.cpp.
References JAMI_ERROR.
|
overridevirtual |
Implements jami::AccountManager.
Definition at line 47 of file archive_account_manager.cpp.
References jami::AccountManager::accountId_, jami::AccountManager::buildRequest(), jami::emitSignal(), jami::AccountManager::INVALID_ARGUMENTS, JAMI_DEBUG, JAMI_WARNING, and jami::AccountManager::onChange_.
Reimplemented from jami::AccountManager.
Definition at line 1766 of file archive_account_manager.cpp.
void jami::ArchiveAccountManager::onAuthReady | ( | const std::string & | deviceId, |
std::shared_ptr< dhtnet::ChannelSocket > | channel | ||
) |
bool jami::ArchiveAccountManager::provideAccountAuthentication | ( | const std::string & | credentialsFromUser, |
const std::string & | scheme | ||
) |
Definition at line 523 of file archive_account_manager.cpp.
References JAMI_ERROR, JAMI_WARNING, jami::ArchiveAccountManager::AuthMsg::logMsg(), and jami::ArchiveAccountManager::AuthMsg::set().
|
overridevirtual |
Reimplemented from jami::AccountManager.
Definition at line 1684 of file archive_account_manager.cpp.
References jami::AccountArchive::id, and jami::AccountArchive::revoked.
bool jami::ArchiveAccountManager::setValidity | ( | std::string_view | scheme, |
const std::string & | password, | ||
dht::crypto::Identity & | device, | ||
const dht::InfoHash & | id, | ||
int64_t | validity | ||
) |
Change the validity of a certificate.
If hash is empty, update all certificates
Definition at line 176 of file archive_account_manager.cpp.
References JAMI_LOG, and JAMI_WARNING.
|
overridevirtual |
Reimplemented from jami::AccountManager.
Definition at line 1552 of file archive_account_manager.cpp.
|
overridevirtual |
Implements jami::AccountManager.
Definition at line 1523 of file archive_account_manager.cpp.
References JAMI_LOG, and JAMI_WARNING.