vault/sdk/logical/event.proto
Johan Brandhorst-Satzkorn 8253e59752
Migrate protobuf generation to Buf (#22099)
* Migrate protobuf generation to Buf

Buf simplifies the generation story and allows us to lean
into other features in the Buf ecosystem, such as dependency
management, linting, breaking change detection, formatting
and remote plugins.

* Format all protobuf files with buf

Also add a CI job to ensure formatting remains consistent

* Add CI job to warn on proto generate diffs

Some files were not regenerated with the latest version
of the protobuf binary. This CI job will ensure we are always
detect if the protobuf files need regenerating.

* Add CI job for linting protobuf files
2023-07-31 18:44:56 +00:00

55 lines
1.9 KiB
Protocol Buffer

// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0
syntax = "proto3";
package logical;
import "google/protobuf/struct.proto";
option go_package = "github.com/hashicorp/vault/sdk/logical";
// EventPluginInfo contains data related to the plugin that generated an event.
message EventPluginInfo {
// The type of plugin this event originated from, i.e., "auth" or "secrets.
string mount_class = 1;
// Unique ID of the mount entry, e.g., "kv_957bb7d8"
string mount_accessor = 2;
// Mount path of the plugin this event originated from, e.g., "secret/"
string mount_path = 3;
// Plugin name that this event originated from, e.g., "kv"
string plugin = 4;
// Plugin version of the plugin this event originated from, e.g., "v0.13.3+builtin"
string plugin_version = 5;
// Mount version that this event originated from, i.e., if KVv2, then "2". Usually empty.
string version = 6;
}
// EventData contains event data in a CloudEvents container.
message EventData {
// ID identifies the event. It is required. The combination of
// CloudEvents Source (i.e., Vault cluster) + ID must be unique.
// Events with the same Source + ID can be assumed to be duplicates
// by consumers.
// Be careful when setting this manually that the ID contains enough
// entropy to be unique, or possibly that it is idempotent, such
// as a hash of other fields with sufficient uniqueness.
string id = 1;
// Arbitrary non-secret data. Optional.
google.protobuf.Struct metadata = 2;
// Any IDs that the event relates to, i.e., UUIDs, paths.
repeated string entity_ids = 3;
// Human-readable note.
string note = 4;
}
// EventReceived is used to consume events and includes additional metadata regarding
// the event type and plugin information.
message EventReceived {
EventData event = 1;
// namespace path
string namespace = 2;
string event_type = 3;
EventPluginInfo plugin_info = 4;
}