open-vault/sdk/plugin/mock/path_special.go
Jeff Mitchell 9ebc57581d
Switch to go modules (#6585)
* Switch to go modules

* Make fmt
2019-04-13 03:44:06 -04:00

29 lines
628 B
Go

package mock
import (
"context"
"github.com/hashicorp/vault/sdk/framework"
"github.com/hashicorp/vault/sdk/logical"
)
// pathSpecial is used to test special paths.
func pathSpecial(b *backend) *framework.Path {
return &framework.Path{
Pattern: "special",
Callbacks: map[logical.Operation]framework.OperationFunc{
logical.ReadOperation: b.pathSpecialRead,
},
}
}
func (b *backend) pathSpecialRead(ctx context.Context, req *logical.Request, data *framework.FieldData) (*logical.Response, error) {
// Return the secret
return &logical.Response{
Data: map[string]interface{}{
"data": "foo",
},
}, nil
}