Add docstrings to mdm_integration

This commit is contained in:
riccardom
2026-06-09 10:49:57 +00:00
parent d7f00b3beb
commit bd9fed41ad
13 changed files with 129 additions and 31 deletions

View File

@@ -70,7 +70,9 @@ const (
// It parses CLI flags, initializes logging, creates the Fyne application and tray icons,
// and constructs the service client (which may open a requested UI window). If a window-mode
// flag is set the Fyne event loop runs and main returns; otherwise it ensures only one
// instance is running, sets up signal handling and fonts, and starts the system tray loop.
// main is the program entry point that initializes logging and the Fyne UI, enforces single-instance behavior, creates the service client, and starts the system tray.
//
// It parses CLI flags, configures logging, constructs the Fyne application and service client (optionally showing a requested UI window), monitors theme/settings changes, ensures only a single instance runs (signaling an existing instance to show its window when present), sets up signal handling and default fonts, and finally runs the system tray loop.
func main() {
flags := parseFlags()
@@ -1698,7 +1700,8 @@ func (s *serviceClient) applyMDMLocks(managed []string) {
// Entry's placeholder slot. The placeholder is the only signal the user
// gets that a PSK is configured, because the entry's Text is forced to
// empty to keep the password reveal toggle from leaking the
// It returns an empty string if no pre-shared key is present; returns "MDM-managed" if the pre-shared key is enforced by MDM; otherwise returns "configured".
// preSharedKeyPlaceholder returns the placeholder text for the pre-shared key entry based on the daemon config.
// It returns an empty string if no pre-shared key is present, `MDM-managed` if the key is enforced by MDM, and `configured` otherwise.
func preSharedKeyPlaceholder(cfg *proto.GetConfigResponse) string {
if cfg == nil || cfg.PreSharedKey == "" {
return ""