Reworked the use of scopes.

Instead of requesting all scopes up front, each sub-section of the backup/restore will request the permissions that are relevant for the operation.

The effect is that it is not required to grant all permissions to get a backup running. If permissions are failing, that part of the backup will generate warnings for items that are excluded.
This commit is contained in:
Kenneth Skovhede
2026-02-15 22:03:57 +01:00
parent 3bc449281a
commit 910c56b3c4
53 changed files with 2954 additions and 366 deletions
@@ -3,11 +3,12 @@
using Duplicati.Library.Common.IO;
using Duplicati.Library.Interface;
using Google.Apis.Keep.v1.Data;
using Google.Apis.Keep.v1;
using System.Runtime.CompilerServices;
namespace Duplicati.Proprietary.GoogleWorkspace.SourceItems;
internal class KeepNoteSourceEntry(SourceProvider provider, string parentPath, string userId, Note note)
internal class KeepNoteSourceEntry(string parentPath, Note note, KeepService keepService)
: MetaEntryBase(Util.AppendDirSeparator(SystemIO.IO_OS.PathCombine(parentPath, note.Title ?? note.Name)),
note.CreateTimeDateTimeOffset.HasValue ? note.CreateTimeDateTimeOffset.Value.UtcDateTime : DateTime.UnixEpoch,
note.UpdateTimeDateTimeOffset.HasValue ? note.UpdateTimeDateTimeOffset.Value.UtcDateTime : DateTime.UnixEpoch)
@@ -22,7 +23,7 @@ internal class KeepNoteSourceEntry(SourceProvider provider, string parentPath, s
foreach (var attachment in note.Attachments)
{
if (cancellationToken.IsCancellationRequested) yield break;
yield return new KeepNoteAttachmentSourceEntry(provider, this.Path, userId, attachment);
yield return new KeepNoteAttachmentSourceEntry(this.Path, attachment, keepService);
}
}
}