mirror of
https://github.com/hashicorp/vault.git
synced 2025-11-29 14:41:09 +01:00
For SSH backend, allow factory to be provided instead of Backend
This commit is contained in:
parent
b6293662f2
commit
af03222a3e
@ -7,8 +7,8 @@ import (
|
|||||||
"github.com/hashicorp/vault/logical/framework"
|
"github.com/hashicorp/vault/logical/framework"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Factory(map[string]string) (logical.Backend, error) {
|
func Factory(conf *logical.BackendConfig) (logical.Backend, error) {
|
||||||
return Backend(), nil
|
return Backend().Setup(conf)
|
||||||
}
|
}
|
||||||
|
|
||||||
func Backend() *framework.Backend {
|
func Backend() *framework.Backend {
|
||||||
|
|||||||
@ -41,7 +41,11 @@ func (b *backend) pathLookupWrite(req *logical.Request, d *framework.FieldData)
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
if len(keys) == 0 {
|
if len(keys) == 0 {
|
||||||
return nil, fmt.Errorf("No roles registered for IP '%s'", ip.String())
|
return &logical.Response{
|
||||||
|
Data: map[string]interface{}{
|
||||||
|
"roles": "",
|
||||||
|
},
|
||||||
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
var matchingRoles []string
|
var matchingRoles []string
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user