Documentation
¶
Overview ¶
Package server provides HTTP server for the key-value store API.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateAuthSchema ¶ added in v0.9.2
GenerateAuthSchema generates JSON schema for auth.Config struct.
func VerifyAuthConfig ¶ added in v0.9.2
VerifyAuthConfig validates auth config data against the embedded JSON schema.
Types ¶
type Config ¶
type Config struct {
Address string
ReadTimeout time.Duration
WriteTimeout time.Duration
IdleTimeout time.Duration
ShutdownTimeout time.Duration
Version string
BaseURL string // base URL path for reverse proxy (e.g., /stash)
PageSize int // keys per page in web UI (0 = unlimited)
BodySizeLimit int64 // max request body size in bytes
RequestsPerSec float64 // max requests per second (rate limit)
MaxConcurrent int64 // max concurrent in-flight requests
LoginConcurrency int64 // max concurrent login attempts
AuditEnabled bool // enable audit logging
AuditQueryLimit int // max entries per audit query (default 10000)
}
Config holds server configuration.
type Deps ¶ added in v0.19.0
type Deps struct {
Store KVStore
Validator Validator
Git GitService // optional, nil to disable git versioning
Auth *auth.Service // optional, nil to disable authentication
AuditStore *store.Store // optional, nil to disable audit logging
SSE *sse.Service // optional, nil to disable key change subscriptions
}
Deps holds server dependencies.
type GitService ¶ added in v0.9.1
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 KVStore ¶
type KVStore interface {
Get(ctx context.Context, key string) ([]byte, error)
GetWithFormat(ctx context.Context, key string) ([]byte, string, error)
GetInfo(ctx context.Context, key string) (store.KeyInfo, error)
Set(ctx context.Context, key string, value []byte, format string) (created bool, err error)
SetWithVersion(ctx context.Context, key string, value []byte, format string, expectedVersion time.Time) 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.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package api provides HTTP handlers for the KV API.
|
Package api provides HTTP handlers for the KV API. |
|
Package audit provides HTTP middleware for audit logging and query handler for audit log access.
|
Package audit provides HTTP middleware for audit logging and query handler for audit log access. |
|
Package auth provides authentication and authorization for the stash server.
|
Package auth provides authentication and authorization for the stash server. |
|
internal
|
|
|
cookie
Package cookie provides shared cookie-related constants.
|
Package cookie provides shared cookie-related constants. |
|
schema
command
|
|
|
Package sse provides Server-Sent Events support for real-time key change notifications.
|
Package sse provides Server-Sent Events support for real-time key change notifications. |
|
Package web provides HTTP handlers for the web UI.
|
Package web provides HTTP handlers for the web UI. |
Click to show internal directories.
Click to hide internal directories.