sandboxcontrolapi

package
v0.0.0-...-804b954 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 13, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package sandboxcontrolapi serves the private sandbox.control/v1 control process without exposing persistence, authentication, or transport types in the public sandbox SDK.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHandler

func NewHandler(config Config) (http.Handler, error)

NewHandler constructs a strict, bounded sandbox.control/v1 handler. It does not open a listener, create schema, load credentials, or dispatch a host.

Types

type Authenticator

type Authenticator interface {
	Authenticate(context.Context, string) (Identity, error)
}

Authenticator verifies a fresh request credential without retaining it.

type Config

type Config struct {
	Store           sandboxcontrol.DurableStore
	Authenticator   Authenticator
	AssertionKey    []byte
	Entropy         io.Reader
	Clock           clock.Clock
	BindingLifetime time.Duration
	Retention       time.Duration
	WaitInterval    time.Duration
	// Wait is the injected cancellation-aware scheduling seam used between
	// durable reads. Production composition supplies a bounded context wait;
	// deterministic tests can advance without wall-clock sleeps.
	Wait      func(context.Context, time.Duration) error
	Admission sandbox.OperationAdmissionPolicy
}

Config contains explicit control-process authority and finite policy.

type Identity

type Identity struct {
	Authority string
	Tenant    string
	Subject   string
	Principal string
}

Identity is the complete authenticated authority bound to one private assertion. Principal is the durable ledger scope; Authority, Tenant and Subject prevent a credential from matching only by display name.

type StaticAuthenticator

type StaticAuthenticator struct {
	// contains filtered or unexported fields
}

StaticAuthenticator binds one already-injected authorization value to one explicit identity. It retains only the credential digest and is intended for isolated development or a single service identity, not multi-user issuance.

func NewStaticAuthenticator

func NewStaticAuthenticator(authorization string, identity Identity) (*StaticAuthenticator, error)

NewStaticAuthenticator constructs a fixed-identity adapter without retaining the authorization value.

func (*StaticAuthenticator) Authenticate

func (authenticator *StaticAuthenticator) Authenticate(ctx context.Context, authorization string) (Identity, error)

Authenticate performs a constant-time digest comparison and returns no credential material in either success or failure values.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL