mirror of
https://github.com/hashicorp/vault.git
synced 2026-05-05 04:16:31 +02:00
Be more permissive in what URLs to allow; added test for unix socket. (#6859)
This commit is contained in:
parent
1f3ec37a57
commit
f06bfa3087
@ -237,9 +237,7 @@ func NewConsulBackend(conf map[string]string, logger log.Logger) (physical.Backe
|
||||
logger.Debug("config address parsed", "scheme", parts[0])
|
||||
logger.Debug("config scheme parsed", "address", parts[1])
|
||||
}
|
||||
} else {
|
||||
return nil, errors.New("address should be host[:port], not URL")
|
||||
}
|
||||
} // allow "unix:" or whatever else consul supports in the future
|
||||
}
|
||||
}
|
||||
if scheme, ok := conf["scheme"]; ok {
|
||||
|
||||
@ -231,6 +231,24 @@ func TestConsul_newConsulBackend(t *testing.T) {
|
||||
max_parallel: 4,
|
||||
consistencyMode: "strong",
|
||||
},
|
||||
{
|
||||
name: "Unix socket",
|
||||
consulConfig: map[string]string{
|
||||
"address": "unix:///tmp/.consul.http.sock",
|
||||
},
|
||||
address: "/tmp/.consul.http.sock",
|
||||
scheme: "http", // Default, not overridden?
|
||||
|
||||
// Defaults
|
||||
checkTimeout: 5 * time.Second,
|
||||
redirectAddr: "http://127.0.0.1:8200",
|
||||
path: "vault/",
|
||||
service: "vault",
|
||||
token: "",
|
||||
max_parallel: 4,
|
||||
disableReg: false,
|
||||
consistencyMode: "default",
|
||||
},
|
||||
{
|
||||
name: "Scheme in address",
|
||||
consulConfig: map[string]string{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user