Added read-only testing to backends

This PR adds a flag to the test method so we can choose to test for read-only access (needed for restore) or read-write (needed for backups).

Additionally, this PR fixes a logic bug in that the BackendSourceProvider would not actually test the connection, but just check the placeholder element returned (which is always returned). With this PR the backend's ListAsync command is tested fully.

Also renamed the methods on ISourceProvider to have the `...Async` prefix.

This replaces #6939
This commit is contained in:
Kenneth Skovhede
2026-06-03 17:27:34 +02:00
parent ec38a2fe54
commit 4d569c51e4
60 changed files with 238 additions and 181 deletions
@@ -95,9 +95,9 @@ public class WebModule : IWebModule
forwardoptions[key!] = uri.QueryParameters[key];
using var client = new SourceProvider(url, "", forwardoptions, true);
await client.Initialize(cancellationToken);
await client.InitializeAsync(cancellationToken);
var targetEntry = await client.GetEntry((path ?? "").TrimStart('/'), isFolder: true, cancellationToken).ConfigureAwait(false);
var targetEntry = await client.GetEntryAsync((path ?? "").TrimStart('/'), isFolder: true, cancellationToken).ConfigureAwait(false);
if (targetEntry == null)
throw new DirectoryNotFoundException($"Path not found: {path}");