mirror of
https://github.com/hashicorp/vault.git
synced 2026-05-05 20:36:26 +02:00
Update the connection details data and fix allowedRoles
This commit is contained in:
parent
58b0bbd477
commit
e18757628c
@ -6,7 +6,6 @@ import (
|
||||
|
||||
"github.com/fatih/structs"
|
||||
"github.com/hashicorp/vault/builtin/logical/database/dbplugin"
|
||||
"github.com/hashicorp/vault/helper/strutil"
|
||||
"github.com/hashicorp/vault/logical"
|
||||
"github.com/hashicorp/vault/logical/framework"
|
||||
)
|
||||
@ -187,9 +186,14 @@ func (b *databaseBackend) connectionWriteHandler() framework.OperationFunc {
|
||||
|
||||
verifyConnection := data.Get("verify_connection").(bool)
|
||||
|
||||
// Pasrse and dedupe allowed roles from a comma separated string.
|
||||
allowedRolesRaw := data.Get("allowed_roles").(string)
|
||||
allowedRoles := strutil.ParseDedupAndSortStrings(allowedRolesRaw, ",")
|
||||
allowedRoles := data.Get("allowed_roles").([]string)
|
||||
|
||||
// Remove these entries from the data before we store it keyed under
|
||||
// ConnectionDetails.
|
||||
delete(data.Raw, "name")
|
||||
delete(data.Raw, "plugin_name")
|
||||
delete(data.Raw, "allowed_roles")
|
||||
delete(data.Raw, "verify_connection")
|
||||
|
||||
config := &DatabaseConfig{
|
||||
ConnectionDetails: data.Raw,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user