Struct Profile#
Defined in File profile.hpp
Struct Documentation#
-
struct Profile#
A single research-group profile stored in the profiles manifest.
Passwords are never stored in plain text. Only the PBKDF2-SHA256 hash and the random salt used to compute it are persisted.
Profiles are loaded from and saved to
~/.config/CSRU/mosaic/profiles.jsonby ProfileManager.See also
Public Types
Public Functions
-
inline bool is_guest() const noexcept#
- Returns:
trueif this is the built-in unauthenticated guest session.
-
inline bool has_password() const noexcept#
- Returns:
trueif a password hash is stored for this profile. Profiles without a password always pass authentication.
-
inline bool is_admin() const noexcept#
- Returns:
trueif this profile has administrator privileges.
Public Members
-
QString username#
Unique login key — lowercase alphanumeric + underscore, 3–32 chars.
-
QString displayName#
Human-readable group name shown in the login dialog and session metadata. Example:
"Cognitive Science Lab".
-
QString initials#
One or two uppercase letters derived from displayName, shown inside the avatar circle. Example:
"CL"for Cognitive Lab.
-
QString accentColour#
Hex RGB colour for the avatar background. Assigned round-robin from a fixed palette on registration. Example:
"#5566dd".
-
QString salt#
Hex-encoded random 32-byte salt used in the password hash. Empty string means no password was set.
-
QString passwordHash#
Hex-encoded PBKDF2-HMAC-SHA256 output (100 000 iterations, 32-byte key). Empty string means no password was set — any login attempt succeeds.
-
QDateTime lastLogin#
UTC timestamp of the most recent successful login.
-
QDateTime created#
UTC timestamp when this profile was first created.
-
QString institution#
Optional lab / university / department name (shown in admin panel and status bar).
-
inline bool is_guest() const noexcept#