Skip to content

Commit

Permalink
drop types.PluginsV1 from audit log payload (#46830)
Browse files Browse the repository at this point in the history
Okta plugin sets `plugin.spec.settings` which is a one of message and our audit log incorrectly uses `json.Marshal/Unmarshal` to marshal and Unmarshal objects from json.

When unmarshaling the oneof, json parser fails because it can't decode the correct message.

This PR changes the type to use a `google.protobuf.Struct` so it can hold any static data.

Signed-off-by: Tiago Silva <tiago.silva@goteleport.com>
  • Loading branch information
tigrato committed Sep 21, 2024
1 parent 4d8814b commit 427f784
Show file tree
Hide file tree
Showing 2 changed files with 941 additions and 936 deletions.
11 changes: 8 additions & 3 deletions api/proto/teleport/legacy/types/events/events.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3912,18 +3912,23 @@ message PluginDelete {

// PluginMetadata contains information about plugin resources.
message PluginMetadata {
reserved 2;
reserved "plugin";
// plugin_type is the plugin type of the plugin resource.
// The value matches the types.PluginV1.Spec.Type field.
string plugin_type = 1 [(gogoproto.jsontag) = "plugin_type"];

// plugin is the resource without secrets.
types.PluginV1 plugin = 2 [(gogoproto.jsontag) = "plugin,omitempty"];

// has_credentials indicates whether the plugin has credentials.
bool has_credentials = 3 [(gogoproto.jsontag) = "has_credentials"];

// reuses_credentials indicates whether the plugin reuses credentials.
bool reuses_credentials = 4 [(gogoproto.jsontag) = "reuses_credentials"];

// plugin_data is the plugin data of the plugin resource.
google.protobuf.Struct plugin_data = 5 [
(gogoproto.jsontag) = "plugin_data,omitempty",
(gogoproto.casttype) = "Struct"
];
}

// OneOf is a union of one of audit events submitted to the auth service
Expand Down
Loading

0 comments on commit 427f784

Please sign in to comment.