open-vault/builtin/logical/transit/backend.go

36 lines
553 B
Go

package transit
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{
PathsSpecial: &logical.Paths{
Root: []string{
"policy/*",
},
},
Paths: []*framework.Path{
pathPolicy(),
pathEncrypt(),
pathDecrypt(),
},
Secrets: []*framework.Secret{},
}
return b.Backend
}
type backend struct {
*framework.Backend
}