mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-01 11:08:10 +00:00
Added warnings when configuring connection info in sql backends
This commit is contained in:
@@ -38,9 +38,6 @@ func TestBackend_config_connection(t *testing.T) {
|
||||
if err != nil || (resp != nil && resp.IsError()) {
|
||||
t.Fatalf("err:%s resp:%#v\n", err, resp)
|
||||
}
|
||||
if resp != nil {
|
||||
t.Fatalf("expected a nil response")
|
||||
}
|
||||
|
||||
configReq.Operation = logical.ReadOperation
|
||||
resp, err = b.HandleRequest(configReq)
|
||||
|
||||
@@ -98,7 +98,11 @@ func (b *backend) pathConnectionWrite(req *logical.Request, data *framework.Fiel
|
||||
|
||||
// Reset the DB connection
|
||||
b.ResetDB()
|
||||
return nil, nil
|
||||
|
||||
resp := &logical.Response{}
|
||||
resp.AddWarning("Read access to this endpoint should be controlled via ACLs as it will return the connection string as it is, including passwords, if any.")
|
||||
|
||||
return resp, nil
|
||||
}
|
||||
|
||||
type connectionConfig struct {
|
||||
|
||||
@@ -39,9 +39,6 @@ func TestBackend_config_connection(t *testing.T) {
|
||||
if err != nil || (resp != nil && resp.IsError()) {
|
||||
t.Fatalf("err:%s resp:%#v\n", err, resp)
|
||||
}
|
||||
if resp != nil {
|
||||
t.Fatalf("expected a nil response")
|
||||
}
|
||||
|
||||
configReq.Operation = logical.ReadOperation
|
||||
resp, err = b.HandleRequest(configReq)
|
||||
|
||||
@@ -112,7 +112,11 @@ func (b *backend) pathConnectionWrite(
|
||||
|
||||
// Reset the DB connection
|
||||
b.ResetDB()
|
||||
return nil, nil
|
||||
|
||||
resp := &logical.Response{}
|
||||
resp.AddWarning("Read access to this endpoint should be controlled via ACLs as it will return the connection URL as it is, including passwords, if any.")
|
||||
|
||||
return resp, nil
|
||||
}
|
||||
|
||||
type connectionConfig struct {
|
||||
|
||||
@@ -42,9 +42,6 @@ func TestBackend_config_connection(t *testing.T) {
|
||||
if err != nil || (resp != nil && resp.IsError()) {
|
||||
t.Fatalf("err:%s resp:%#v\n", err, resp)
|
||||
}
|
||||
if resp != nil {
|
||||
t.Fatalf("expected a nil response")
|
||||
}
|
||||
|
||||
configReq.Operation = logical.ReadOperation
|
||||
resp, err = b.HandleRequest(configReq)
|
||||
|
||||
@@ -134,7 +134,10 @@ func (b *backend) pathConnectionWrite(
|
||||
// Reset the DB connection
|
||||
b.ResetDB()
|
||||
|
||||
return nil, nil
|
||||
resp := &logical.Response{}
|
||||
resp.AddWarning("Read access to this endpoint should be controlled via ACLs as it will return the connection string or URL as it is, including passwords, if any.")
|
||||
|
||||
return resp, nil
|
||||
}
|
||||
|
||||
type connectionConfig struct {
|
||||
|
||||
Reference in New Issue
Block a user