2015-03-21 16:19:37 +00:00
|
|
|
package consul
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/hashicorp/vault/logical"
|
|
|
|
"github.com/hashicorp/vault/logical/framework"
|
|
|
|
)
|
|
|
|
|
|
|
|
func Factory(map[string]string) (logical.Backend, error) {
|
|
|
|
return Backend(), nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func Backend() *framework.Backend {
|
|
|
|
var b backend
|
|
|
|
b.Backend = &framework.Backend{
|
2015-03-31 03:30:07 +00:00
|
|
|
PathsSpecial: &logical.Paths{
|
|
|
|
Root: []string{
|
2015-04-19 05:28:53 +00:00
|
|
|
"config/*",
|
2015-03-31 03:30:07 +00:00
|
|
|
"policy/*",
|
|
|
|
},
|
2015-03-21 16:19:37 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
Paths: []*framework.Path{
|
2015-04-19 05:28:53 +00:00
|
|
|
pathConfigAccess(),
|
2015-03-21 16:19:37 +00:00
|
|
|
pathPolicy(),
|
|
|
|
pathToken(&b),
|
|
|
|
},
|
|
|
|
|
|
|
|
Secrets: []*framework.Secret{
|
|
|
|
secretToken(),
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
return b.Backend
|
|
|
|
}
|
|
|
|
|
|
|
|
type backend struct {
|
|
|
|
*framework.Backend
|
|
|
|
}
|