-
Notifications
You must be signed in to change notification settings - Fork 185
/
types.go
28 lines (21 loc) · 881 Bytes
/
types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package types
import (
"net/http"
"github.com/hashicorp/vault/api"
)
// Backend is an interface for the types of Vaults that are supported
type Backend interface {
Login() error
// GetSecrets retrieves the secret at `path` with specified `version` based on configuation given in `annotations`
GetSecrets(path string, version string, annotations map[string]string) (map[string]interface{}, error)
// GetIndividualSecret retrieves the specific secret from `path` with specified `version` based on configuation given in `annotations`
GetIndividualSecret(path, secret, version string, annotations map[string]string) (interface{}, error)
}
// AuthType is and interface for the supported authentication methods
type AuthType interface {
Authenticate(*api.Client) error
}
// HTTPClient interface
type HTTPClient interface {
Do(req *http.Request) (*http.Response, error)
}