Audit Module API Reference¶
This section documents the internals of the audit
module in Bijux CLI.
bijux_cli.contracts.audit ¶
Defines the contract for the audit logging and diagnostics service.
This module specifies the AuditProtocol
, a formal interface that any auditing service within the application must implement. This ensures a consistent API for logging command executions and performing system health checks, promoting modularity and testability.
AuditProtocol ¶
Bases: ProcessPoolProtocol
, Protocol
Defines the contract for audit logging and system diagnostics.
This interface specifies the methods required for securely logging command executions, retrieving audit trails, and performing diagnostic checks on the CLI environment. It inherits from ProcessPoolProtocol
to manage command execution.
cli_audit ¶
Performs a CLI-specific audit and status check.
This method is the entry point for the bijux audit
command. Implementations should gather and log the current audit status without raising exceptions or executing external commands.
Returns:
-
None
(None
) –
Source code in src/bijux_cli/contracts/audit.py
get_commands ¶
Returns a copy of all recorded audit commands.
Returns:
-
list[dict[str, Any]]
–list[dict[str, Any]]: A list of dictionaries, where each dictionary represents a logged command execution.
log ¶
Logs a command execution for auditing purposes.
Parameters:
-
cmd
(list[str]
) –The command and its arguments to log.
-
executor
(str
) –The name or identifier of the entity that executed the command.
Returns:
-
None
(None
) –