vault/logical/plugin/mock/path_errors.go
Calvin Leung Huang c8388a9eba Add plugin auto-reload capability (#3171)
* Add automatic plugin reload

* Refactor builtin/backend

* Remove plugin reload at the core level

* Refactor plugin tests

* Add auto-reload test case

* Change backend to use sync.RWMutex, fix dangling test plugin processes

* Add a canary to plugin backends to avoid reloading many times (#3174)

* Call setupPluginCatalog before mount-related operations in postUnseal

* Don't create multiple system backends since core only holds a reference (#3176)

to one.
2017-08-15 22:10:32 -04:00

33 lines
802 B
Go

package mock
import (
"net/rpc"
"github.com/hashicorp/vault/logical"
"github.com/hashicorp/vault/logical/framework"
)
// pathInternal is used to test viewing internal backend values. In this case,
// it is used to test the invalidate func.
func errorPaths(b *backend) []*framework.Path {
return []*framework.Path{
&framework.Path{
Pattern: "errors/rpc",
Callbacks: map[logical.Operation]framework.OperationFunc{
logical.ReadOperation: b.pathErrorRPCRead,
},
},
&framework.Path{
Pattern: "errors/kill",
Callbacks: map[logical.Operation]framework.OperationFunc{
logical.ReadOperation: b.pathErrorRPCRead,
},
},
}
}
func (b *backend) pathErrorRPCRead(
req *logical.Request, data *framework.FieldData) (*logical.Response, error) {
return nil, rpc.ErrShutdown
}