1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
//! # Utilities Module
//!
//! Collection of utility functions and helpers for the Quetty terminal user interface.
//! This module provides reusable functionality that supports various aspects of the
//! application including authentication, connection string handling, and data security.
//!
//! ## Available Utilities
//!
//! ### Authentication Utilities
//!
//! The [`auth`] module provides helper functions for authentication operations:
//!
//! ```ignore
//! use quetty::utils::auth;
//!
//! // Validate authentication configuration
//! if auth::validate_auth_config(&config)? {
//! // Proceed with authentication
//! }
//! ```
//!
//! ### Connection String Utilities
//!
//! The [`connection_string`] module offers tools for working with Azure Service Bus connection strings:
//!
//! ```ignore
//! use quetty::utils::connection_string;
//!
//! // Parse and validate connection strings
//! let conn_str = "Endpoint=sb://example.servicebus.windows.net/";
//! let parsed = connection_string::parse_connection_string(&conn_str)?;
//! let is_valid = connection_string::validate_connection_string(&conn_str);
//! ```
//!
//! ### Encryption Utilities
//!
//! The [`encryption`] module provides secure data handling capabilities:
//!
//! ```ignore
//! use quetty::utils::encryption;
//!
//! // Encrypt sensitive configuration data
//! let sensitive_data = "secret_key";
//! let password = "user_password";
//! let encrypted = encryption::encrypt_data(&sensitive_data, &password)?;
//! let decrypted = encryption::decrypt_data(&encrypted, &password)?;
//! ```
//!
//! ## Design Principles
//!
//! - **Security First** - All utilities prioritize data security and safe operations
//! - **Error Handling** - Comprehensive error handling with detailed feedback
//! - **Reusability** - Functions designed for use across multiple components
//! - **Performance** - Efficient implementations suitable for terminal UI responsiveness
//! - **Validation** - Input validation and sanitization where appropriate