syntax = "proto3";

package in_toto_attestation.v1;

import "google/protobuf/struct.proto";

option go_package = "github.com/in-toto/attestation/go/v1";
option java_package = "io.github.intoto.attestation.v1";

// Proto representation of the in-toto v1 ResourceDescriptor.
// https://github.com/in-toto/attestation/blob/main/spec/v1/resource_descriptor.md
// Validation of all fields is left to the users of this proto.
message ResourceDescriptor {
  string name = 1;

  string uri = 2;

  map<string, string> digest = 3;

  bytes content = 4;

  string download_location = 5;

  string media_type = 6;

  // Per the Struct protobuf spec, this type corresponds to
  // a JSON Object, which is truly a map<string, Value> under the hood.
  // So, the Struct a) is still consistent with our specification for
  // the `annotations` field, and b) has native support in some language
  // bindings making their use easier in implementations.
  // See: https://pkg.go.dev/google.golang.org/protobuf/types/known/structpb#Struct
  google.protobuf.Struct annotations = 7;
}
