Documentation
¶
Index ¶
Constants ¶
const ( // AuthnModeUnauthenticated: sidecar binds all interfaces; every // caller is trusted. Acceptable only on validator-only pod // networks. AuthnModeUnauthenticated = "" // AuthnModeTrustedHeader pairs the sidecar with an in-pod // kube-rbac-proxy on TLS :8443. The proxy performs TokenReview + // SAR against the K8s API and forwards passed requests to // 127.0.0.1:7777 with X-Remote-User naming the authenticated // identity. AuthnModeTrustedHeader = "trusted-header" )
const ( BackendTest = keyring.BackendTest BackendFile = keyring.BackendFile BackendOS = keyring.BackendOS )
Values accepted by SEI_KEYRING_BACKEND. Aliased so the env-contract surface lives in one place.
Variables ¶
var AllowedBackends = []string{BackendTest, BackendFile, BackendOS}
AllowedBackends is the narrow set supported today; KMS / Vault are deferred.
Functions ¶
func AuthnMode ¶ added in v0.0.50
AuthnMode reads SEI_SIDECAR_AUTHN_MODE and returns the canonical value. Strict: an unrecognized non-empty value is an error, so a typo (e.g. "trusted_header" with underscore) cannot silently degrade a hardened deployment to wide-open :7777.
func BindAddress ¶ added in v0.0.50
BindAddress returns the listen address for the given mode. The loopback bind in trusted-header mode is load-bearing — it confines the listen socket to the pod's network namespace so the only path to :7777 is through the in-pod proxy.
func BypassPaths ¶ added in v0.0.50
func BypassPaths() []string
BypassPaths returns the set of paths exempt from the X-Remote-User check, sorted, so serve.go can log them at startup and the controller-side PR can keep --allow-paths in sync.
func OpenKeyring ¶ added in v0.0.50
OpenKeyring constructs a Cosmos SDK keyring for the given backend. For file backend, the passphrase is fed twice because the underlying 99designs/keyring asks for it twice on key-creation paths. Caller is responsible for unsetting SEI_KEYRING_PASSPHRASE post-return.
func SmokeTestKeyring ¶ added in v0.0.50
SmokeTestKeyring verifies the keyring is structurally usable. An empty keyring is permitted; first sign-tx surfaces missing keys. Panic recovery exists so the retry loop runs even if the underlying lib panics on a malformed config.
Types ¶
type ErrorResponse ¶
type ErrorResponse struct {
Error string `json:"error"`
}
ErrorResponse is a standard JSON error envelope.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is the HTTP API for the sidecar.
type TaskRequest ¶
type TaskRequest struct {
ID string `json:"id,omitempty"`
Type string `json:"type"`
Params map[string]any `json:"params,omitempty"`
}
TaskRequest is the JSON body for POST /v0/tasks. When ID is provided, the engine uses it as the task's canonical identifier; otherwise a random UUID is generated.