2015-03-21 16:19:37 +00:00
|
|
|
package consul
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/hashicorp/vault/logical"
|
|
|
|
"github.com/hashicorp/vault/logical/framework"
|
|
|
|
)
|
|
|
|
|
2015-07-01 00:45:20 +00:00
|
|
|
func Factory(conf *logical.BackendConfig) (logical.Backend, error) {
|
|
|
|
return Backend().Setup(conf)
|
2015-03-21 16:19:37 +00:00
|
|
|
}
|
|
|
|
|
2016-06-03 14:08:58 +00:00
|
|
|
func Backend() *backend {
|
2015-03-21 16:19:37 +00:00
|
|
|
var b backend
|
|
|
|
b.Backend = &framework.Backend{
|
|
|
|
Paths: []*framework.Path{
|
2015-04-19 05:28:53 +00:00
|
|
|
pathConfigAccess(),
|
2016-11-04 16:35:16 +00:00
|
|
|
pathListRoles(&b),
|
2015-04-27 20:59:56 +00:00
|
|
|
pathRoles(),
|
2015-03-21 16:19:37 +00:00
|
|
|
pathToken(&b),
|
|
|
|
},
|
|
|
|
|
|
|
|
Secrets: []*framework.Secret{
|
2016-01-29 22:44:09 +00:00
|
|
|
secretToken(&b),
|
2015-03-21 16:19:37 +00:00
|
|
|
},
|
|
|
|
}
|
|
|
|
|
2016-06-03 14:08:58 +00:00
|
|
|
return &b
|
2015-03-21 16:19:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type backend struct {
|
|
|
|
*framework.Backend
|
|
|
|
}
|