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

Backport of Convert events metadata type to google.protobuf.Struct into release/1.13.x #19136

Conversation

hc-github-team-secure-vault-core
Copy link
Collaborator

Backport

This PR is auto-generated from #19130 to be assessed for backporting due to the inclusion of the label backport/1.13.x.

The below text is copied from the body of the original PR.


The bytes type gets seralised as base64 by protojson when marshalled into JSON, whereas google.protobuf.Struct is the equivalent of a JSON object, so gives us a bit of structure, but still plenty of flexibility that fits in with common models of metadata, as well as nice human-readable serialisation over JSON.

As JSON before:

{"event":{"id":"323c94b3-2638-1e2b-cfd8-2b135b369400","metadata":"eyJjdXJyZW50X3ZlcnNpb24iOiIyIiwib2xkZXN0X3ZlcnNpb24iOiIwIiwicGF0aCI6ImRhdGEvZm9vIn0="},"eventType":"kv-v2/data-write","pluginInfo":{"mountClass":"secret","mountAccessor":"kv_18df2fbe","mountPath":"secret/","plugin":"kv"},"timestamp":"2023-02-10T11:14:24.899815Z"}

As JSON after:

{"event":{"id":"cb003f60-17b8-b299-d71b-082adda7fdd3", "metadata":{"current_version":"1", "oldest_version":"0", "path":"data/foo"}}, "eventType":"kv-v2/data-write", "pluginInfo":{"mountClass":"secret", "mountAccessor":"kv_e26c7797", "mountPath":"secret/", "plugin":"kv"}, "timestamp":"2023-02-10T12:26:58.558572Z"}

Overview of commits

@hc-github-team-secure-vault-core hc-github-team-secure-vault-core force-pushed the backport/vault-9284/event-metadata-as-struct/probably-desired-wallaby branch from 80f8f0f to 573d37a Compare February 10, 2023 18:58
@tomhjp tomhjp enabled auto-merge (squash) February 10, 2023 18:58
@tomhjp tomhjp merged commit af66575 into release/1.13.x Feb 10, 2023
@tomhjp tomhjp deleted the backport/vault-9284/event-metadata-as-struct/probably-desired-wallaby branch February 10, 2023 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants