Documentation
¶
Overview ¶
Package api provides HTTP handlers for the KV API.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthProvider ¶
type AuthProvider interface {
Enabled() bool
FilterKeysForRequest(r *http.Request, keys []string) []string
GetRequestActor(r *http.Request) (actorType, actorName string)
}
AuthProvider defines the interface for authentication operations.
type Deps ¶ added in v0.19.0
type Deps struct {
Store KVStore
Auth AuthProvider
Validator FormatValidator
Git GitService // optional
Events EventPublisher // optional
}
Deps holds dependencies for the API handler.
type EventPublisher ¶ added in v0.19.0
type EventPublisher interface {
Publish(key string, action enum.AuditAction)
}
EventPublisher defines the interface for publishing key change events.
type FormatValidator ¶
FormatValidator defines the interface for format validation.
type GitService ¶
type GitService interface {
Commit(req git.CommitRequest) error
Delete(key string, author git.Author) error
History(key string, limit int) ([]git.HistoryEntry, error)
GetRevision(key string, rev string) ([]byte, string, error)
}
GitService defines the interface for git operations.
type Handler ¶
type Handler struct {
Deps
}
Handler handles API requests for /kv/* endpoints.
func (*Handler) Register ¶
func (h *Handler) Register(r *routegroup.Bundle)
Register registers API routes on the given router.
type KVStore ¶
type KVStore interface {
Get(ctx context.Context, key string) ([]byte, error)
GetWithFormat(ctx context.Context, key string) ([]byte, string, error)
Set(ctx context.Context, key string, value []byte, format string) (created bool, err error)
Delete(ctx context.Context, key string) error
List(ctx context.Context, filter enum.SecretsFilter) ([]store.KeyInfo, error)
SecretsEnabled() bool
}
KVStore defines the interface for key-value storage operations.
Click to show internal directories.
Click to hide internal directories.