diff --git a/backend/internal/cli/root.go b/backend/internal/cli/root.go index 736e22f..0c019f4 100644 --- a/backend/internal/cli/root.go +++ b/backend/internal/cli/root.go @@ -81,7 +81,7 @@ func newRootCommand() *cobra.Command { newLogsCommand(), newConfigCommand(), newBackupCommand(), newRestoreCommand(), newServiceCommand(), newDNSCommand(), ) - for _, name := range []string{"domain", "server", "ssh-key", "renew", "deploy"} { + for _, name := range []string{"domain", "server", "renew", "deploy"} { root.AddCommand(newRetiredBusinessCommand(name)) } localizeHelpFlags(root) diff --git a/backend/internal/cli/scope_test.go b/backend/internal/cli/scope_test.go index 233f80c..a3ce272 100644 --- a/backend/internal/cli/scope_test.go +++ b/backend/internal/cli/scope_test.go @@ -33,7 +33,7 @@ func TestRootExposesOnlyOperationalCommands(t *testing.T) { if err := root.Execute(); err != nil { t.Fatal(err) } - for _, name := range []string{"domain", "server", "ssh-key", "renew", "deploy"} { + for _, name := range []string{"domain", "server", "renew", "deploy"} { if strings.Contains(output.String(), "\n "+name+" ") { t.Errorf("正式帮助仍展示历史业务命令:%s", name) } @@ -48,8 +48,6 @@ func TestRetiredBusinessCommandsRejectBeforeAccessingData(t *testing.T) { {"domain", "import", "--private-key", "not-a-real-key.pem"}, {"server", "add", "--password", "test-secret-not-real"}, {"server", "delete", "--id", "example"}, - {"ssh-key", "add", "--name", "example"}, - {"ssh-key", "delete", "--id", "example"}, {"renew"}, {"renew", "--id", "example"}, {"deploy", "--id", "example"}, diff --git a/backend/internal/httpapi/server.go b/backend/internal/httpapi/server.go index 3791062..85c80d2 100644 --- a/backend/internal/httpapi/server.go +++ b/backend/internal/httpapi/server.go @@ -399,7 +399,6 @@ type serverRequest struct { Address string `json:"address" binding:"required"` Port int `json:"port"` Username string `json:"username" binding:"required"` - AuthMethod string `json:"auth_method"` Password string `json:"password"` HostKeyFingerprint string `json:"host_key_fingerprint" binding:"required"` CertificatePath string `json:"certificate_path"` diff --git a/frontend/src/views/Dashboard/Dashboard.js b/frontend/src/views/Dashboard/Dashboard.js index a192492..215c024 100644 --- a/frontend/src/views/Dashboard/Dashboard.js +++ b/frontend/src/views/Dashboard/Dashboard.js @@ -518,7 +518,6 @@ export function useDashboard() { address: serverForm.value.address, port: Number(serverForm.value.port), username: serverForm.value.username, - auth_method: "password", host_key_fingerprint: serverForm.value.host_key_fingerprint, certificate_path: serverForm.value.certificate_path, private_key_path: serverForm.value.private_key_path, diff --git a/frontend/src/views/Dashboard/Dashboard.test.js b/frontend/src/views/Dashboard/Dashboard.test.js index fda2861..8bff4f9 100644 --- a/frontend/src/views/Dashboard/Dashboard.test.js +++ b/frontend/src/views/Dashboard/Dashboard.test.js @@ -328,8 +328,8 @@ test("部署服务器仅使用密码认证且不暴露私钥管理入口", async state.serverForm.value.host_key_fingerprint = "SHA256:test"; await state.saveServer(); const payload = JSON.parse(requests.at(-1).body); - assert.equal(payload.auth_method, "password"); assert.equal(payload.password, "test-password"); + assert.equal("auth_method" in payload, false); assert.equal("private_key_ref" in payload, false); });