fix(ci): admit exact installed runner evidence in ownership preflight
Deploy Canina / deploy (push) Successful in 3m44s
Deploy Canina / deploy (push) Successful in 3m44s
This commit is contained in:
1 parent
bfeb464bfb
commit
c8063b5f2a
2 files changed
+20
-1
No files matched your search
@@ -6,6 +6,7 @@ Caller must serialize with deployment; never run alongside an editorial runner.
|
||||
"""
|
||||
import json
|
||||
import os
|
||||
import re
|
||||
from pathlib import Path
|
||||
import stat
|
||||
|
||||
@@ -20,7 +21,12 @@ def allowed(relative,isdir):
|
||||
if relative in DIRS if isdir else relative in LEAVES:return True
|
||||
# Runner-created state is limited to immediate regular files, never subtrees.
|
||||
p=Path(relative)
|
||||
return not isdir and str(p.parent) in STATE_ROOTS and p.name in ('lock','proposal.json')
|
||||
if not isdir and str(p.parent) in STATE_ROOTS and p.name in ('lock','proposal.json'):return True
|
||||
# Installed runner persists allowlisted timing evidence for task/run/profile.
|
||||
# Admit only that exact immediate-file grammar, not arbitrary JSON or trees.
|
||||
profiles='|'.join(re.escape(profile) for profile in PROFILES)
|
||||
return not isdir and str(p.parent)=='editorial-v4/runner-state' and re.fullmatch(
|
||||
r'[0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12}-[0-9a-f]{32}-(?:'+profiles+r')\.json',p.name) is not None
|
||||
|
||||
def scan(home,uid,gid):
|
||||
if not home.is_absolute() or home.is_symlink():raise ValueError('Canonical home required')
|
||||
|
||||
Reference in new issue
Block a user