mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-01 19:17:58 +00:00
Vault 18538 reference runtime on plugin register (#22744)
--------- Co-authored-by: Tom Proctor <tomhjp@users.noreply.github.com>
This commit is contained in:
@@ -161,6 +161,21 @@ func TestGetPlugin(t *testing.T) {
|
||||
Version: "",
|
||||
},
|
||||
},
|
||||
"oci image": {
|
||||
version: "v0.16.0",
|
||||
body: getResponseOCIImageVersion,
|
||||
expected: GetPluginResponse{
|
||||
Args: []string{},
|
||||
Builtin: false,
|
||||
Command: "",
|
||||
Name: "jwt",
|
||||
OCIImage: "hashicorp/vault-plugin-auth-jwt",
|
||||
Runtime: "gvisor",
|
||||
SHA256: "8ba442dba253803685b05e35ad29dcdebc48dec16774614aa7a4ebe53c1e90e1",
|
||||
DeprecationStatus: "",
|
||||
Version: "v0.16.0",
|
||||
},
|
||||
},
|
||||
} {
|
||||
t.Run(name, func(t *testing.T) {
|
||||
mockVaultServer := httptest.NewServer(http.HandlerFunc(mockVaultHandlerInfo(tc.body)))
|
||||
@@ -253,6 +268,25 @@ const getResponseOldServerVersion = `{
|
||||
"auth": null
|
||||
}`
|
||||
|
||||
const getResponseOCIImageVersion = `{
|
||||
"request_id": "e93d3f93-8e4f-8443-a803-f1c97c495241",
|
||||
"lease_id": "",
|
||||
"renewable": false,
|
||||
"lease_duration": 0,
|
||||
"data": {
|
||||
"args": [],
|
||||
"builtin": false,
|
||||
"name": "jwt",
|
||||
"oci_image" : "hashicorp/vault-plugin-auth-jwt",
|
||||
"runtime" : "gvisor",
|
||||
"sha256": "8ba442dba253803685b05e35ad29dcdebc48dec16774614aa7a4ebe53c1e90e1",
|
||||
"version": "v0.16.0"
|
||||
},
|
||||
"wrap_info": null,
|
||||
"warnings": null,
|
||||
"auth": null
|
||||
}`
|
||||
|
||||
func mockVaultHandlerList(w http.ResponseWriter, _ *http.Request) {
|
||||
_, _ = w.Write([]byte(listUntypedResponse))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user