open-vault/sdk/plugin/mock/path_special.go
Brian Kassouf 303c2aee7c
Run a more strict formatter over the code (#11312)
* Update tooling

* Run gofumpt

* go mod vendor
2021-04-08 09:43:39 -07:00

28 lines
627 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
}