QtPass 2.0.0
Developer documentation
Loading...
Searching...
No Matches
EntryRecord Class Reference

Remembers, outside the store, which entry paths this device has saved, so an entry that appeared under a new path is told apart. More...

#include <entryrecord.h>

Static Public Member Functions

static auto known (const QString &entryFile) -> bool
 Whether this device saved entryFile, or found it there when the store was seeded.
static void remember (const QStringList &paths)
 Record entries this device has just written.
static void seedStore (const QString &storeRoot)
 Record every entry of a store the first time it is seen; later calls for the same store do nothing. Tried once per store and run: a seed that could not be written is not retried later in the run, when a pull may have brought entries in.
static auto recordFile () -> QString
 Where the record is kept.

Detailed Description

Remembers, outside the store, which entry paths this device has saved, so an entry that appeared under a new path is told apart.

Someone who can push to a shared store can rename a folder past its own signed recipient list: its entries then fall back to a parent's list, and the recipient IDs inside them, which the same person can write, say nothing to trust. What they cannot write is this device's own record. A rename moves every entry to a path this device never saved, and the edit dialog asks before saving over such an entry.

Paths are kept as SHA-256 of their canonical form (as GpgIdGeneration::key() does), in a JSON file beside the generation record. A store is seeded once with the entries it holds when first seen (trust on first use).

Definition at line 32 of file entryrecord.h.

Member Function Documentation

◆ known()

auto EntryRecord::known ( const QString & entryFile) -> bool
static

Whether this device saved entryFile, or found it there when the store was seeded.

Parameters
entryFileAbsolute path of a .gpg entry.
Returns
false also when the record cannot be read: unknown is asked about.

Definition at line 160 of file entryrecord.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ recordFile()

auto EntryRecord::recordFile ( ) -> QString
static

Where the record is kept.

Returns
Its absolute path.

Definition at line 155 of file entryrecord.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ remember()

void EntryRecord::remember ( const QStringList & paths)
static

Record entries this device has just written.

Parameters
pathsAbsolute paths of entries, or of folders whose entries (*.gpg, links and hidden folders left out) are all recorded.

Definition at line 170 of file entryrecord.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ seedStore()

void EntryRecord::seedStore ( const QString & storeRoot)
static

Record every entry of a store the first time it is seen; later calls for the same store do nothing. Tried once per store and run: a seed that could not be written is not retried later in the run, when a pull may have brought entries in.

Parameters
storeRootThe store's root folder.

Definition at line 186 of file entryrecord.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following files: