Feature: Google Drive Provider (ManagedCode.Storage.GoogleDrive)

Purpose

Expose Google Drive as IStorage so .NET apps can store files in Google Drive via the official Drive API while keeping OAuth/auth concerns in the hosting app:

Main Flows

flowchart LR
  App --> GD[GoogleDriveStorage : IGoogleDriveStorage]
  GD --> Client[IGoogleDriveClient]
  Client --> Drive[Google Drive API]

Components

DI Wiring

dotnet add package ManagedCode.Storage.GoogleDrive
dotnet add package Google.Apis.Drive.v3
using Google.Apis.Auth.OAuth2;
using Google.Apis.Drive.v3;
using Google.Apis.Services;
using ManagedCode.Storage.GoogleDrive.Extensions;

var credential = GoogleCredential
    .FromFile("service-account.json")
    .CreateScoped(DriveService.Scope.Drive);

var driveService = new DriveService(new BaseClientService.Initializer
{
    HttpClientInitializer = credential,
    ApplicationName = "MyApp"
});

builder.Services.AddGoogleDriveStorageAsDefault(options =>
{
    options.DriveService = driveService;
    options.RootFolderId = "root";
});

Current Behavior

Tests

Configuration Notes

See docs/Development/credentials.md and README.md for step-by-step instructions on Drive API credentials (service account or OAuth client).