|
Sonde v1.1.0
Embeddable Model Context Protocol server for Qt applications
|
The trust store: which file contents the user trusts, and where. More...
#include <trust_p.h>
Public Member Functions | |
| TrustStore (QString file) | |
The store in file (read on every call: other processes write it too). | |
| QString | untrustedReason (const QString &path, const QString &hash, const QString &scopeKey) const |
Why a file at path with content hash isn't trusted for scopeKey, or an empty string if it is. | |
| bool | trust (const QList< TrustedFile > &files, bool everywhere, const QString &scopeKey, const QString &how, QString *error) const |
Records files as trusted, everywhere or for scopeKey only. | |
| std::optional< QList< Entry > > | entries (QString *error) const |
Every grant (none if the file doesn't exist); nothing, with error set, if it can't be read. | |
| int | revoke (const QStringList &paths, QString *error) const |
Removes every grant recorded for a file at one of paths. | |
| int | repath (const QHash< QString, QString > &moved, QString *error) const |
Changes the path of every grant recorded for a file that moved: a key of moved, to its value. | |
Private Attributes | |
| QString | m_file |
| The store's file. | |
The trust store: which file contents the user trusts, and where.
| int Sonde::Trust::TrustStore::repath | ( | const QHash< QString, QString > & | moved, |
| QString * | error ) const |
Changes the path of every grant recorded for a file that moved: a key of moved, to its value.
Writes the store only if a grant changed.
error set. | int Sonde::Trust::TrustStore::revoke | ( | const QStringList & | paths, |
| QString * | error ) const |
Removes every grant recorded for a file at one of paths.
error set. | bool Sonde::Trust::TrustStore::trust | ( | const QList< TrustedFile > & | files, |
| bool | everywhere, | ||
| const QString & | scopeKey, | ||
| const QString & | how, | ||
| QString * | error ) const |
Records files as trusted, everywhere or for scopeKey only.
| how | "user", "app" or "saved". |
error says why.