Documentation
¶
Index ¶
- Constants
- func GetMockTokenServer(tokenDataMap *sync.Map) *httptest.Server
- type Client
- func (c *Client) GetSecret(secretName string, keys ...string) (map[string]string, error)
- func (c *Client) GetSecretNames() ([]string, error)
- func (c *Client) GetSelfJWT(serviceKey string) (string, error)
- func (c *Client) IsJWTValid(jwt string) (bool, error)
- func (c *Client) SetAuthToken(ctx context.Context, newToken string) error
- func (c *Client) StoreSecret(secretName string, secrets map[string]string) error
- type ErrCaRootCert
- type ErrHTTPResponse
- type TokenLookupResponse
Constants ¶
const ( // NamespaceHeader specifies the header name to use when including Namespace information in a request. NamespaceHeader = "X-Vault-Namespace" AuthTypeHeader = "X-Vault-Token" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct { Config types.SecretConfig HttpCaller secrets.Caller // contains filtered or unexported fields }
Client defines the behavior for interacting with the OpenBao REST secret key/value store via HTTP(S).
func NewClient ¶
func NewClient(config types.SecretConfig, requester secrets.Caller, forSecrets bool, lc log.Logger) (*Client, error)
NewClient constructs a secret store *Client which communicates with OpenBao via HTTP(S) lc is any logging client that implements the Logger interface.
func NewSecretsClient ¶
func NewSecretsClient(ctx context.Context, config types.SecretConfig, lc log.Logger, callback secrets.TokenExpiredCallback) (*Client, error)
NewSecretsClient constructs a secret store *Client which communicates with OpenBao via HTTP(S) for basic usage of secrets
func (*Client) GetSecret ¶
GetSecret retrieves the secret at the provided secretName that matches the specified keys.
func (*Client) GetSecretNames ¶
GetSecretNames retrieves the secret names currently in service's secret store.
func (*Client) GetSelfJWT ¶
GetSelfJWT returns an encoded JWT for the current identity-based secret store token
func (*Client) IsJWTValid ¶
IsJWTValid evaluates a given JWT and returns a true/false if the JWT is valid (i.e. belongs to us and current) or not
func (*Client) SetAuthToken ¶
type ErrCaRootCert ¶
type ErrCaRootCert struct {
// contains filtered or unexported fields
}
ErrCaRootCert error when the provided CA Root certificate is invalid.
func (ErrCaRootCert) Error ¶
func (e ErrCaRootCert) Error() string
type ErrHTTPResponse ¶
func (ErrHTTPResponse) Error ¶
func (err ErrHTTPResponse) Error() string
type TokenLookupResponse ¶
type TokenLookupResponse struct {
Data types.TokenMetadata
}