9#include <sonde/sonde_core_export.h>
11#include <QtCore/QList>
12#include <QtCore/QString>
13#include <QtCore/QStringList>
17namespace Sonde::Trust {
31SONDE_CORE_EXPORT QString configDirectory();
51 QString scopeKey()
const;
69SONDE_CORE_EXPORT QString
filePath(
const QString &directory,
const QString &name,
bool component);
72SONDE_CORE_EXPORT QString
sha256(
const QByteArray &data);
109 QString untrustedReason(
const QString &path,
const QString &hash,
110 const QString &scopeKey)
const;
115 bool trust(
const QList<TrustedFile> &files,
bool everywhere,
const QString &scopeKey,
116 const QString &how, QString *error)
const;
120 std::optional<QList<Entry>> entries(QString *error)
const;
124 int revoke(
const QStringList &paths, QString *error)
const;
129 int repath(
const QHash<QString, QString> &moved, QString *error)
const;
TrustStore(QString file)
The store in file (read on every call: other processes write it too).
Definition trust_p.h:105
QString m_file
The store's file.
Definition trust_p.h:132
TrustStore(QString file)
The store in file (read on every call: other processes write it too).
Definition trust_p.h:105
QString libraryName(Library library)
"project" or "user".
Definition trust.cpp:84
QString canonicalOrClean(const QString &path)
path made canonical if it exists, otherwise only absolute and clean.
Definition trust.cpp:105
One grant in the trust store.
Definition trust_p.h:84
QString how
"user", "app" or "saved".
Definition trust_p.h:87
QString date
When, in UTC (ISO 8601).
Definition trust_p.h:88
bool operator==(const Entry &other) const
Whether every field is the same.
Definition trust_p.h:93
QString name
Its name then.
Definition trust_p.h:90
QString sha256
The trusted content's hash.
Definition trust_p.h:85
QString where
"everywhere", or the checkout (or executable) it applies to.
Definition trust_p.h:86
QString path
The file's path when it was trusted.
Definition trust_p.h:89
Where the libraries and the trust file are.
Definition trust_p.h:38
QString projectFoundBy
How the project library was found, for the reply.
Definition trust_p.h:41
QString user
The user library's directory (may not exist yet).
Definition trust_p.h:42
QString trustFile
The trust store's file (may not exist yet).
Definition trust_p.h:43
QString checkoutRoot
The checkout's directory (canonical), or empty if none was found.
Definition trust_p.h:40
QString directory(Library library) const
The directory of library (empty for a project library that wasn't found).
Definition trust_p.h:46
QString project
The project library's directory (may not exist yet), or empty.
Definition trust_p.h:39
A directory to search upwards from for the project library, and how to say so.
Definition trust_p.h:56
QString how
For the reply, e.g. "above the working directory".
Definition trust_p.h:58
QString directory
Where the search starts.
Definition trust_p.h:57
A file to trust: how it is named, where it is, and its content's hash.
Definition trust_p.h:76
QString name
A template's name, or the file's path in its library.
Definition trust_p.h:77
QString sha256
The SHA-256 of its content, in hex.
Definition trust_p.h:79
QString path
The full path on disk.
Definition trust_p.h:78
QString sha256(const QByteArray &data)
The SHA-256 of data, in hex.
Definition trust.cpp:162
Locations locate(const QList< Start > &starts)
Finds the libraries and the trust file now (the environment may change).
Definition trust.cpp:117
QString filePath(const QString &directory, const QString &name, bool component)
The file of template or component name in directory.
Definition trust.cpp:156
Library
The two libraries.
Definition trust_p.h:20
@ User
sonde/qml/ in the user's configuration directory.
Definition trust_p.h:22
@ Project
.sonde/qml/ in the checkout.
Definition trust_p.h:21