feat: add fnOS packaging, storage workflows and release pipeline

This commit is contained in:
2026-08-11 18:05:49 +08:00
parent c5922f9b08
commit 95932f0199
181 changed files with 24024 additions and 1164 deletions
@@ -0,0 +1,34 @@
using dy.net.model.entity;
using dy.net.service;
using dy.net.Tests.TestInfrastructure;
using Microsoft.AspNetCore.DataProtection;
namespace dy.net.Tests;
public class DataProtectionPersistenceTests
{
[Fact]
public async Task WebDavPassword_DecryptsAfterProviderReconstructionFromPersistentKeys()
{
using var temporaryDirectory = new TemporaryDirectory();
var keyDirectory = new DirectoryInfo(Path.Combine(temporaryDirectory.Path, "keys"));
const string password = "持久化-password-123";
var firstProvider = CreateProvider(keyDirectory);
var protectedPassword = firstProvider
.CreateProtector("dysync.webdav.password.v1")
.Protect(password);
var reconstructedProvider = CreateProvider(keyDirectory);
var service = new WebDavSettingsService(null, reconstructedProvider);
var decrypted = await service.GetPasswordAsync(new WebDavSettings
{
ProtectedPassword = protectedPassword
});
Assert.Equal(password, decrypted);
}
private static IDataProtectionProvider CreateProvider(DirectoryInfo directory) =>
DataProtectionProvider.Create(directory, builder => builder.SetApplicationName("dysync.net"));
}