修复投递结果恢复并隔离远程验收资源

This commit is contained in:
xuans committed 2026-09-17 11:21:49 +08:00
1 parent 5198e2d515
commit 1d202934cf
13 files changed
+511 -34

No files matched your search

@@ -54,12 +54,13 @@ func TestIsAbsoluteUserCertificatePathRecognizesWindowsPaths(t *testing.T) {
cases := []string{
`C:\outside\private.key`,
`D:/outside/public.crt`,
`C:private.key`,
`\\server\share\private.key`,
`//server/share/public.crt`,
}
for _, value := range cases {
if !isAbsoluteUserCertificatePath(value) {
t.Errorf("path %q was accepted", value)
t.Errorf("path %q was not recognized", value)
}
}
}
@@ -73,6 +74,17 @@ func TestIsAbsoluteUserCertificatePathRejectsEmptyAndAcceptsRelative(t *testing.
}
}
func TestValidateUserCertificatePathsRejectsNonNativeAbsolutePath(t *testing.T) {
for _, path := range []string{`C:private.key`, `C:\outside\private.key`, `\\server\share\private.key`} {
if filepath.IsAbs(path) {
continue
}
if _, _, err := validateUserCertificatePaths(path, path); err == nil || err.Error() != "SSL 路径必须是当前服务器支持的完整绝对路径" {
t.Fatalf("non-native path %q: %v", path, err)
}
}
}
func TestApplyManagedSSLReferenceDoesNotPersistLegacyPaths(t *testing.T) {
cfg := &config.Config{
SSLPrivateKeyPath: "config/ssl/private.key",