3#ifndef SRC_IMITATEPASS_H_
4#define SRC_IMITATEPASS_H_
40 auto removeDir(
const QString &dirName) -> bool;
52 void writeGpgIdFile(
const QString &gpgIdFile,
const QList<UserInfo> &users);
59 auto signGpgIdFile(
const QString &gpgIdFile,
const QStringList &signingKeys)
68 void gitAddGpgId(
const QString &gpgIdFile,
const QString &gpgIdSigFile,
69 bool addFile,
bool addSigFile);
78 QStringList &gpgId) -> bool;
97 const QStringList &recipients) -> bool;
106 bool force) -> QString;
115 void executeMoveGit(
const QString &src,
const QString &destFile,
bool force);
122 void gitCommit(
const QString &file,
const QString &msg);
133 QString input = QString(),
bool readStdout =
true,
134 bool readStderr =
true);
144 QString input = QString(),
bool readStdout =
true,
145 bool readStderr =
true);
162 : m_transaction(trans), m_result(result) {
163 m_transaction->transactionStart();
175 void finished(
int id,
int exitCode,
const QString &out,
176 const QString &err)
override;
182 QString input,
bool readStdout =
true,
183 bool readStderr =
true)
override;
217 void Show(QString file)
override;
225 void Insert(QString file, QString newValue,
bool overwrite =
false)
override;
229 void Remove(QString file,
bool isDir =
false)
override;
233 void Init(QString path,
const QList<UserInfo> &users)
override;
256 void Move(
const QString src,
const QString dest,
257 const bool force =
false)
override;
261 void Copy(
const QString src,
const QString dest,
262 const bool force =
false)
override;
~transactionHelper()
End transaction on destruction.
transactionHelper(simpleTransaction *trans, PROCESS result)
Start transaction.
auto createBackupCommit() -> bool
Create git backup commit before re-encryption.
void OtpGenerate(QString file) override
Generate OTP.
void GitInit() override
Initialize Git repository.
void executeGpg(PROCESS id, const QStringList &args, QString input=QString(), bool readStdout=true, bool readStderr=true)
Execute GPG command.
void GitPull_b() override
Pull with rebase.
auto checkSigningKeys(const QStringList &signingKeys) -> bool
Check if signing keys are valid.
ImitatePass()
Construct ImitatePass instance.
auto reencryptSingleFile(const QString &fileName, const QStringList &recipients) -> bool
Re-encrypt single file with new recipients.
auto verifyGpgIdFile(const QString &file) -> bool
Verify .gpg-id file exists and is valid.
void executeGit(PROCESS id, const QStringList &args, QString input=QString(), bool readStdout=true, bool readStderr=true)
Execute git command.
void Init(QString path, const QList< UserInfo > &users) override
Initialize store.
auto verifyGpgIdForDir(const QString &file, QStringList &gpgIdFilesVerified, QStringList &gpgId) -> bool
Verify .gpg-id file for a directory.
void Insert(QString file, QString newValue, bool overwrite=false) override
Insert new password.
auto removeDir(const QString &dirName) -> bool
Remove directory recursively.
void executeMoveGit(const QString &src, const QString &destFile, bool force)
Execute git move operation.
void Move(const QString src, const QString dest, const bool force=false) override
Move password file.
void Copy(const QString src, const QString dest, const bool force=false) override
Copy password file.
void endReencryptPath()
Emitted after finishing re-encryption.
void finished(int id, int exitCode, const QString &out, const QString &err) override
Handle process completion.
void executeWrapper(PROCESS id, const QString &app, const QStringList &args, QString input, bool readStdout=true, bool readStderr=true) override
Execute command wrapper.
auto signGpgIdFile(const QString &gpgIdFile, const QStringList &signingKeys) -> bool
Sign .gpg-id file with signing keys.
void Remove(QString file, bool isDir=false) override
Remove password.
void GitPull() override
Pull from remote.
~ImitatePass() override=default
Destructor.
void Show(QString file) override
Show decrypted password.
auto resolveMoveDestination(const QString &src, const QString &dest, bool force) -> QString
Resolve destination for move operation.
void GitPush() override
Push to remote.
void writeGpgIdFile(const QString &gpgIdFile, const QList< UserInfo > &users)
Write recipients to .gpg-id file.
void gitAddGpgId(const QString &gpgIdFile, const QString &gpgIdSigFile, bool addFile, bool addSigFile)
Add .gpg-id to git staging.
void startReencryptPath()
Emitted before starting re-encryption.
auto getKeysFromFile(const QString &fileName) -> QStringList
Read recipients from file.
void reencryptPath(const QString &dir)
Re-encrypt entire directory.
void gitCommit(const QString &file, const QString &msg)
Commit changes to git.
Pass()
Construct a Pass instance.
PROCESS
Identifies different subprocess operations used in QtPass.