Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use const for in relation to vault eventing metadata #29130

Merged
merged 3 commits into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions sdk/logical/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,17 @@ import (

// common event metadata keys
const (
// EventMetadataDataPath is used in event metadata to show the API path that can be used to fetch any underlying
// data. For example, the KV plugin would set this to `data/mysecret`. The event system will automatically prepend
// the plugin mount to this path, if present, so it would become `secret/data/mysecret`, for example.
// EventMetadataPath is used in event metadata to show the API path the client must have the `subscribe` capability
// on in order to consume the event. It is recommended that the event path metadata field is the API path that was
// invoked in order to generate the event.
//
// For example, the KV plugin would set this to `data/mysecret`. The event system will automatically prepend the
// plugin mount to this path, if present, so it would become `secret/data/mysecret`, for example.
// If this is an auth plugin event, this will additionally be prepended with `auth/`.
EventMetadataPath = "path"
hashiblaum marked this conversation as resolved.
Show resolved Hide resolved
// EventMetadataDataPath is used in event metadata to show the API path that can be used to fetch any underlying
// data. Similar to the `path` event metadata, the event system will automatically prepend the plugin mount to the
// `data_path`.
EventMetadataDataPath = "data_path"
// EventMetadataOperation is used in event metadata to express what operation was performed that generated the
// event, e.g., `read` or `write`.
Expand Down
2 changes: 1 addition & 1 deletion vault/eventbus/bus.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ var (

// these metadata fields will have the plugin mount path prepended to them
metadataPrependPathFields = []string{
"path",
logical.EventMetadataPath,
logical.EventMetadataDataPath,
}
)
Expand Down
Loading