Documentation
¶
Overview ¶
Package sneakystack provides a LocalStack gap-filling HTTP proxy with an in-memory store, designed to surface AWS APIs that LocalStack itself does not cover (IAM Identity Center, Organizations, Control Tower, etc.).
The package exposes:
A Server that fronts both JSON-RPC (AWS json-1.1) and REST-XML protocols, dispatching to per-service handlers registered under sneakystack/services
A Store interface backed by plain Go maps (no external DB dependency); handlers stash and retrieve their state via the Store, keeping the package import-cycle-clean
A Sidecar implementation that lets libtftest's harness drive sneakystack alongside LocalStack as a single addressable endpoint
sneakystack also ships as a standalone Docker container (cmd/sneakystack), so consumer test suites that aren't using libtftest can still benefit from the gap-fillers.
See DESIGN-0001 for the Sidecar architecture and the rationale for plain Go maps over go-memdb.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNotFound = fmt.Errorf("resource not found")
ErrNotFound indicates the requested resource was not found.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Services []string // Service names to handle (e.g., "sso-admin", "organizations").
}
Config configures a sneakystack proxy.
type Filter ¶
type Filter struct {
Parent string // E.g. instance ARN, OU id.
Tags map[string]string // Optional tag match.
}
Filter constrains List results.
type MapStore ¶
type MapStore struct {
// contains filtered or unexported fields
}
MapStore is a Store backed by plain Go maps protected by sync.RWMutex.
type Proxy ¶
type Proxy struct {
// contains filtered or unexported fields
}
Proxy is an HTTP reverse proxy that routes requests to local service handlers for gap services and forwards everything else to LocalStack.
func (*Proxy) RegisterHandler ¶
func (p *Proxy) RegisterHandler(servicePrefix string, handler ServiceHandler)
RegisterHandler maps a service prefix (from X-Amz-Target) to a handler.
type ServiceHandler ¶
type ServiceHandler interface {
Handle(w http.ResponseWriter, r *http.Request)
}
ServiceHandler handles AWS API requests for a specific service.
type Sidecar ¶
type Sidecar struct {
// contains filtered or unexported fields
}
Sidecar wraps a Proxy as a harness.Sidecar implementation.
func NewSidecar ¶
NewSidecar creates a sneakystack Sidecar for use with harness.Run.
type Store ¶
type Store interface {
Put(ctx context.Context, kind, id string, obj any) error
Get(ctx context.Context, kind, id string) (any, error)
List(ctx context.Context, kind string, filter Filter) ([]any, error)
Delete(ctx context.Context, kind, id string) error
}
Store is the persistence abstraction for service handlers. Each service gets its own typed wrapper built on top of this.