syntax = "proto3";

package devvit.plugin.blob.v1alpha;

option go_package = "github.snooguts.net/reddit/reddit-devplatform-monorepo/go-common/generated/protos/types/devvit/plugin/blob";
option java_package = "com.reddit.devvit.plugin.blob";

// BlobService provides a plugin for Devvit blob storage.
service BlobService {
  // Returns blob client configuration for the installation.
  rpc GetConfig(GetConfigRequest) returns (GetConfigResponse);
}

message GetConfigRequest {}

// Credentials for creating an S3 client.
message Credentials {
  string access_key = 1;
  string secret_key = 2;
  string session_token = 3;
}

// Configuration for accessing Devvit blob storage.
message GetConfigResponse {
  // Example bucket: "reddit-service-devvit-plugins-blobstorage"
  string bucket = 1;
  // Example region: "us-east-1"
  string region = 2;
  // Blob object paths should be scoped under path_prefix (e.g. "install_abc123:my-app/v1").
  string path_prefix = 3;
  Credentials credentials = 4;
}
