# -*- coding: utf-8 -*- """Manifest bearer-literal gate (v0.53.0, part of the hub bearer de-git) — no bearer-shaped literal (64 hex chars, the `openssl rand -hex 32` shape every felhom bearer/API key uses) may appear ANYWHERE in manifests/, comments included. Secrets ride out-of-band `kubectl create secret` + secretKeyRef (documentation/runbooks/secrets.md); the manifests carry only placeholders. The other known committed secrets in felhom.secret.yaml (passwords, non-hex shapes) are a tracked backlog item (secrets.md) and are NOT matched by this gate — extend the patterns when they are de-gitted. Run from the repo root: python scripts/manifest_bearer_gate.py Exit 1 on any hit. (Named "bearer", not "secret": the repo .gitignore's `*secret*` pattern — which guards real secret files — would silently un-track a gate with "secret" in its filename.) """ import io, os, re, sys ROOT = "manifests" # 64 hex chars with no hex/word neighbors (so longer blobs and sha256-of-file hexes embedded in # longer strings still match at 64+, but ordinary short ids never do). BEARER = re.compile(r"(?