Fix interface conversion panic during database creds revoke (#4850)
This commit is contained in:
parent
e3bf33b5c7
commit
eb70ad032a
|
@ -603,7 +603,7 @@ func TestBackend_basic(t *testing.T) {
|
|||
"username": credsResp.Data["username"],
|
||||
"role": "plugin-role-test",
|
||||
"db_name": "plugin-test",
|
||||
"revocation_statements": []string(nil),
|
||||
"revocation_statements": []interface{}(nil),
|
||||
},
|
||||
},
|
||||
})
|
||||
|
|
|
@ -111,7 +111,9 @@ func (b *databaseBackend) secretCredsRevoke() framework.OperationFunc {
|
|||
if statementsRaw, ok := req.Secret.InternalData["revocation_statements"]; !ok {
|
||||
return nil, fmt.Errorf("error during revoke: could not find role with name %q or embedded revocation statement data", req.Secret.InternalData["role"])
|
||||
} else {
|
||||
statements.Revocation = statementsRaw.([]string)
|
||||
for _, v := range statementsRaw.([]interface{}) {
|
||||
statements.Revocation = append(statements.Revocation, v.(string))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue