Include SHA256 sum field in the list response for external plugins (#10761) (#10805)

* Include SHA256 sum field in the list response for external plugins

* Add changelog

* remove mapstructure

Co-authored-by: Zlaticanin <60530402+Zlaticanin@users.noreply.github.com>
This commit is contained in:
Vault Automation 2025-11-17 11:58:58 -05:00 committed by GitHub
parent a92bffe5ce
commit ab45220ae3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 16 additions and 3 deletions

View file

@ -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.

View file

@ -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"
}
]
},

3
changelog/_10761.txt Normal file
View file

@ -0,0 +1,3 @@
```release-note:improvement
api: Add a SHA256 sum field to the json list response for external plugins.
```