Implemented api authentication. Removed old secret system

This commit is contained in:
2025-03-14 12:32:13 +01:00
parent 340cf738dc
commit f1c0d3b896
12 changed files with 302 additions and 131 deletions

View File

@@ -88,12 +88,26 @@ public class SysFileSystemProvider : IFileSystemProvider, ICompressFileSystemPro
public async Task Upload(Func<long, Task> updateProgress, string path, Stream stream)
{
var progressStream = new ProgressStream(stream, onReadChanged: new Progress<long>(async bytes =>
{
await updateProgress.Invoke(bytes);
}));
var cts = new CancellationTokenSource();
await Create(path, progressStream);
Task.Run(async () =>
{
while (!cts.IsCancellationRequested)
{
await updateProgress.Invoke(stream.Position);
await Task.Delay(TimeSpan.FromMilliseconds(500), cts.Token);
}
});
try
{
await Create(path, stream);
}
finally
{
// Ensure we aren't creating an endless loop ^^
await cts.CancelAsync();
}
}
public async Task Compress(CompressType type, string path, string[] itemsToCompress)