Add .bms-actions logging (partial): auth login/refresh, create, note, delete. Need: update, assign, resolve.

This commit is contained in:
OpenClaw Agent
2026-04-07 21:30:00 +00:00
parent ef2aca507f
commit 5e2f822ad7
3 changed files with 154 additions and 3 deletions

17
scripts/bms-auth.sh Executable file → Normal file
View File

@@ -4,6 +4,10 @@
set -euo pipefail
# Import logging
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "${SCRIPT_DIR}/bms-logging.sh"
BMS_API_BASE="${BMS_API_BASE:-https://api.bms.kaseya.com}"
BMS_TOKEN_FILE="${BMS_TOKEN_FILE:-$HOME/.bms_token.json}"
@@ -76,6 +80,15 @@ cmd_auth_login() {
save_token "$response"
echo "Authenticated successfully. Token cached at $BMS_TOKEN_FILE" >&2
# Log successful login
local args_json
args_json=$(jq -n \
--arg tenant "${BMS_TENANT}" \
--arg username "${BMS_USERNAME}" \
'{"tenant": $tenant, "username": $username}')
local result_json='{"success": true}'
log_action "auth.login" "$args_json" "$result_json" "success"
}
cmd_auth_refresh() {
@@ -94,6 +107,10 @@ cmd_auth_refresh() {
save_token "$response"
echo "Token refreshed." >&2
# Log token refresh
local result_json='{"success": true}'
log_action "auth.refresh" "{}" "$result_json" "success"
}
cmd_auth_status() {