mirror of
https://github.com/hashicorp/vault.git
synced 2026-06-27 10:00:32 -04:00
* license: update headers to IBM Corp. * `make proto` * update offset because source file changed Signed-off-by: Ryan Cragun <me@ryan.ec> Co-authored-by: Ryan Cragun <me@ryan.ec>
30 lines
698 B
Go
30 lines
698 B
Go
// Copyright IBM Corp. 2016, 2025
|
|
// SPDX-License-Identifier: MPL-2.0
|
|
|
|
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
|
|
}
|