Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/file-protection-v1.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,3 +126,5 @@ ARM64 最终矩阵通过 16 项基础原生场景和 11 组扩展验收,包含
Runner 本地标签 `cloudfile/cloudfile:14.0.8-virtual-protection-fix-amd64`,image config ID 为 `sha256:40ecb363898605940ceb0fdcc6ca8dce66f885af351c59fe6c7da82860beb74f`;Registry digest 为空,未发布镜像。收据及 JSON/日志已上传为该流程的 `full-build-evidence`,来源锁与挂载证据另行上传。后续纯文档提交不改变本次已验证构建组合。

结论:本轮固定修复组合已消除已复现的虚拟写入绕过和定版竞争问题,具备合并审查及后续 AMD64 发布准备依据。通用原生上传拒绝仍沿用现有 HTTP 500 错误映射,验收同时检查不可变 Branch/File ID,未将错误码本身视为安全证明。Etech/SSO、实际 Windows Agent2 与 DEV/PROD 业务验收仍未完成;不得将候选 PR、CI 镜像或隔离测试写成已上线。

跨库移动(V1):源资料库启用了文件保护或源虚拟库映射到该库时,原生接口在写目标库、排队异步任务前拒绝所有跨库移动,包括尚未定版的文件。请使用跨库复制。库内移动继续按实际路径判断。Go 文件提交确认命中保护时,上传、更新和同步 HTTP 接口返回 423,JSON 中 error 为 FILE_PROTECTED。
29 changes: 15 additions & 14 deletions tests/e2e/full/file_protection_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,15 @@ def protocols(self):
before = self.head(), self.file()
for update in (False, True):
denied = self.upload(self.repo, self.path, b'blocked protocol write', update)
assert denied.status_code >= 400, (update, denied.status_code, denied.text)
assert denied.status_code == 423 and denied.json()["error"] == "FILE_PROTECTED", (update, denied.status_code, denied.text)
self.assert_unchanged(before)
control = self.upload(self.state['plain'], self.path, uuid4().bytes, update)
assert control.status_code == 200, (control.status_code, control.text)
self.mark(('update-api' if update else 'upload-api replace') + ': protected denied, ordinary control succeeds')
token = self.api.get_scoped_upload_token(self.repo, '/acceptance', OWNER, False)
reply = requests.post(HTTP + '/upload-api/' + token, data={'parent_dir': '/acceptance', 'replace': '1'},
files=[('file', ('original', b'mixed overwrite')), ('file', ('must-not-exist', b'new'))], timeout=30)
assert reply.status_code >= 400
assert reply.status_code == 423 and reply.json()["error"] == "FILE_PROTECTED"
self.assert_unchanged(before)
assert not self.file('/acceptance/must-not-exist')
self.mark('mixed multipart batch containing protected original is atomic')
Expand Down Expand Up @@ -124,7 +124,7 @@ def sync(self):
# A previously valid tree with no protected path exists in this repo's history.
old = self.api.get_commit(self.repo, 1, self.state['old_head'])
response = self.sync_attempt(self.repo, old.root_id)
assert response.status_code >= 400, response.text
assert response.status_code == 423 and response.json()["error"] == "FILE_PROTECTED", response.text
self.assert_unchanged(before)
plain = self.state['plain']
oldhead = self.head(plain)
Expand All @@ -142,17 +142,18 @@ def cross_repo(self):
assert self.file('/acceptance/copied', target) == before[1]
assert self.upload(target, '/acceptance/copied', b'editable copy', True).status_code == 200
self.assert_unchanged(before)
failed = False
try:
result = api.move_file(self.repo, '/acceptance', json.dumps(['original']), target, '/acceptance', json.dumps(['moved']), 0, OWNER, 0, synchronous=1)
failed = result == -1
except Exception:
failed = True
self.assert_unchanged(before)
assert failed, 'cross-repo move reported success'
# A destination copy may remain after a failed native move; record it explicitly.
self.metrics['failed_move_destination_exists'] = bool(self.file('/acceptance/moved', target))
self.mark('cross-repository copy editable; move rejects without changing original')
target_head = self.head(target)
for synchronous in (0, 1):
try:
api.move_file(self.repo, '/acceptance', json.dumps(['original']), target, '/acceptance',
json.dumps(['moved']), 0, OWNER, 1, synchronous=synchronous)
except Exception as exc:
assert 'CROSS_REPO_MOVE_DISABLED' in str(exc), str(exc)
else:
raise AssertionError('cross-repo move was accepted')
self.assert_unchanged(before)
assert self.head(target) == target_head and not self.file('/acceptance/moved', target)
self.mark('cross-repository copy editable; sync and queued moves rejected before destination write')

def wait_virtual(self):
virtual = self.state['virtual']
Expand Down
Loading