Documentation
¶
Overview ¶
Package localserver is the HTTP side of the local OVDB server: the hardening middleware chain, the local API (/api/local/v1/…), the landing page, and the openvaultdb-go data API (/v1/…) mounted behind them. It exists only in local mode; legacy `ovdb serve` never uses it (REQ:local-mode-only-for-new-surfaces).
Increment 1a serves an empty database map; the registry, console, login and sessions arrive in later increments and slot into the same chain.
Index ¶
Constants ¶
const AuthStoreFile = "auth.json"
AuthStoreFile holds scoped tokens, hashed, in OVDB home.
const LocalAPIPrefix = "/api/local/v1/"
LocalAPIPrefix is the versioned local API root.
const LoginLinkTTL = 10 * time.Minute
LoginLinkTTL is how long a login code stays valid (REQ:login-links).
Variables ¶
This section is empty.
Functions ¶
Types ¶
type LoginLink ¶
type LoginLink struct {
Schema int `json:"schema"`
URL string `json:"url"`
FallbackURL string `json:"fallback_url"`
ExpiresAt time.Time `json:"expires_at"`
}
LoginLink is the body of POST /api/local/v1/login-links.
type LoginLinkRequest ¶
type LoginLinkRequest struct {
Next string `json:"next,omitempty"`
}
LoginLinkRequest is its optional request body.
type Options ¶
type Options struct {
Dirs paths.Dirs
Record runtime.Record // this run's server.json content
Secret string
// RequestShutdown is called once the shutdown response is written.
RequestShutdown func()
Now func() time.Time // time.Now when nil
// ErrorLog receives recovered panics; they are redacted before writing.
ErrorLog io.Writer
}
Options configure one local server.
type RunOptions ¶
type RunOptions struct {
Dirs paths.Dirs
Port int
Version string
Listen runtime.ListenFunc // net.Listen when nil
Log io.Writer // server.log in a detached server
// FailBeforeReady makes the process exit after taking the lock and
// before it is ready; tests use it to prove server_start_failed.
FailBeforeReady bool
}
RunOptions configure the server process.