cloverleaf-larry/lib
bj 2b578f5058 v0.9.1: on upgrade to broker-mode, WIPE the now-obsolete local credentials
An install switching TO broker-mode (the v0.9.0 default) carried long-lived
Anthropic/OAuth credentials from the pre-broker era. Broker-mode authenticates
via short-lived broker tokens and never uses them — they are a pure security
liability on the box, acutely so on a PHI box. On the next self-update the agent
now cleans them up automatically:

- Secure-deletes $LARRY_HOME/.api-key and .oauth.json (reuses the
  uninstall-larry.sh shred -u -z -n3 -> overwrite -> rm logic).
- Strips the ANTHROPIC_API_KEY / CLAUDE_CODE_OAUTH_TOKEN LINES from
  $LARRY_HOME/.env and from ~/.bashrc, ~/.bash_profile, ~/.profile (backup
  first); every other line is kept.
- Idempotent (.broker-cred-wiped marker, written only after a run that removed
  something); silent no-op when clean.
- Hard-guarded on LARRY_AUTH_MODE=broker: does NOT fire under the apikey escape
  hatch (which legitimately still needs the key). Only the two Anthropic/OAuth
  vars are touched (LARRY_* / GITEA_TOKEN are still needed in broker mode).
- Prints a reminder to ALSO revoke at the source (local deletion != server
  revocation), per the decommission / kill-switch docs.

Fires at the broker-resolution block (after self_update synced a fresh
lib/broker.sh, before the fail-closed preflight). New functions in
lib/broker.sh: _broker_wipe_obsolete_credentials,
_broker_strip_cred_lines_from_env, _broker_strip_cred_lines_from_rc.
VERSION + MANIFEST regenerated. Tested: 31/31 assertions pass across the
upgrade-wipe, apikey-non-wipe, clean-no-op, idempotency, dangerous-path-guard,
and selective-line-strip paths.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-31 23:42:11 -07:00
..
broker.sh v0.9.1: on upgrade to broker-mode, WIPE the now-obsolete local credentials 2026-05-31 23:42:11 -07:00
csv-to-table.sh v0.4.1: each / each-site / len2nl / csv-to-table / table-to-csv 2026-05-26 11:05:19 -07:00
cygwin-safe.sh v0.8.26: harden control-byte sanitize across the tool suite + ssh-helper traps 2026-05-28 16:35:06 -07:00
each-site.sh v0.4.1: each / each-site / len2nl / csv-to-table / table-to-csv 2026-05-26 11:05:19 -07:00
each.sh v0.4.1: each / each-site / len2nl / csv-to-table / table-to-csv 2026-05-26 11:05:19 -07:00
fetch-safe.sh v0.8.11: API-key default rail (OAuth-impersonation off, secure per-client /set-api-key) + manifest-hashing auto-update speedup 2026-05-27 22:40:18 -07:00
headers-sync.sh v0.8.6: work-box → Mac headers.log sync (tsk-2026-05-27-023) 2026-05-27 21:01:54 -07:00
hl7-desanitize.sh v0.8.26: harden control-byte sanitize across the tool suite + ssh-helper traps 2026-05-28 16:35:06 -07:00
hl7-diff.sh v0.8.26: harden control-byte sanitize across the tool suite + ssh-helper traps 2026-05-28 16:35:06 -07:00
hl7-field.sh v0.8.26: harden control-byte sanitize across the tool suite + ssh-helper traps 2026-05-28 16:35:06 -07:00
hl7-sanitize.sh v0.8.26: harden control-byte sanitize across the tool suite + ssh-helper traps 2026-05-28 16:35:06 -07:00
hl7-schema.sh v0.7.0: HL7-aware tab completion + REPL mouse mode 2026-05-27 16:15:11 -07:00
journal.sh v0.7.5: OAuth CR-taint fix + mouse opt-in + CR-safety sweep 2026-05-27 19:17:48 -07:00
len2nl.sh v0.4.1: each / each-site / len2nl / csv-to-table / table-to-csv 2026-05-26 11:05:19 -07:00
lessons.sh v0.8.30: write/mutate tool validation pass — 2 fixes; rollback proven reliable 2026-05-28 18:28:21 -07:00
nc-create-thread.sh v0.8.30: write/mutate tool validation pass — 2 fixes; rollback proven reliable 2026-05-28 18:28:21 -07:00
nc-diff-interface.sh v0.8.29: read/inspect tool validation pass — 7 portability/correctness fixes 2026-05-28 18:11:22 -07:00
nc-document.sh v0.8.26: harden control-byte sanitize across the tool suite + ssh-helper traps 2026-05-28 16:35:06 -07:00
nc-engine.sh v0.8.28: expose 5 lib-only tools + fix nc-engine arg-parsing crash 2026-05-28 17:18:23 -07:00
nc-find.sh v0.8.29: read/inspect tool validation pass — 7 portability/correctness fixes 2026-05-28 18:11:22 -07:00
nc-inbound.sh v0.3.0: initial release of Larry-Anywhere 2026-05-26 09:46:20 -07:00
nc-insert-protocol.sh v0.7.5: OAuth CR-taint fix + mouse opt-in + CR-safety sweep 2026-05-27 19:17:48 -07:00
nc-make-jump.sh v0.3.0: initial release of Larry-Anywhere 2026-05-26 09:46:20 -07:00
nc-msgs.sh v0.8.26: harden control-byte sanitize across the tool suite + ssh-helper traps 2026-05-28 16:35:06 -07:00
nc-parse.sh v0.8.29: read/inspect tool validation pass — 7 portability/correctness fixes 2026-05-28 18:11:22 -07:00
nc-paths.sh v0.8.20: nc_paths route-chain tracer — parse-once in-memory engine (84s→0.7s single, ~5.5s full-tree), authoritative destination-block cross-site resolution, v1-fidelity output (site/thread nodes, --> intra-route / ==> cross-site) as default + --format table/nodes, pipe-first (site/thread in, awk field-1 = root). Verified EXACT vs v1 on the real 24-site integrator. 2026-05-28 11:26:31 -07:00
nc-provision-jumps.sh v0.8.32: nc_provision_jumps — capstone inter-server jump-thread provisioner 2026-05-28 19:38:07 -07:00
nc-regression.sh v0.8.23: regression chain-walk route-test capture (nc-regression --chain-walk) 2026-05-28 12:44:38 -07:00
nc-revisions.sh v0.8.27: nc-revisions — NetConfig change-history / revision diff 2026-05-28 16:53:10 -07:00
nc-set-field.sh v0.8.31: nc_set_field — change a thread's PORT/HOST/PROCESSNAME/ENCODING (journaled) 2026-05-28 18:43:27 -07:00
nc-smat-diff.sh v0.8.29: read/inspect tool validation pass — 7 portability/correctness fixes 2026-05-28 18:11:22 -07:00
nc-status.sh v0.8.29: read/inspect tool validation pass — 7 portability/correctness fixes 2026-05-28 18:11:22 -07:00
nc-table.sh v0.7.5: OAuth CR-taint fix + mouse opt-in + CR-safety sweep 2026-05-27 19:17:48 -07:00
nc-tclgen.sh v0.8.28: expose 5 lib-only tools + fix nc-engine arg-parsing crash 2026-05-28 17:18:23 -07:00
nc-xlate.sh v0.8.29: read/inspect tool validation pass — 7 portability/correctness fixes 2026-05-28 18:11:22 -07:00
oauth.sh v0.7.5: OAuth CR-taint fix + mouse opt-in + CR-safety sweep 2026-05-27 19:17:48 -07:00
phi-client.sh v0.8.2: Presidio sidecar for free-text NER (tier-5) — closes V1 2026-05-27 20:00:23 -07:00
phi-presidio-sidecar.py v0.8.2: Presidio sidecar for free-text NER (tier-5) — closes V1 2026-05-27 20:00:23 -07:00
phi-sidecar.sh v0.8.2: Presidio sidecar for free-text NER (tier-5) — closes V1 2026-05-27 20:00:23 -07:00
ssh-helper.sh v0.8.26: harden control-byte sanitize across the tool suite + ssh-helper traps 2026-05-28 16:35:06 -07:00
table-to-csv.sh v0.4.1: each / each-site / len2nl / csv-to-table / table-to-csv 2026-05-26 11:05:19 -07:00