ORE Studio 0.0.4
Loading...
Searching...
No Matches
Classes | Public Member Functions | List of all members
connection_manager Class Referencefinal

High-level service for managing server connections and environments. More...

#include <connection_manager.hpp>

Collaboration diagram for connection_manager:
Collaboration graph

Classes

struct  resolved_connection
 Resolved connection details for opening a login dialog. More...
 

Public Member Functions

 connection_manager (const std::filesystem::path &db_path, const std::string &master_password)
 Construct connection manager with database path and master password.
 
void create_folder (const domain::folder &folder)
 
void update_folder (const domain::folder &folder)
 
void delete_folder (const boost::uuids::uuid &id)
 
std::vector< domain::folderget_all_folders ()
 
std::optional< domain::folderget_folder (const boost::uuids::uuid &id)
 
std::vector< domain::folderget_root_folders ()
 
std::vector< domain::folderget_child_folders (const boost::uuids::uuid &parent_id)
 
void create_tag (const domain::tag &tag)
 
void update_tag (const domain::tag &tag)
 
void delete_tag (const boost::uuids::uuid &id)
 
std::vector< domain::tagget_all_tags ()
 
std::optional< domain::tagget_tag (const boost::uuids::uuid &id)
 
std::optional< domain::tagget_tag_by_name (const std::string &name)
 
void create_environment (const domain::environment &env)
 
void update_environment (const domain::environment &env)
 
void delete_environment (const boost::uuids::uuid &id)
 
std::vector< domain::environmentget_all_environments ()
 
std::optional< domain::environmentget_environment (const boost::uuids::uuid &id)
 
std::vector< domain::environmentget_environments_in_folder (const std::optional< boost::uuids::uuid > &folder_id)
 
void add_tag_to_environment (const boost::uuids::uuid &environment_id, const boost::uuids::uuid &tag_id)
 
void remove_tag_from_environment (const boost::uuids::uuid &environment_id, const boost::uuids::uuid &tag_id)
 
std::vector< domain::tagget_tags_for_environment (const boost::uuids::uuid &environment_id)
 
std::vector< domain::environmentget_environments_with_tag (const boost::uuids::uuid &tag_id)
 
void create_connection (domain::connection conn, const std::string &password)
 
void update_connection (domain::connection conn, const std::optional< std::string > &password)
 
void delete_connection (const boost::uuids::uuid &id)
 
std::vector< domain::connectionget_all_connections ()
 
std::optional< domain::connectionget_connection (const boost::uuids::uuid &id)
 
std::vector< domain::connectionget_connections_in_folder (const std::optional< boost::uuids::uuid > &folder_id)
 
std::string get_password (const boost::uuids::uuid &connection_id)
 Get decrypted password for a connection.
 
void add_tag_to_connection (const boost::uuids::uuid &connection_id, const boost::uuids::uuid &tag_id)
 
void remove_tag_from_connection (const boost::uuids::uuid &connection_id, const boost::uuids::uuid &tag_id)
 
std::vector< domain::tagget_tags_for_connection (const boost::uuids::uuid &connection_id)
 
std::vector< domain::connectionget_connections_with_tag (const boost::uuids::uuid &tag_id)
 
resolved_connection resolve_connection (const boost::uuids::uuid &connection_id)
 Resolve a connection to its full details for opening a login dialog.
 
bool verify_master_password ()
 Verify if the master password is correct.
 
void change_master_password (const std::string &new_password)
 Change the master password.
 
void purge ()
 Delete all data from the database.
 

Detailed Description

High-level service for managing server connections and environments.

Provides a unified API for managing:

Constructor & Destructor Documentation

◆ connection_manager()

connection_manager ( const std::filesystem::path &  db_path,
const std::string &  master_password 
)

Construct connection manager with database path and master password.

Parameters
db_pathPath to the SQLite database file.
master_passwordMaster password for encryption/decryption.

Member Function Documentation

◆ resolve_connection()

connection_manager::resolved_connection resolve_connection ( const boost::uuids::uuid &  connection_id)

Resolve a connection to its full details for opening a login dialog.

If the connection has an environment_id, fetches host/port from the environment. Decrypts the password. Throws if connection not found.

◆ verify_master_password()

bool verify_master_password ( )

Verify if the master password is correct.

Attempts to decrypt an existing password to verify the master password. Returns true if no passwords exist or if decryption succeeds.

◆ change_master_password()

void change_master_password ( const std::string &  new_password)

Change the master password.

Re-encrypts all stored connection passwords with the new master password.

◆ purge()

void purge ( )

Delete all data from the database.

Removes all connections, environments, folders, and tags. This operation cannot be undone.