Documentation
¶
Index ¶
- func HealthHandler(w http.ResponseWriter, r *http.Request)
- func ReencryptState(ctx context.Context, config *core.Config, fileSystem afero.Fs, ...) (*statestore.ReencryptReport, error)
- func Setup(router *mux.Router, config *core.Config, pluginServiceListener net.Listener) (io.WriteCloser, func(), error)
- type ReencryptStateOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HealthHandler ¶
func HealthHandler(w http.ResponseWriter, r *http.Request)
func ReencryptState ¶ added in v0.9.0
func ReencryptState( ctx context.Context, config *core.Config, fileSystem afero.Fs, opts ReencryptStateOptions, ) (*statestore.ReencryptReport, error)
ReencryptState re-seals a memfile state directory under the configured key.
Covers encrypting a directory written in plaintext, moving one from a previous key to the current one, and decrypting one. Which of those happens follows from the configuration: the key under state.encryption is the target, state.encryption.previous_keys are the keys the existing objects are opened with, and Decrypt inverts the target.
Run with the engine stopped. The engine holds state in memory and persists it on write, so a pass against a live engine is liable to be overwritten by it.
func Setup ¶
func Setup( router *mux.Router, config *core.Config, pluginServiceListener net.Listener, ) (io.WriteCloser, func(), error)
Setup wires up the v1 API on the given router and returns the callback that shuts everything it started back down.
The order below is the order things depend on each other in; where a step depends on its position rather than only on having run, that is noted.
Types ¶
type ReencryptStateOptions ¶ added in v0.9.0
type ReencryptStateOptions struct {
// DryRun reports what the pass would do and writes nothing, neither state nor backup.
DryRun bool
// Decrypt writes state back as plaintext instead of sealing it with the configured key,
// which backs state encryption out. Needs the key that sealed the state to still be
// configured.
Decrypt bool
// BackupDir is where a copy of the state is written before anything is rewritten. Empty
// derives one alongside the state directory.
BackupDir string
// SkipBackup proceeds without taking a copy first. A pass rewrites objects in place, so
// an interruption leaves a store holding a mix of keys; the copy is what makes that
// recoverable.
SkipBackup bool
// Force proceeds even though something is listening on the engine's address. A running
// engine holds state in memory and will write it back over this pass.
Force bool
// Out receives a line per object. Nil discards them.
Out io.Writer
}
ReencryptStateOptions controls a re-encryption pass over a memfile state directory.