diff --git a/api/sys_plugins.go b/api/sys_plugins.go index 3ad581de91..db7a1440d3 100644 --- a/api/sys_plugins.go +++ b/api/sys_plugins.go @@ -42,6 +42,7 @@ type PluginDetails struct { Version string `json:"version,omitempty"` Builtin bool `json:"builtin"` DeprecationStatus string `json:"deprecation_status,omitempty" mapstructure:"deprecation_status"` + SHA256 string `json:"sha256,omitempty"` } // ListPlugins wraps ListPluginsWithContext using context.Background. diff --git a/api/sys_plugins_test.go b/api/sys_plugins_test.go index e173c02f4e..27518d3b16 100644 --- a/api/sys_plugins_test.go +++ b/api/sys_plugins_test.go @@ -55,7 +55,7 @@ func TestListPlugins(t *testing.T) { expectedPlugins: map[PluginType][]string{ PluginTypeCredential: {"alicloud"}, PluginTypeDatabase: {"cassandra-database-plugin"}, - PluginTypeSecrets: {"ad", "alicloud"}, + PluginTypeSecrets: {"ad", "alicloud", "vault-plugin-secrets-azure"}, }, }, "only auth plugins": { @@ -73,7 +73,7 @@ func TestListPlugins(t *testing.T) { "only secret plugins": { input: ListPluginsInput{Type: PluginTypeSecrets}, expectedPlugins: map[PluginType][]string{ - PluginTypeSecrets: {"ad", "alicloud"}, + PluginTypeSecrets: {"ad", "alicloud", "vault-plugin-secrets-azure"}, }, }, } { @@ -308,7 +308,8 @@ const listUntypedResponse = `{ ], "secret": [ "ad", - "alicloud" + "alicloud", + "vault-plugin-secrets-azure" ], "some_other_unexpected_key": [ { @@ -346,6 +347,14 @@ const listUntypedResponse = `{ "version": "v0.13.0+builtin", "builtin": true, "deprecation_status": "supported" + }, + { + "type": "secret", + "name": "vault-plugin-secrets-azure", + "version": "v0.24.0+ent", + "builtin": false, + "deprecation_status": "supported", + "sha256": "8ba442dba253803685b05e35ad29dcdebc48dec16774614aa7a4ebe53c1e90e1" } ] }, diff --git a/changelog/_10761.txt b/changelog/_10761.txt new file mode 100644 index 0000000000..4c740a82f8 --- /dev/null +++ b/changelog/_10761.txt @@ -0,0 +1,3 @@ +```release-note:improvement +api: Add a SHA256 sum field to the json list response for external plugins. +``` \ No newline at end of file