"""Bind a complete restricted reference installation without exposing private source to the actor.""" from pathlib import Path from drb import load,require,sha,within def check_verifier(task,root): record=load(task/"oracle/authorized_installation.json") private=within(root,record["directory"]) for item in record["files"]: path=within(private,item["path"]) require(path.is_file() and path.stat().st_size==item["bytes"] and sha(path)==item["sha256"], "Frozen private reference changed: "+item["path"]) return private