wulf-pulse/lib/utils
lorentz e3aba93857 feat: Duo Security integration — full data sync from Accounts + Admin API
Duo API Client (lib/services/duo-client.ts):
- HMAC-SHA1 request signing, GET/POST, automatic pagination
- Rate-limit handling (429 + Retry-After), configurable timeout
- Accounts API: listAccounts() via POST /accounts/v1/account/list
- Admin API: getUsers, getPhones, getGroups, getIntegrations, getAuthLogs
- Child account access: parent creds signed against child api_hostname + account_id
- Factory helpers: getDuoAccountsClient(), getDuoAdminClient()

Database (migration 058):
- 6 tables: duo_accounts, duo_users, duo_phones, duo_auth_logs, duo_groups, duo_integrations
- All with proper FKs, indexes, JSONB fields for capabilities/location/groups

Sync Service (lib/services/duo-sync-service.ts):
- syncAll() orchestration, per-child sequential sync, incremental auth logs
- Company matching: exact then case-insensitive containment (30/32 = 94% matched)
- Non-blocking with sync ID tracking

API Routes:
- POST/GET /api/duo/sync — trigger sync / check status
- GET /api/duo/accounts — list all accounts with stats + matched company
- GET /api/duo/accounts/[id]/users — users for a specific account
- POST /api/openclaw/sync/duo — OpenClaw trigger with API key auth

Verified data: 33 accounts, 832 users, 925 phones, 5927 auth logs, 46 groups, 78 integrations

Also: entity-mapper company fields update, task list marked complete
2026-03-27 11:10:30 -04:00
..
api-helpers.ts Add comprehensive admin features and multi-system integration 2025-11-19 14:18:16 -05:00
db-helpers.ts Add comprehensive admin features and multi-system integration 2025-11-19 14:18:16 -05:00
device-lookup.ts Restructure: rename to Pulse and move app to root 2025-10-28 23:08:54 -04:00
entity-mapper.ts feat: Duo Security integration — full data sync from Accounts + Admin API 2026-03-27 11:10:30 -04:00
issue-type-helper.ts Add comprehensive admin features and multi-system integration 2025-11-19 14:18:16 -05:00
logger.ts Add comprehensive admin features and multi-system integration 2025-11-19 14:18:16 -05:00
openclaw-auth.ts feat: OpenClaw external agent sync API at /api/openclaw/* 2026-03-17 23:26:44 -04:00
sync-helpers.ts feat: add project_phases entity sync with task project_id backfill 2026-03-24 13:57:33 -04:00
sync-logger.ts feat: implement structured logging for sync operations 2026-01-23 08:02:02 -05:00