{
  "report_info": {
    "version": "9.0.1",
    "generated_at": "2026-06-08T16:22:04Z",
    "binary_name": "online-auth"
  },
  "binary": {
    "name": "online-auth",
    "path": "/opt/kodachi/dashboard/hooks/online-auth",
    "timestamp": "2026-06-08T16:22:04Z",
    "file_info": {
      "size": 4648864,
      "sha256": "d22fc5792ac83ab2f7758c1e61bb13565725a1fbb4a69e1462d31c31ef4e8507"
    },
    "flag_n": {
      "command": "info",
      "data": {
        "author": "Warith Al Maawali",
        "copyright": "Copyright © 2026 Kodachi Security OS",
        "description": "Secure online authentication client for Kodachi OS",
        "features": [
          "Secure authentication with certificate pinning",
          "Session management with automatic heartbeat",
          "API key synchronization",
          "User group and status checking",
          "Comprehensive logging and error handling",
          "Multi-language architecture integration",
          "TLS 1.3 encrypted communications",
          "Real-time status monitoring",
          "Automatic retry mechanisms"
        ],
        "license": "Proprietary",
        "name": "online-auth",
        "securityFeatures": {
          "authentication": "Not provided by cli-core (see online-auth)",
          "encryption": "Not provided by cli-core",
          "inputValidation": "Argument parsing via clap; per-command validation is the consumer's responsibility",
          "rateLimiting": "Not provided by cli-core"
        },
        "systemRequirements": {
          "dependencies": [
            "OpenSSL",
            "libcurl"
          ],
          "os": "Linux (Debian-based)",
          "privileges": "root/sudo for system operations"
        },
        "version": "9.0.1",
        "website": "https://digi77.com"
      },
      "errors": [],
      "metadata": {
        "executionTime": 3,
        "hostname": "REDACTED-BUILD-HOST",
        "user": "REDACTED-BUILD-USER"
      },
      "status": "success",
      "timestamp": "2026-06-08T16:22:04.068298258Z",
      "version": "9.0.1",
      "warnings": []
    },
    "flag_v": {
      "command": "version",
      "data": {
        "buildDate": "REDACTED-BUILD-TIME",
        "gitCommit": "unknown",
        "name": "online-auth",
        "rustVersion": "1.82.0",
        "version": "9.0.1"
      },
      "errors": [],
      "metadata": {
        "executionTime": 3,
        "hostname": "REDACTED-BUILD-HOST",
        "user": "REDACTED-BUILD-USER"
      },
      "status": "success",
      "timestamp": "2026-06-08T16:22:04.128746064Z",
      "version": "9.0.1",
      "warnings": []
    },
    "flag_h": {
      "command": "help",
      "data": {
        "commandCategories": [
          {
            "category": "API Management",
            "commands": [
              {
                "description": "Manually sync API key with server",
                "examples": [
                  "online-auth sync-api-key",
                  "online-auth sync-api-key --json"
                ],
                "name": "sync-api-key",
                "options": [],
                "requires_sudo": false,
                "usage": "online-auth sync-api-key [OPTIONS]"
              }
            ]
          },
          {
            "category": "Authentication",
            "commands": [
              {
                "description": "Authenticate with the server",
                "examples": [
                  "online-auth authenticate",
                  "online-auth authenticate --json",
                  "online-auth authenticate --keep-alive",
                  "online-auth authenticate --keep-alive --json",
                  "online-auth authenticate --relogin",
                  "online-auth authenticate --keep-alive --relogin"
                ],
                "name": "authenticate",
                "options": [],
                "requires_sudo": false,
                "usage": "online-auth authenticate [OPTIONS]"
              },
              {
                "description": "Check if currently logged in",
                "examples": [
                  "online-auth check-login",
                  "online-auth check-login --json"
                ],
                "name": "check-login",
                "options": [],
                "requires_sudo": false,
                "usage": "online-auth check-login [OPTIONS]"
              },
              {
                "description": "End the current session",
                "examples": [
                  "online-auth logout",
                  "online-auth logout --json"
                ],
                "name": "logout",
                "options": [],
                "requires_sudo": false,
                "usage": "online-auth logout [OPTIONS]"
              },
              {
                "description": "Check if user ID is blocked",
                "examples": [
                  "online-auth check-if-blocked",
                  "online-auth check-if-blocked --json"
                ],
                "name": "check-if-blocked",
                "options": [],
                "requires_sudo": false,
                "usage": "online-auth check-if-blocked [OPTIONS]"
              },
              {
                "description": "Show user and session IDs",
                "examples": [
                  "online-auth get-ids",
                  "online-auth get-ids --json"
                ],
                "name": "get-ids",
                "options": [],
                "requires_sudo": false,
                "usage": "online-auth get-ids [OPTIONS]"
              },
              {
                "description": "Show all status information at once",
                "examples": [
                  "online-auth check-all-status",
                  "online-auth check-all-status --json"
                ],
                "name": "check-all-status",
                "options": [],
                "requires_sudo": false,
                "usage": "online-auth check-all-status [OPTIONS]"
              }
            ]
          },
          {
            "category": "Heartbeat",
            "commands": [
              {
                "description": "Send a single heartbeat",
                "examples": [
                  "online-auth send-heartbeat",
                  "online-auth send-heartbeat --json"
                ],
                "name": "send-heartbeat",
                "options": [],
                "requires_sudo": false,
                "usage": "online-auth send-heartbeat [OPTIONS]"
              },
              {
                "description": "Send heartbeat with retry",
                "examples": [
                  "online-auth send-heartbeat-with-retry",
                  "online-auth send-heartbeat-with-retry --json"
                ],
                "name": "send-heartbeat-with-retry",
                "options": [],
                "requires_sudo": false,
                "usage": "online-auth send-heartbeat-with-retry [OPTIONS]"
              },
              {
                "description": "Start automatic heartbeat service",
                "examples": [
                  "online-auth start-heartbeat",
                  "online-auth start-heartbeat --json"
                ],
                "name": "start-heartbeat",
                "options": [],
                "requires_sudo": false,
                "usage": "online-auth start-heartbeat [OPTIONS]"
              },
              {
                "description": "Stop automatic heartbeat service",
                "examples": [
                  "online-auth stop-heartbeat",
                  "online-auth stop-heartbeat --json"
                ],
                "name": "stop-heartbeat",
                "options": [],
                "requires_sudo": false,
                "usage": "online-auth stop-heartbeat [OPTIONS]"
              },
              {
                "description": "Check if heartbeat service is running",
                "examples": [
                  "online-auth check-heartbeat",
                  "online-auth check-heartbeat --json"
                ],
                "name": "check-heartbeat",
                "options": [],
                "requires_sudo": false,
                "usage": "online-auth check-heartbeat [OPTIONS]"
              }
            ]
          },
          {
            "category": "Information",
            "commands": [
              {
                "description": "Get user card URL",
                "examples": [
                  "online-auth get-card",
                  "online-auth get-card --json"
                ],
                "name": "get-card",
                "options": [],
                "requires_sudo": false,
                "usage": "online-auth get-card [OPTIONS]"
              },
              {
                "description": "Check which user group you belong to (VIP = premium)",
                "examples": [
                  "online-auth which-group",
                  "online-auth which-group --json"
                ],
                "name": "which-group",
                "options": [],
                "requires_sudo": false,
                "usage": "online-auth which-group [OPTIONS]"
              }
            ]
          },
          {
            "category": "License",
            "commands": [
              {
                "description": "Activate a license key for premium features",
                "examples": [
                  "online-auth activate-license --key \"H7KM-P2Q9-R5TW-X3YZ-A4B2\"",
                  "online-auth activate-license -k \"H7KM-P2Q9-R5TW-X3YZ-A4B2\" --json"
                ],
                "name": "activate-license",
                "options": [],
                "requires_sudo": false,
                "usage": "online-auth activate-license [OPTIONS]"
              },
              {
                "description": "Release license to allow transfer to another device",
                "examples": [
                  "online-auth release-license",
                  "online-auth release-license --json"
                ],
                "name": "release-license",
                "options": [],
                "requires_sudo": false,
                "usage": "online-auth release-license [OPTIONS]"
              },
              {
                "description": "Check current license status and details",
                "examples": [
                  "online-auth license-status",
                  "online-auth license-status --json"
                ],
                "name": "license-status",
                "options": [],
                "requires_sudo": false,
                "usage": "online-auth license-status [OPTIONS]"
              }
            ]
          },
          {
            "category": "Permission Guard",
            "commands": [
              {
                "description": "Enable permission guard daemon to monitor and fix file permissions",
                "examples": [
                  "online-auth enable-permission-guard",
                  "online-auth enable-permission-guard --json"
                ],
                "name": "enable-permission-guard",
                "options": [],
                "requires_sudo": false,
                "usage": "online-auth enable-permission-guard [OPTIONS]"
              },
              {
                "description": "Disable permission guard daemon",
                "examples": [
                  "online-auth disable-permission-guard",
                  "online-auth disable-permission-guard --json"
                ],
                "name": "disable-permission-guard",
                "options": [],
                "requires_sudo": false,
                "usage": "online-auth disable-permission-guard [OPTIONS]"
              },
              {
                "description": "Check permission guard daemon status",
                "examples": [
                  "online-auth permission-guard-status",
                  "online-auth permission-guard-status --json"
                ],
                "name": "permission-guard-status",
                "options": [],
                "requires_sudo": false,
                "usage": "online-auth permission-guard-status [OPTIONS]"
              }
            ]
          }
        ],
        "description": "Secure online authentication client for Kodachi OS",
        "environmentVariables": [
          {
            "default": "info",
            "description": "Set logging level",
            "name": "RUST_LOG",
            "values": "error|warn|info|debug|trace"
          },
          {
            "default": "unset",
            "description": "Disable all colored output when set",
            "name": "NO_COLOR",
            "values": "1|true|yes (any value disables color)"
          }
        ],
        "exitCodes": {
          "0": "Success",
          "1": "General error",
          "2": "Invalid arguments",
          "3": "Permission denied",
          "4": "Network error",
          "5": "File not found"
        },
        "globalOptions": [
          {
            "description": "Print help information",
            "flag": "-h, --help"
          },
          {
            "description": "Print version information",
            "flag": "-v, --version"
          },
          {
            "description": "Display detailed information",
            "flag": "-n, --info"
          },
          {
            "description": "Show usage examples",
            "flag": "-e, --examples"
          },
          {
            "description": "Output in JSON format",
            "flag": "--json"
          },
          {
            "description": "Force output format (text|json)",
            "flag": "-o, --output-format <FORMAT>"
          },
          {
            "description": "Pretty-print JSON output with indentation",
            "flag": "--json-pretty"
          },
          {
            "description": "Enhanced JSON output with improved formatting (like jq)",
            "flag": "--json-human"
          },
          {
            "description": "Select specific fields to include in output (comma-separated)",
            "flag": "--fields <FIELD_LIST>"
          },
          {
            "description": "Limit number of results returned",
            "flag": "--limit <NUMBER>"
          },
          {
            "description": "Skip first N results (for pagination)",
            "flag": "--offset <NUMBER>"
          },
          {
            "description": "Working directory (defaults to auto-detected base directory)",
            "flag": "-d, --work-dir <PATH>"
          },
          {
            "description": "Set custom port number (1024-65535)",
            "flag": "--port <PORT>"
          },
          {
            "description": "Set log level (error|warn|info|debug)",
            "flag": "--log-level <LEVEL>"
          },
          {
            "description": "Enable verbose output",
            "flag": "--verbose"
          },
          {
            "description": "Suppress non-essential output",
            "flag": "--quiet"
          },
          {
            "description": "Disable colored output",
            "flag": "--no-color"
          },
          {
            "description": "Use custom configuration file",
            "flag": "--config <FILE>"
          },
          {
            "description": "Set operation timeout in seconds (optional; no default applied)",
            "flag": "--timeout <SECS>"
          },
          {
            "description": "Retry attempts (optional; no default applied)",
            "flag": "--retry <COUNT>"
          }
        ],
        "name": "online-auth",
        "usage": "online-auth [OPTIONS] [COMMAND] [ARGS]"
      },
      "errors": [],
      "metadata": {
        "executionTime": 3,
        "hostname": "REDACTED-BUILD-HOST",
        "user": "REDACTED-BUILD-USER"
      },
      "status": "success",
      "timestamp": "2026-06-08T16:22:04.188608969Z",
      "version": "9.0.1",
      "warnings": []
    },
    "flag_e": {
      "command": "examples",
      "data": {
        "categories": [
          {
            "description": "Basic authentication operations",
            "examples": [
              {
                "command": "sudo online-auth authenticate",
                "description": "Authenticate with the server",
                "expectedOutput": "Authentication successful"
              },
              {
                "command": "sudo online-auth authenticate --json",
                "description": "Authenticate with JSON output",
                "expectedOutput": "JSON response with authentication status"
              },
              {
                "command": "sudo online-auth authenticate --keep-alive",
                "description": "Authenticate and enable auto-heartbeat",
                "expectedOutput": "Authentication successful with heartbeat enabled"
              },
              {
                "command": "sudo online-auth authenticate --relogin",
                "description": "Authenticate with auto-relogin on disconnection",
                "expectedOutput": "Auto-relogin enabled with authentication",
                "notes": "Automatically enables heartbeat (--keep-alive) and re-authenticates when session expires"
              },
              {
                "command": "sudo online-auth authenticate --keep-alive --relogin",
                "description": "Authenticate with explicit heartbeat and auto-relogin",
                "expectedOutput": "Authentication with heartbeat and auto-relogin enabled",
                "notes": "Both flags can be used together for clarity"
              },
              {
                "command": "sudo online-auth check-login",
                "description": "Check if currently logged in",
                "expectedOutput": "Login status displayed"
              },
              {
                "command": "sudo online-auth logout",
                "description": "End the current session",
                "expectedOutput": "Successfully logged out"
              },
              {
                "command": "sudo online-auth check-if-blocked",
                "description": "Check if user ID is blocked",
                "expectedOutput": "Block status displayed"
              },
              {
                "command": "sudo online-auth check-all-status",
                "description": "Show all status information",
                "expectedOutput": "Complete status information displayed"
              }
            ],
            "id": "1_authentication_management",
            "title": "Authentication Management"
          },
          {
            "description": "Identity and account information",
            "examples": [
              {
                "command": "sudo online-auth get-ids",
                "description": "Show user and session IDs",
                "expectedOutput": "User ID and session ID displayed"
              },
              {
                "command": "sudo online-auth get-ids --json",
                "description": "Get IDs in JSON format",
                "expectedOutput": "JSON with user and session IDs"
              },
              {
                "command": "sudo online-auth which-group",
                "description": "Check user group (VIP = premium)",
                "expectedOutput": "User group displayed"
              },
              {
                "command": "sudo online-auth get-card",
                "description": "Get user card URL",
                "expectedOutput": "User card URL displayed"
              }
            ],
            "id": "2_user_information",
            "title": "User Information"
          },
          {
            "description": "Session keepalive and heartbeat operations",
            "examples": [
              {
                "command": "sudo online-auth send-heartbeat",
                "description": "Send a single heartbeat",
                "expectedOutput": "Heartbeat sent successfully"
              },
              {
                "command": "sudo online-auth send-heartbeat-with-retry",
                "description": "Send heartbeat with retry logic",
                "expectedOutput": "Heartbeat sent with retry if needed"
              },
              {
                "command": "sudo online-auth start-heartbeat",
                "description": "Start automatic heartbeat service",
                "expectedOutput": "Heartbeat service started"
              },
              {
                "command": "sudo online-auth stop-heartbeat",
                "description": "Stop automatic heartbeat service",
                "expectedOutput": "Heartbeat service stopped"
              },
              {
                "command": "sudo online-auth check-heartbeat",
                "description": "Check if heartbeat service is running",
                "expectedOutput": "Heartbeat service status displayed"
              }
            ],
            "id": "3_heartbeat_management",
            "title": "Heartbeat Management"
          },
          {
            "description": "Control permission guard daemon for file permission monitoring",
            "examples": [
              {
                "command": "sudo online-auth enable-permission-guard",
                "description": "Start permission guard daemon to monitor file permissions",
                "expectedOutput": "Permission guard daemon enabled successfully",
                "notes": "Ensures files maintain correct ownership and prevents root-owned files in user directories"
              },
              {
                "command": "sudo online-auth disable-permission-guard",
                "description": "Stop permission guard daemon",
                "expectedOutput": "Permission guard daemon disabled successfully",
                "notes": "Stops automatic permission monitoring and correction"
              },
              {
                "command": "sudo online-auth permission-guard-status",
                "description": "Check if permission guard daemon is running",
                "expectedOutput": "Permission guard daemon is running/not running"
              },
              {
                "command": "sudo online-auth enable-permission-guard --json",
                "description": "Enable permission guard with JSON output",
                "expectedOutput": "{\"status\": \"success\", \"message\": \"Permission guard daemon enabled\", \"is_running\": true}",
                "notes": "Useful for automation scripts and monitoring"
              },
              {
                "command": "sudo online-auth permission-guard-status --json",
                "description": "Get permission guard status in JSON format",
                "expectedOutput": "{\"status\": \"success\", \"message\": \"Permission guard daemon is running\", \"is_running\": true}"
              }
            ],
            "id": "4_permission_guard",
            "title": "Permission Guard Management"
          },
          {
            "description": "API key synchronization and management",
            "examples": [
              {
                "command": "sudo online-auth sync-api-key",
                "description": "Manually sync API key with server",
                "expectedOutput": "API key synchronized successfully"
              },
              {
                "command": "sudo online-auth sync-api-key --json",
                "description": "Sync API key with JSON output",
                "expectedOutput": "JSON response with sync status"
              }
            ],
            "id": "5_api_management",
            "title": "API Management"
          },
          {
            "description": "Version and program details",
            "examples": [
              {
                "command": "online-auth --version",
                "description": "Show version number",
                "expectedOutput": "online-auth version 9.0.1"
              },
              {
                "command": "online-auth --info",
                "description": "Show detailed program information",
                "expectedOutput": "Detailed information about online-auth"
              },
              {
                "command": "online-auth --help",
                "description": "Show help information",
                "expectedOutput": "Help text with all commands"
              },
              {
                "command": "online-auth --examples",
                "description": "Show usage examples",
                "expectedOutput": "This examples output"
              }
            ],
            "id": "6_program_information",
            "title": "Program Information"
          },
          {
            "description": "Complete authentication workflows",
            "examples": [
              {
                "command": "sudo online-auth authenticate && sudo online-auth which-group",
                "description": "Authenticate and check group",
                "expectedOutput": "Authentication followed by group info",
                "notes": "Useful for setup scripts"
              },
              {
                "command": "sudo online-auth authenticate --keep-alive && sudo online-auth get-card",
                "description": "Auth with heartbeat and get card",
                "expectedOutput": "Authentication with heartbeat, then card URL"
              },
              {
                "command": "sudo online-auth check-login || sudo online-auth authenticate",
                "description": "Check login or authenticate if needed",
                "expectedOutput": "Login status or authentication",
                "notes": "Ensures authenticated state"
              }
            ],
            "id": "7_workflow_combinations",
            "title": "Workflow Combinations"
          },
          {
            "description": "Debug and error resolution",
            "examples": [
              {
                "command": "sudo online-auth check-login --json",
                "description": "Check connection status",
                "expectedOutput": "JSON with detailed connection info"
              },
              {
                "command": "sudo online-auth sync-api-key",
                "description": "Refresh API credentials",
                "expectedOutput": "API key refreshed",
                "notes": "Use when authentication fails"
              },
              {
                "command": "sudo online-auth logout && sudo online-auth authenticate",
                "description": "Reset authentication",
                "expectedOutput": "Fresh authentication session"
              },
              {
                "command": "sudo online-auth stop-heartbeat && sudo online-auth start-heartbeat",
                "description": "Restart heartbeat service",
                "expectedOutput": "Heartbeat service restarted"
              }
            ],
            "id": "8_troubleshooting",
            "title": "Troubleshooting"
          },
          {
            "description": "Global configuration options (provided by cli-core)",
            "examples": [
              {
                "command": "sudo online-auth authenticate --timeout 30",
                "description": "Set 30 second timeout",
                "expectedOutput": "Authentication with custom timeout",
                "notes": "Global option - applies to network operations"
              },
              {
                "command": "sudo online-auth authenticate --port 8080",
                "description": "Use custom port",
                "expectedOutput": "Note: Port configuration may not apply to all operations",
                "notes": "Global option - for services that support custom ports"
              },
              {
                "command": "sudo online-auth authenticate --log-level debug",
                "description": "Enable debug logging",
                "expectedOutput": "Authentication with debug output",
                "notes": "Global option - useful for diagnosing issues"
              }
            ],
            "id": "9_advanced_options",
            "title": "Advanced Options"
          },
          {
            "description": "Working with JSON formatted responses",
            "examples": [
              {
                "command": "sudo online-auth authenticate --json | jq '.status'",
                "description": "Extract status from JSON",
                "expectedOutput": "\"success\" or \"error\""
              },
              {
                "command": "sudo online-auth get-ids --json | jq '.data.userId'",
                "description": "Extract user ID from JSON",
                "expectedOutput": "User ID value"
              },
              {
                "command": "sudo online-auth check-all-status --json | jq '.data'",
                "description": "Get all status data as JSON",
                "expectedOutput": "Complete status object",
                "notes": "Useful for monitoring scripts"
              }
            ],
            "id": "10_json_output",
            "title": "JSON Output"
          },
          {
            "description": "License activation, status, and transfer operations",
            "examples": [
              {
                "command": "sudo online-auth activate-license --key \"H7KM-P2Q9-R5TW-X3YZ-A4B2\"",
                "description": "Activate a license key for premium features",
                "expectedOutput": "License activated with tier and feature details",
                "notes": "Key format: XXXX-XXXX-XXXX-XXXX-XXXX (24 chars with dashes)"
              },
              {
                "command": "sudo online-auth activate-license -k \"H7KM-P2Q9-R5TW-X3YZ-A4B2\" --json",
                "description": "Activate license with JSON output",
                "expectedOutput": "JSON response with license details, tier, and features"
              },
              {
                "command": "sudo online-auth license-status",
                "description": "Check current license status and details",
                "expectedOutput": "License tier, version, devices used, and expiry info"
              },
              {
                "command": "sudo online-auth license-status --json",
                "description": "Get license status in JSON format",
                "expectedOutput": "JSON formatted license information",
                "notes": "Useful for scripting and automation"
              },
              {
                "command": "sudo online-auth release-license",
                "description": "Release license to transfer to another device",
                "expectedOutput": "License released, can be activated on new device",
                "notes": "Use when moving to new hardware or reinstalling"
              },
              {
                "command": "sudo online-auth release-license --json",
                "description": "Release license with JSON confirmation",
                "expectedOutput": "JSON confirmation of license release"
              }
            ],
            "id": "11_license_management",
            "title": "License Management"
          }
        ],
        "description": "Usage examples for online-auth",
        "name": "online-auth",
        "quickReference": [
          "sudo online-auth --help",
          "sudo online-auth --version",
          "sudo online-auth --info --json",
          "sudo online-auth --examples --json"
        ]
      },
      "errors": [],
      "metadata": {
        "executionTime": 3,
        "hostname": "REDACTED-BUILD-HOST",
        "user": "REDACTED-BUILD-USER"
      },
      "status": "success",
      "timestamp": "2026-06-08T16:22:04.306269375Z",
      "version": "9.0.1",
      "warnings": []
    }
  }
}
