|
|
|
|
@ -45,6 +45,9 @@ $assert(str_contains($pageMethod, 'CloudAccess::actor(false)')
|
|
|
|
|
|| str_contains($pageMethod, '$this->sshKeyOptions('))
|
|
|
|
|
&& str_contains($pageMethod, "'user' => \$this->userBootstrap(\$user, \$actor)")
|
|
|
|
|
&& str_contains($pageMethod, "'ssh_keys' => \$keys")
|
|
|
|
|
&& str_contains($pageMethod, "\$requestedView = \$request->getQueryParams()['view'] ?? 'list'")
|
|
|
|
|
&& str_contains($pageMethod, "\$requestedView === 'add'")
|
|
|
|
|
&& str_contains($pageMethod, "'cloud_ssh_keys_view' => \$view")
|
|
|
|
|
&& str_contains($pageMethod, "'cloud_ssh_keys' => \$keys")
|
|
|
|
|
&& str_contains($pageMethod, "'cloud_ssh_keys_bootstrap_json' => \$this->safeJson(\$payload)"),
|
|
|
|
|
'SSH-key controller must embed an owner-scoped first-paint list and session bootstrap.');
|
|
|
|
|
@ -63,10 +66,18 @@ $assert(str_contains($template, 'id="ssh-keys-bootstrap" type="application/json"
|
|
|
|
|
&& str_contains($template, '{foreach $cloud_ssh_keys as $key}')
|
|
|
|
|
&& str_contains($template, '{$key.name|escape:"html"}')
|
|
|
|
|
&& str_contains($template, '{$key.fingerprint|escape:"html"}')
|
|
|
|
|
&& str_contains($template, '还没有公钥。')
|
|
|
|
|
&& str_contains($template, 'id="ssh-key-list-view"')
|
|
|
|
|
&& str_contains($template, '当前已添加的 SSH 公钥')
|
|
|
|
|
&& str_contains($template, 'id="ssh-key-add-button"')
|
|
|
|
|
&& str_contains($template, '/user/cloud/ssh-keys?view=add')
|
|
|
|
|
&& str_contains($template, 'id="ssh-key-add-view"')
|
|
|
|
|
&& str_contains($template, 'id="ssh-key-name"')
|
|
|
|
|
&& str_contains($template, 'id="ssh-key-public-key"')
|
|
|
|
|
&& !str_contains($template, 'type="file"')
|
|
|
|
|
&& !str_contains($template, 'ssh-key-file')
|
|
|
|
|
&& !str_contains($template, '正在加载')
|
|
|
|
|
&& !str_contains($template, '$key.public_key'),
|
|
|
|
|
'SSH-key HTML must render the initial owner-scoped rows instead of a loading shell.');
|
|
|
|
|
'SSH-key HTML must separate the list and paste-only add views without local file upload.');
|
|
|
|
|
|
|
|
|
|
$assert(!str_contains($module, '/cloud/runtime.js')
|
|
|
|
|
&& !str_contains($module, '/api/v1/session')
|
|
|
|
|
@ -81,7 +92,10 @@ $assert($initialize !== ''
|
|
|
|
|
'SSH-key first paint must not issue an unqualified collection GET after hydration.');
|
|
|
|
|
$assert(str_contains($module, '/api/v1/ssh-keys')
|
|
|
|
|
&& str_contains($module, "method: 'POST'")
|
|
|
|
|
&& str_contains($module, "method: 'DELETE'"),
|
|
|
|
|
&& str_contains($module, "method: 'DELETE'")
|
|
|
|
|
&& str_contains($module, "location.assign('/user/cloud/ssh-keys')")
|
|
|
|
|
&& !str_contains($module, 'importKeyFile')
|
|
|
|
|
&& !str_contains($module, 'ssh-key-file'),
|
|
|
|
|
'SSH-key JavaScript must retain explicit create and delete mutations.');
|
|
|
|
|
$assert(str_contains($keyApi,
|
|
|
|
|
"['id' => (int) \$key->id, 'name' => \$key->name, 'fingerprint' => \$key->fingerprint]")
|
|
|
|
|
|