open-vault/builtin/logical/consul/backend.go
2015-06-30 17:45:20 -07:00

38 lines
594 B
Go

package consul
import (
"github.com/hashicorp/vault/logical"
"github.com/hashicorp/vault/logical/framework"
)
func Factory(conf *logical.BackendConfig) (logical.Backend, error) {
return Backend().Setup(conf)
}
func Backend() *framework.Backend {
var b backend
b.Backend = &framework.Backend{
PathsSpecial: &logical.Paths{
Root: []string{
"config/*",
},
},
Paths: []*framework.Path{
pathConfigAccess(),
pathRoles(),
pathToken(&b),
},
Secrets: []*framework.Secret{
secretToken(),
},
}
return b.Backend
}
type backend struct {
*framework.Backend
}