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,36 @@
using System.Net;
namespace dy.net.Tests.TestInfrastructure;
internal sealed class StubHttpClientFactory : IHttpClientFactory, IDisposable
{
private readonly HttpClient _client;
public StubHttpClientFactory(HttpMessageHandler handler, string baseAddress = null)
{
_client = new HttpClient(handler, true);
if (!string.IsNullOrWhiteSpace(baseAddress))
_client.BaseAddress = new Uri(baseAddress);
}
public HttpClient CreateClient(string name) => _client;
public void Dispose() => _client.Dispose();
}
internal sealed class LiveHttpClientFactory : IHttpClientFactory, IDisposable
{
private readonly HttpClient _secureClient = new(new HttpClientHandler());
private readonly HttpClient _insecureClient = new(new HttpClientHandler
{
ServerCertificateCustomValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator
});
public HttpClient CreateClient(string name) => name == "webdav-insecure" ? _insecureClient : _secureClient;
public void Dispose()
{
_secureClient.Dispose();
_insecureClient.Dispose();
}
}