QtPass 1.7.0
Multi-platform GUI for pass, the standard unix password manager.
Loading...
Searching...
No Matches
RealPass Class Reference

Implementation of Pass that wraps the 'pass' command-line tool. More...

#include <realpass.h>

Inheritance diagram for RealPass:
Collaboration diagram for RealPass:

Public Member Functions

 RealPass ()
 Construct a RealPass instance.
 ~RealPass () override=default
 Destructor.
void GitInit () override
 Initialize Git repository in password store.
void GitPull () override
 Pull changes from remote.
void GitPull_b () override
 Pull with rebase.
void GitPush () override
 Push changes to remote.
void Show (QString file) override
 Show decrypted password.
void OtpGenerate (QString file) override
 Generate OTP code.
void Insert (QString file, QString newValue, bool overwrite=false) override
 Insert new password.
void Remove (QString file, bool isDir=false) override
 Remove password or directory.
void Init (QString path, const QList< UserInfo > &users) override
 Initialize password store.
void Move (const QString src, const QString dest, const bool force=false) override
 Move password file or directory.
void Copy (const QString src, const QString dest, const bool force=false) override
 Copy password file or directory.
void Grep (QString pattern, bool caseInsensitive=false) override
 Search password content via 'pass grep'.
Public Member Functions inherited from Pass
 Pass ()
 Construct a Pass instance.
void init ()
 Initialize the Pass instance.
virtual auto generatePassword (unsigned int length, const QString &charset) -> QString
 Generate random password.
void GenerateGPGKeys (QString batch)
 Generate GPG keys using batch script.
auto listKeys (QStringList keystrings, bool secret=false) -> QList< UserInfo >
 List GPG keys matching patterns.
auto listKeys (const QString &keystring="", bool secret=false) -> QList< UserInfo >
 List GPG keys.
void updateEnv ()
 Update environment for subprocesses.

Additional Inherited Members

Signals inherited from Pass
void error (QProcess::ProcessError)
 Emitted when a process error occurs.
void startingExecuteWrapper ()
 Emitted before executing a command.
void statusMsg (const QString &msg, int timeout)
 Emit status message.
void critical (const QString &title, const QString &message)
 Emit critical error.
void processErrorExit (int exitCode, const QString &err)
 Emitted on process error exit.
void finishedAny (const QString &out, const QString &err)
 Emitted when any operation finishes.
void finishedGitInit (const QString &out, const QString &err)
 Emitted when Git init finishes.
void finishedGitPull (const QString &out, const QString &err)
 Emitted when Git pull finishes.
void finishedGitPush (const QString &out, const QString &err)
 Emitted when Git push finishes.
void finishedShow (const QString &out)
 Emitted when show finishes.
void finishedOtpGenerate (const QString &out)
 Emitted when OTP generation finishes.
void finishedInsert (const QString &out, const QString &err)
 Emitted when insert finishes.
void finishedRemove (const QString &out, const QString &err)
 Emitted when remove finishes.
void finishedInit (const QString &out, const QString &err)
 Emitted when init finishes.
void finishedMove (const QString &out, const QString &err)
 Emitted when move finishes.
void finishedCopy (const QString &out, const QString &err)
 Emitted when copy finishes.
void finishedGenerate (const QString &out, const QString &err)
 Emitted when generate finishes.
void finishedGenerateGPGKeys (const QString &out, const QString &err)
 Emitted when GPG key generation finishes.
void finishedGrep (const QList< QPair< QString, QStringList > > &results)
 Emitted when grep finishes with matching results.
Static Public Member Functions inherited from Pass
static bool gpgSupportsEd25519 ()
 Check if GPG supports Ed25519 encryption.
static QString getDefaultKeyTemplate ()
 Get default key template for new GPG keys.
static auto resolveGpgconfCommand (const QString &gpgPath) -> ResolvedGpgconfCommand
 Resolve the gpgconf command to kill agents.
static auto getGpgIdPath (const QString &for_file) -> QString
 Get .gpg-id file path for a password file.
static auto getRecipientList (const QString &for_file) -> QStringList
 Get list of recipients for a password file.
static auto getRecipientString (const QString &for_file, const QString &separator=" ", int *count=nullptr) -> QStringList
 Get recipients as string.
Protected Types inherited from Pass
using PROCESS = Enums::PROCESS
 Alias for Enums::PROCESS used throughout this class.
Protected Slots inherited from Pass
virtual void finished (int id, int exitCode, const QString &out, const QString &err)
 Handle process completion.
Protected Member Functions inherited from Pass
void executeWrapper (PROCESS id, const QString &app, const QStringList &args, bool readStdout=true, bool readStderr=true)
 Execute external wrapper command.
auto generateRandomPassword (const QString &charset, unsigned int length) -> QString
 Generate random password from charset.
auto boundedRandom (quint32 bound) -> quint32
 Generate random number in range.
void setEnvVar (const QString &key, const QString &value)
 Set or remove an environment variable.
virtual void executeWrapper (PROCESS id, const QString &app, const QStringList &args, QString input, bool readStdout=true, bool readStderr=true)
 Execute wrapper with input.
Protected Attributes inherited from Pass
Executor exec
 Internal command executor for queuing and running subprocesses.

Detailed Description

Implementation of Pass that wraps the 'pass' command-line tool.

RealPass delegates all password store operations to the external 'pass' utility. It provides a Qt-native interface while handling:

  • Git integration (init, pull, push)
  • Password CRUD (show, insert, remove, move, copy)
  • OTP generation
  • Store initialization with GPG keys

This is the primary implementation when 'pass' is available on the system.

Definition at line 21 of file realpass.h.

Member Function Documentation

◆ Copy()

void RealPass::Copy ( const QString src,
const QString dest,
const bool force = false )
overridevirtual

Copy password file or directory.

Parameters
srcSource path.
destDestination path.
forceOverwrite existing.

Implements Pass.

◆ GitInit()

void RealPass::GitInit ( )
overridevirtual

Initialize Git repository in password store.

Implements Pass.

◆ GitPull()

void RealPass::GitPull ( )
overridevirtual

Pull changes from remote.

Implements Pass.

◆ GitPull_b()

void RealPass::GitPull_b ( )
overridevirtual

Pull with rebase.

Implements Pass.

◆ GitPush()

void RealPass::GitPush ( )
overridevirtual

Push changes to remote.

Implements Pass.

◆ Grep()

void RealPass::Grep ( QString pattern,
bool caseInsensitive = false )
overridevirtual

Search password content via 'pass grep'.

Parameters
patternSearch pattern.
caseInsensitivetrue for case-insensitive search.

Implements Pass.

◆ Init()

void RealPass::Init ( QString path,
const QList< UserInfo > & users )
overridevirtual

Initialize password store.

Parameters
pathStore root path.
usersGPG recipients.

Implements Pass.

◆ Insert()

void RealPass::Insert ( QString file,
QString newValue,
bool overwrite = false )
overridevirtual

Insert new password.

Parameters
filePath to password file.
newValuePassword content.
overwritetrue to overwrite existing.

Implements Pass.

◆ Move()

void RealPass::Move ( const QString src,
const QString dest,
const bool force = false )
overridevirtual

Move password file or directory.

Parameters
srcSource path.
destDestination path.
forceOverwrite existing.

Implements Pass.

◆ OtpGenerate()

void RealPass::OtpGenerate ( QString file)
overridevirtual

Generate OTP code.

Parameters
filePath to password file with OTP.

Implements Pass.

◆ Remove()

void RealPass::Remove ( QString file,
bool isDir = false )
overridevirtual

Remove password or directory.

Parameters
filePath to remove.
isDirtrue if removing directory.

Implements Pass.

◆ Show()

void RealPass::Show ( QString file)
overridevirtual

Show decrypted password.

Parameters
filePath to password file.

Implements Pass.


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