Ring Daemon 16.0.0
|
Functions | |
std::map< std::string, std::string > | checkManifestJsonContentValidity (const Json::Value &root) |
Check if manifest.json has minimum format and parses its content to a map<string, string>. | |
std::map< std::string, std::string > | checkManifestValidity (const std::vector< uint8_t > &vec) |
Recives manifest.json file contents, and checks its validity. | |
std::map< std::string, std::string > | checkManifestValidity (std::istream &stream) |
Reads manifest.json stream and checks if it's valid. | |
bool | checkPluginValidity (const std::filesystem::path &rootPath) |
Validates a plugin based on its manifest.json file. | |
const std::regex | DATA_REGEX ("^data" DIR_SEPARATOR_STR_ESC ".+") |
std::filesystem::path | dataPath (const std::filesystem::path &pluginSoPath) |
Returns data path given a plugin's library path. | |
std::string | getLanguage () |
Returns the language of the current locale. | |
std::map< std::string, std::string > | getLocales (const std::string &rootPath, const std::string &lang) |
Returns the available keys and translations for a given plugin. | |
std::map< std::string, std::string > | getPlatformInfo () |
Returns a map with platform information. | |
std::filesystem::path | getRootPathFromSoPath (const std::filesystem::path &soPath) |
Returns installation path given a plugin's library path. | |
std::filesystem::path | manifestPath (const std::filesystem::path &rootPath) |
Returns complete manifest.json file path given a installation path. | |
std::map< std::string, std::string > | parseManifestFile (const std::filesystem::path &manifestFilePath, const std::string &rootPath) |
Parses the manifest file of an installed plugin if it's valid. | |
std::string | parseManifestTranslation (const std::string &rootPath, std::ifstream &manifestFile) |
Parses the manifest file of an installed plugin if it's valid. | |
std::map< std::string, std::string > | processLocaleFile (const std::string &localeFilePath) |
Returns the available keys and translations for a given file. | |
std::unique_ptr< dht::crypto::Certificate > | readPluginCertificate (const std::string &rootPath, const std::string &pluginId) |
Read the plugin's certificate. | |
std::unique_ptr< dht::crypto::Certificate > | readPluginCertificateFromArchive (const std::string &jplPath) |
Read plugin certificate without uncompressing the whole archive.and return an object Certificate. | |
std::map< std::string, std::string > | readPluginManifestFromArchive (const std::string &jplPath) |
Reads the manifest file content without uncompressing the whole archive and return a map with manifest contents if success. | |
std::map< std::string, std::vector< uint8_t > > | readPluginSignatureFromArchive (const std::string &jplPath) |
Reads signature file content without uncompressing the whole archive and. | |
std::vector< uint8_t > | readSignatureFileFromArchive (const std::string &jplPath) |
Read the signature of the file signature without uncompressing the whole archive. | |
const std::regex | SO_REGEX (DIR_SEPARATOR_STR_ESC "(.*)" DIR_SEPARATOR_STR_ESC "([a-zA-Z0-9]+.(dylib|so|dll|lib).*)") |
std::pair< bool, std::string_view > | uncompressJplFunction (std::string_view relativeFileName) |
Function used by archiver to extract files from plugin jpl to the plugin installation path. | |
std::map< std::string, std::string > jami::PluginUtils::checkManifestJsonContentValidity | ( | const Json::Value & | root | ) |
Check if manifest.json has minimum format and parses its content to a map<string, string>.
root |
Definition at line 100 of file pluginsutils.cpp.
References jami::emitSignal(), and jami::swarm_protocol::version.
Referenced by checkManifestValidity(), and checkManifestValidity().
std::map< std::string, std::string > jami::PluginUtils::checkManifestValidity | ( | const std::vector< uint8_t > & | vec | ) |
Recives manifest.json file contents, and checks its validity.
vec |
Definition at line 138 of file pluginsutils.cpp.
References checkManifestJsonContentValidity(), and jami::emitSignal().
std::map< std::string, std::string > jami::PluginUtils::checkManifestValidity | ( | std::istream & | stream | ) |
Reads manifest.json stream and checks if it's valid.
stream |
Definition at line 123 of file pluginsutils.cpp.
References checkManifestJsonContentValidity(), and jami::emitSignal().
Referenced by parseManifestFile(), and readPluginManifestFromArchive().
Validates a plugin based on its manifest.json file.
rootPath |
Definition at line 199 of file pluginsutils.cpp.
References jami::emitSignal(), manifestPath(), and parseManifestFile().
Referenced by jami::JamiPluginManager::getInstalledPlugins(), and jami::JamiPluginManager::uninstallPlugin().
const std::regex jami::PluginUtils::DATA_REGEX | ( | "^data" DIR_SEPARATOR_STR_ESC ".+" | ) |
std::filesystem::path jami::PluginUtils::dataPath | ( | const std::filesystem::path & | pluginSoPath | ) |
Returns data path given a plugin's library path.
pluginSoPath |
Definition at line 94 of file pluginsutils.cpp.
References jami::emitSignal(), and getRootPathFromSoPath().
std::string jami::PluginUtils::getLanguage | ( | ) |
Returns the language of the current locale.
Definition at line 284 of file pluginsutils.cpp.
References jami::emitSignal(), JAMI_INFO, and jami::string_replace().
Referenced by jami::PluginPreferencesUtils::getPreferences(), and parseManifestTranslation().
std::map< std::string, std::string > jami::PluginUtils::getLocales | ( | const std::string & | rootPath, |
const std::string & | lang | ||
) |
Returns the available keys and translations for a given plugin.
If the locale is not available, return the english default.
rootPath | |
lang |
Definition at line 331 of file pluginsutils.cpp.
References DIR_SEPARATOR_CH, jami::emitSignal(), and processLocaleFile().
Referenced by jami::PluginPreferencesUtils::getPreferences(), and parseManifestTranslation().
std::map< std::string, std::string > jami::PluginUtils::getPlatformInfo | ( | ) |
Returns a map with platform information.
Definition at line 80 of file pluginsutils.cpp.
References ABI.
Referenced by jami::JamiPluginManager::getPlatformInfo().
std::filesystem::path jami::PluginUtils::getRootPathFromSoPath | ( | const std::filesystem::path & | soPath | ) |
Returns installation path given a plugin's library path.
soPath |
Definition at line 88 of file pluginsutils.cpp.
References jami::emitSignal().
Referenced by dataPath().
std::filesystem::path jami::PluginUtils::manifestPath | ( | const std::filesystem::path & | rootPath | ) |
Returns complete manifest.json file path given a installation path.
rootPath |
Definition at line 74 of file pluginsutils.cpp.
References jami::emitSignal().
Referenced by jami::JamiPluginManager::checkPluginCertificatePublicKey(), checkPluginValidity(), jami::JamiPluginManager::getPluginDetails(), and jami::JamiPluginManager::installPlugin().
std::map< std::string, std::string > jami::PluginUtils::parseManifestFile | ( | const std::filesystem::path & | manifestFilePath, |
const std::string & | rootPath | ||
) |
Parses the manifest file of an installed plugin if it's valid.
manifestFilePath |
Definition at line 157 of file pluginsutils.cpp.
References checkManifestValidity(), jami::emitSignal(), JAMI_ERR, and parseManifestTranslation().
Referenced by jami::JamiPluginManager::checkPluginCertificatePublicKey(), checkPluginValidity(), jami::JamiPluginManager::getPluginDetails(), and jami::JamiPluginManager::installPlugin().
std::string jami::PluginUtils::parseManifestTranslation | ( | const std::string & | rootPath, |
std::ifstream & | manifestFile | ||
) |
Parses the manifest file of an installed plugin if it's valid.
rootPath | |
manifestFile |
Definition at line 173 of file pluginsutils.cpp.
References jami::emitSignal(), getLanguage(), getLocales(), and std::regex_search().
Referenced by parseManifestFile().
std::map< std::string, std::string > jami::PluginUtils::processLocaleFile | ( | const std::string & | localeFilePath | ) |
Returns the available keys and translations for a given file.
If the locale is not available, return empty map.
localeFilePath |
Definition at line 352 of file pluginsutils.cpp.
References jami::emitSignal().
Referenced by getLocales().
std::unique_ptr< dht::crypto::Certificate > jami::PluginUtils::readPluginCertificate | ( | const std::string & | rootPath, |
const std::string & | pluginId | ||
) |
Read the plugin's certificate.
rootPath | |
pluginId |
Definition at line 216 of file pluginsutils.cpp.
References DIR_SEPARATOR_CH, jami::emitSignal(), JAMI_ERR, and jami::fileutils::loadFile().
Referenced by jami::JamiPluginManager::checkPluginCertificatePublicKey(), and jami::JamiPluginManager::getPluginAuthor().
std::unique_ptr< dht::crypto::Certificate > jami::PluginUtils::readPluginCertificateFromArchive | ( | const std::string & | jplPath | ) |
Read plugin certificate without uncompressing the whole archive.and return an object Certificate.
jplPath |
Definition at line 229 of file pluginsutils.cpp.
References jami::emitSignal(), JAMI_ERR, jami::archiver::readFileFromArchive(), and readPluginManifestFromArchive().
Referenced by jami::JamiPluginManager::checkPluginCertificate(), and jami::JamiPluginManager::checkPluginCertificatePublicKey().
std::map< std::string, std::string > jami::PluginUtils::readPluginManifestFromArchive | ( | const std::string & | jplPath | ) |
Reads the manifest file content without uncompressing the whole archive and return a map with manifest contents if success.
jplPath |
Definition at line 205 of file pluginsutils.cpp.
References checkManifestValidity(), jami::emitSignal(), JAMI_ERR, and jami::archiver::readFileFromArchive().
Referenced by jami::JamiPluginManager::checkPluginSignatureFile(), jami::JamiPluginManager::installPlugin(), and readPluginCertificateFromArchive().
std::map< std::string, std::vector< uint8_t > > jami::PluginUtils::readPluginSignatureFromArchive | ( | const std::string & | jplPath | ) |
Reads signature file content without uncompressing the whole archive and.
jplPath | return a map of signature path as key and signature content as value. |
Definition at line 245 of file pluginsutils.cpp.
References jami::emitSignal(), JAMI_ERR, and jami::archiver::readFileFromArchive().
Referenced by jami::JamiPluginManager::checkPluginSignatureFile(), and jami::JamiPluginManager::checkPluginSignatureValidity().
std::vector< uint8_t > jami::PluginUtils::readSignatureFileFromArchive | ( | const std::string & | jplPath | ) |
Read the signature of the file signature without uncompressing the whole archive.
jplPath |
Definition at line 261 of file pluginsutils.cpp.
References jami::emitSignal(), and jami::archiver::readFileFromArchive().
Referenced by jami::JamiPluginManager::checkPluginSignatureValidity().
const std::regex jami::PluginUtils::SO_REGEX | ( | DIR_SEPARATOR_STR_ESC "(.*)" DIR_SEPARATOR_STR_ESC "([a-zA-Z0-9]+.(dylib|so|dll|lib).*)" | ) |
Referenced by uncompressJplFunction().
std::pair< bool, std::string_view > jami::PluginUtils::uncompressJplFunction | ( | std::string_view | relativeFileName | ) |
Function used by archiver to extract files from plugin jpl to the plugin installation path.
relativeFileName |
Definition at line 267 of file pluginsutils.cpp.
References ABI, jami::emitSignal(), std::regex_search(), SO_REGEX(), and std::svsub_match_view().
Referenced by jami::JamiPluginManager::installPlugin().