mirror of
https://github.com/hashicorp/vault.git
synced 2025-08-14 18:47:01 +02:00
* Start work on passing context to backends * More work on passing context * Unindent logical system * Unindent token store * Unindent passthrough * Unindent cubbyhole * Fix tests * use requestContext in rollback and expiration managers
33 lines
832 B
Go
33 lines
832 B
Go
package mock
|
|
|
|
import (
|
|
"context"
|
|
"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(ctx context.Context, req *logical.Request, data *framework.FieldData) (*logical.Response, error) {
|
|
return nil, rpc.ErrShutdown
|
|
}
|