|
|
|
|
@ -21,6 +21,7 @@ $client = $read('app/Services/Cloud/CloudObjectStorageS3Client.php');
|
|
|
|
|
$template = $read('resources/views/venix/admin/object_storage.tpl');
|
|
|
|
|
$pageCss = $read('public/cloud/admin-object-storage.css');
|
|
|
|
|
$pageJs = $read('public/cloud/admin-object-storage.js');
|
|
|
|
|
$assets = $read('resources/views/venix/layout_assets.tpl');
|
|
|
|
|
$sidebar = $read('resources/views/venix/admin/static_header.tpl');
|
|
|
|
|
$deployment = file_get_contents(dirname($root) . '/docs/DEPLOYMENT.md');
|
|
|
|
|
$validation = file_get_contents(dirname($root) . '/docs/VALIDATION.md');
|
|
|
|
|
@ -86,11 +87,15 @@ $assert(str_contains($template, "admin_title value='对象存储'")
|
|
|
|
|
&& !str_contains($template, '<style>')
|
|
|
|
|
&& !str_contains($template, '{literal}<script>')
|
|
|
|
|
&& str_contains($pageCss, '.os-page')
|
|
|
|
|
&& str_contains($pageCss, '@media (max-width: 760px)')
|
|
|
|
|
&& str_contains($pageCss, '.os-debt-row')
|
|
|
|
|
&& !str_contains($pageCss, '.os-debt-table')
|
|
|
|
|
&& str_contains($pageJs, 'function initialize()')
|
|
|
|
|
&& str_contains($pageJs, 'function initializeTabs()')
|
|
|
|
|
&& str_contains($pageJs, 'function initializeConfigurationDrawer()')
|
|
|
|
|
&& str_contains($pageJs, 'function initializeConfirmation()')
|
|
|
|
|
&& !str_contains($pageJs, 'window.confirm(')
|
|
|
|
|
&& preg_match("/venix_asset_version value='[0-9]+'/", $assets) === 1
|
|
|
|
|
&& !str_contains($template, '$item.object_version_id'),
|
|
|
|
|
'Admin UI can expose credentials or lost its permission/test boundary.');
|
|
|
|
|
$assert(str_contains($controller, "'Cache-Control', 'private, no-store'")
|
|
|
|
|
@ -100,10 +105,14 @@ $assert(str_contains($controller, "'Cache-Control', 'private, no-store'")
|
|
|
|
|
'Object-storage responses lost no-store or may log raw exception messages.');
|
|
|
|
|
$assert(is_string($deployment) && str_contains($deployment, '### 对象存储应用')
|
|
|
|
|
&& str_contains($deployment, '可移植备份')
|
|
|
|
|
&& str_contains($deployment, '编辑抽屉')
|
|
|
|
|
&& str_contains($deployment, '`delete_uncertain`')
|
|
|
|
|
&& str_contains($deployment, 'multipart 上传、读取、HEAD 和删除权限')
|
|
|
|
|
&& str_contains($deployment, '非当前版本和过期删除标记')
|
|
|
|
|
&& str_contains($deployment, '终止未完成 multipart')
|
|
|
|
|
&& is_string($validation) && str_contains($validation, '对象存储配置页面不得回显'),
|
|
|
|
|
&& is_string($validation) && str_contains($validation, '对象存储配置页面不得回显')
|
|
|
|
|
&& str_contains($validation, '不使用浏览器原生 `confirm()`')
|
|
|
|
|
&& str_contains($validation, '清理异常工作区不得显示对象键'),
|
|
|
|
|
'Deployment or validation boundaries are not documented.');
|
|
|
|
|
|
|
|
|
|
echo "Object-storage admin routes, UI, security, and documentation contract passed.\n";
|
|
|
|
|
|