fix(orchestrator): approve only a plain commit of the exact staged index
The approval hook binds a hub approval to a plain git commit of the staged index only; commits that add files from the working tree, amend, take a pathspec, run in a chain or inside a shell wrapper fall back to the normal dialog. Every git call of the hook runs with an environment allowlist. Tests run once on unify/skills-20261114 after the merge (operator order 2026-11-14). 🎯 Fix: 93 % 💥 Break: 3 % 💸 Tokens: – ⏱️ Velocity: – 🛡️ Security: 100 % 🏆 Score: 90 🚦 Gate: ✅ 90/5, tokens and velocity <= 100, security 100 % Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
a2a03995cb
commit
4ec1a43238
8 files changed
+732
-303
No files matched your search
@@ -30,6 +30,7 @@ B64URL = re.compile(r"[A-Za-z0-9_-]+")
|
||||
ASSERTION_KEYS = ("id", "clientDataJSON", "authenticatorData", "signature")
|
||||
CBOR_DEPTH = 16
|
||||
TIMEOUT = 30
|
||||
OPENSSL = "/usr/bin/openssl"
|
||||
|
||||
|
||||
def b64decode(text: object, name: str) -> bytes:
|
||||
@@ -263,9 +264,9 @@ def by_openssl(alg: int, spki: bytes, data: bytes, signature: bytes) -> bool:
|
||||
message.write_bytes(data)
|
||||
sealed.write_bytes(signature)
|
||||
if alg == -8:
|
||||
argv = ["openssl", "pkeyutl", "-verify", "-pubin", "-inkey", str(key), "-rawin", "-in", str(message), "-sigfile", str(sealed)]
|
||||
argv = [OPENSSL, "pkeyutl", "-verify", "-pubin", "-inkey", str(key), "-rawin", "-in", str(message), "-sigfile", str(sealed)]
|
||||
else:
|
||||
argv = ["openssl", "dgst", "-sha256", "-verify", str(key), "-signature", str(sealed), str(message)]
|
||||
argv = [OPENSSL, "dgst", "-sha256", "-verify", str(key), "-signature", str(sealed), str(message)]
|
||||
try:
|
||||
done = subprocess.run(argv, capture_output=True, timeout=TIMEOUT, check=False)
|
||||
except (OSError, subprocess.TimeoutExpired):
|
||||
|
||||
Reference in new issue
Block a user