mirror of
https://github.com/hashicorp/vault.git
synced 2025-08-15 02:57:04 +02:00
* 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.
33 lines
802 B
Go
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
|
|
}
|