How fyaic/wecom-auth-keeper works
wecom-auth-keeper is a macOS operations tool for detecting expired WeCom document permissions and restoring them through the signed-in desktop app. Its main cycle probes document read/write access, invokes renewal when probes report expiry (or recovery is pending), probes again, then records and optionally notifies the outcome. A separate renewal command supports inspection, expired-permission recovery, and experimental pre-renewal; the README also documents configurable capability-row selection and optional authorization-link delivery and monitor coordination. Source excerpts are partial, so unshown renewal internals are represented only where documented or evidenced.
Main entry points: keepalive.py Keepalive cycle · renew.py Renewal command · probe.py Probe command · keeper_ax.py Native AX adapter
Components 20
Capability probes
- Probe command
probe.py - Read probe
probe.py - Write probe
probe.py
Keepalive and state
- Keepalive cycle
keepalive.py - Config and locks
keeper_common.py - Local state and logs
keeper_common.py - Notice receipt
keepalive.py
Permission recovery
- Renewal command
renew.py - Permission page
renew.py - Bot identity check
renew.py - Permission status
renew.py - Renew / pre-renew
renew.py - Native AX adapter
keeper_ax.py - Recovery journal
renew.py
External systems
- wecom-cli
- WeCom APIs
- WeCom desktop
- Optional bridge
Other components
- Operator
- launchd scheduler
Connections 26
- Operator → Keepalive cycle: runs cycle
- launchd scheduler → Keepalive cycle: runs hourly
- Operator → Probe command: runs probe
- Operator → Renewal command: runs recovery
- Keepalive cycle → Config and locks: loads config
- Keepalive cycle → Local state and logs: locks and logs
- Keepalive cycle → Probe command: calls probes
- Probe command → Read probe: runs read
- Probe command → Write probe: runs write
- Read probe → wecom-cli: invokes
- Write probe → wecom-cli: invokes
- wecom-cli → WeCom APIs: calls
- Keepalive cycle → Renewal command: runs on expiry
- Renewal command → Config and locks: loads config and locks
- Renewal command → Permission page: opens or reuses
- Permission page → Native AX adapter: inspected through
- Native AX adapter → WeCom desktop: controls and reads
- Renewal command → Bot identity check: validates target
- Renewal command → Permission status: reads rows
- Renewal command → Renew / pre-renew: dispatches actions
- Renewal command → Recovery journal: recovers pending action
- Renew / pre-renew → Recovery journal: persists before revoke
- Keepalive cycle → Local state and logs: checks pending state
- Keepalive cycle → Optional bridge: sends optional notice
- Keepalive cycle → Notice receipt: deduplicates notices
- Renewal command → Optional bridge: optional link and monitor