Documentation
¶
Index ¶
- Constants
- Variables
- func CanonicalRuntimeLeaseSignaturePayload(lease Lease, method string) ([]byte, error)
- type ArtifactProvider
- type ArtifactRequest
- type ArtifactResult
- type Ed25519RuntimeLeaseVerifier
- type HandleGrantValidationRequest
- type HandleGrantValidationResult
- type HandleGrantValidator
- type Health
- type HeartbeatResult
- type Lease
- type LeaseLimits
- type MemoryRuntimeLeaseReplayStore
- func (s *MemoryRuntimeLeaseReplayStore) ConsumeRuntimeLease(ctx context.Context, req RuntimeLeaseReplayConsumeRequest) (RuntimeLeaseReplayRecord, error)
- func (s *MemoryRuntimeLeaseReplayStore) ListRuntimeLeaseReplays(ctx context.Context, req RuntimeLeaseReplayListRequest) ([]RuntimeLeaseReplayRecord, error)
- type ProcessSupervisor
- func (s *ProcessSupervisor) Health(context.Context) (Health, error)
- func (s *ProcessSupervisor) Heartbeat(ctx context.Context) (HeartbeatResult, error)
- func (s *ProcessSupervisor) InvokeWorker(ctx context.Context, lease Lease, method string, payload []byte) ([]byte, error)
- func (s *ProcessSupervisor) Revoke(ctx context.Context, pluginInstanceID string, revokeEpoch uint64) (RevokeResult, error)
- func (s *ProcessSupervisor) Start(ctx context.Context, target Target) error
- func (s *ProcessSupervisor) Stop(ctx context.Context) error
- type ProcessSupervisorOptions
- type RevokeResult
- type RuntimeLeasePublicKey
- type RuntimeLeaseReplayConsumeRequest
- type RuntimeLeaseReplayListRequest
- type RuntimeLeaseReplayLister
- type RuntimeLeaseReplayRecord
- type RuntimeLeaseReplayStore
- type RuntimeLeaseSigningKey
- type RuntimeLeaseSigningKeyLookupRequest
- type RuntimeLeaseSigningKeyring
- type RuntimeLeaseVerificationRequest
- type RuntimeLeaseVerifier
- type RuntimeStreamSink
- type SQLiteRuntimeLeaseReplayStore
- func (s *SQLiteRuntimeLeaseReplayStore) Close() error
- func (s *SQLiteRuntimeLeaseReplayStore) ConsumeRuntimeLease(ctx context.Context, req RuntimeLeaseReplayConsumeRequest) (RuntimeLeaseReplayRecord, error)
- func (s *SQLiteRuntimeLeaseReplayStore) ListRuntimeLeaseReplays(ctx context.Context, req RuntimeLeaseReplayListRequest) ([]RuntimeLeaseReplayRecord, error)
- type StaticRuntimeLeaseSigningKeyring
- type Supervisor
- type Target
- type WorkerErrorOrigin
- type WorkerExecutionError
Constants ¶
View Source
const ( RuntimeLeaseSignatureSchemaVersion = "redevplugin.runtime_execution_lease.v1" RuntimeLeaseTokenKind = "runtime_execution_lease" RuntimeLeaseSignatureAlgorithm = "ed25519" )
Variables ¶
View Source
var ( ErrRuntimeLeaseInvalid = errors.New("runtime execution lease is invalid") ErrRuntimeLeaseReplay = errors.New("runtime execution lease has already been consumed") )
View Source
var ( ErrRuntimeLeaseSignatureKeyringRequired = errors.New("runtime lease signing keyring is required") ErrRuntimeLeaseSigningKeyNotFound = errors.New("runtime lease signing key not found") ErrRuntimeLeaseSigningKeyRevoked = errors.New("runtime lease signing key is revoked") ErrRuntimeLeasePublicKeyInvalid = errors.New("runtime lease signing public key is invalid") ErrRuntimeLeaseSignatureRequired = errors.New("runtime execution lease signature is required") ErrRuntimeLeaseSignatureInvalid = errors.New("runtime execution lease signature is invalid") )
Functions ¶
Types ¶
type ArtifactProvider ¶
type ArtifactProvider interface {
ReadArtifact(ctx context.Context, req ArtifactRequest) (ArtifactResult, error)
}
type ArtifactRequest ¶
type ArtifactResult ¶
type Ed25519RuntimeLeaseVerifier ¶
type Ed25519RuntimeLeaseVerifier struct {
Keyring RuntimeLeaseSigningKeyring
Now func() time.Time
}
func (Ed25519RuntimeLeaseVerifier) VerifyRuntimeLease ¶
func (v Ed25519RuntimeLeaseVerifier) VerifyRuntimeLease(ctx context.Context, req RuntimeLeaseVerificationRequest) error
type HandleGrantValidationRequest ¶
type HandleGrantValidationRequest struct {
HandleGrantToken string `json:"handle_grant_token"`
PluginInstanceID string `json:"plugin_instance_id"`
ActiveFingerprint string `json:"active_fingerprint"`
RuntimeInstanceID string `json:"runtime_instance_id,omitempty"`
RuntimeGenerationID string `json:"runtime_generation_id"`
RuntimeShardID string `json:"runtime_shard_id,omitempty"`
HandleID string `json:"handle_id"`
Method string `json:"method"`
PolicyRevision uint64 `json:"policy_revision"`
ManagementRevision uint64 `json:"management_revision"`
RevokeEpoch uint64 `json:"revoke_epoch"`
}
type HandleGrantValidationResult ¶
type HandleGrantValidationResult struct {
HandleGrantID string `json:"handle_grant_id"`
HandleID string `json:"handle_id"`
Method string `json:"method"`
RuntimeGenerationID string `json:"runtime_generation_id"`
MaxBytesPerSecond int64 `json:"max_bytes_per_second,omitempty"`
MaxTotalBytes int64 `json:"max_total_bytes,omitempty"`
}
type HandleGrantValidator ¶
type HandleGrantValidator interface {
ValidateHandleGrant(ctx context.Context, req HandleGrantValidationRequest) (HandleGrantValidationResult, error)
}
type Health ¶
type Health struct {
RuntimeInstanceID string `json:"runtime_instance_id"`
RuntimeGenerationID string `json:"runtime_generation_id"`
IPCChannelID string `json:"ipc_channel_id,omitempty"`
ConnectionNonce string `json:"connection_nonce,omitempty"`
RuntimeVersion string `json:"runtime_version,omitempty"`
RustIPCVersion string `json:"rust_ipc_version,omitempty"`
WASMABIVersion string `json:"wasm_abi_version,omitempty"`
Ready bool `json:"ready"`
}
type HeartbeatResult ¶
type Lease ¶
type Lease struct {
LeaseID string `json:"lease_id"`
TokenID string `json:"token_id,omitempty"`
LeaseToken string `json:"lease_token"`
LeaseNonce string `json:"lease_nonce"`
PluginID string `json:"plugin_id,omitempty"`
PluginVersion string `json:"plugin_version,omitempty"`
ActiveFingerprint string `json:"active_fingerprint,omitempty"`
SurfaceInstanceID string `json:"surface_instance_id,omitempty"`
OwnerSessionHash string `json:"owner_session_hash,omitempty"`
OwnerUserHash string `json:"owner_user_hash,omitempty"`
SessionChannelIDHash string `json:"session_channel_id_hash,omitempty"`
BridgeChannelID string `json:"bridge_channel_id,omitempty"`
RuntimeGenerationID string `json:"runtime_generation_id"`
PluginInstanceID string `json:"plugin_instance_id"`
Method string `json:"method,omitempty"`
Effect string `json:"effect,omitempty"`
Execution string `json:"execution,omitempty"`
OperationID string `json:"operation_id,omitempty"`
StreamID string `json:"stream_id,omitempty"`
AuditCorrelationID string `json:"audit_correlation_id,omitempty"`
TargetDescriptorHashes []string `json:"target_descriptor_hashes,omitempty"`
Limits LeaseLimits `json:"limits,omitempty"`
PolicyRevision uint64 `json:"policy_revision"`
ManagementRevision uint64 `json:"management_revision"`
RevokeEpoch uint64 `json:"revoke_epoch"`
RuntimeShardID string `json:"runtime_shard_id,omitempty"`
RuntimeInstanceID string `json:"runtime_instance_id,omitempty"`
IPCChannelID string `json:"ipc_channel_id,omitempty"`
ConnectionNonce string `json:"connection_nonce,omitempty"`
KeyID string `json:"key_id,omitempty"`
Signature string `json:"signature,omitempty"`
IssuedAt time.Time `json:"issued_at,omitempty"`
IssuedAtUnixMillis int64 `json:"issued_at_unix_ms,omitempty"`
ExpiresAt time.Time `json:"expires_at"`
}
func SignRuntimeLease ¶
type LeaseLimits ¶
type MemoryRuntimeLeaseReplayStore ¶
type MemoryRuntimeLeaseReplayStore struct {
// contains filtered or unexported fields
}
func NewMemoryRuntimeLeaseReplayStore ¶
func NewMemoryRuntimeLeaseReplayStore() *MemoryRuntimeLeaseReplayStore
func (*MemoryRuntimeLeaseReplayStore) ConsumeRuntimeLease ¶
func (s *MemoryRuntimeLeaseReplayStore) ConsumeRuntimeLease(ctx context.Context, req RuntimeLeaseReplayConsumeRequest) (RuntimeLeaseReplayRecord, error)
func (*MemoryRuntimeLeaseReplayStore) ListRuntimeLeaseReplays ¶
func (s *MemoryRuntimeLeaseReplayStore) ListRuntimeLeaseReplays(ctx context.Context, req RuntimeLeaseReplayListRequest) ([]RuntimeLeaseReplayRecord, error)
type ProcessSupervisor ¶
type ProcessSupervisor struct {
// contains filtered or unexported fields
}
func NewProcessSupervisor ¶
func NewProcessSupervisor(options ProcessSupervisorOptions) (*ProcessSupervisor, error)
func (*ProcessSupervisor) Health ¶
func (s *ProcessSupervisor) Health(context.Context) (Health, error)
func (*ProcessSupervisor) Heartbeat ¶
func (s *ProcessSupervisor) Heartbeat(ctx context.Context) (HeartbeatResult, error)
func (*ProcessSupervisor) InvokeWorker ¶
func (*ProcessSupervisor) Revoke ¶
func (s *ProcessSupervisor) Revoke(ctx context.Context, pluginInstanceID string, revokeEpoch uint64) (RevokeResult, error)
type ProcessSupervisorOptions ¶
type ProcessSupervisorOptions struct {
RuntimePath string
Args []string
Env []string
Dir string
Diagnostics observability.DiagnosticsSink
Artifacts ArtifactProvider
HandleGrants HandleGrantValidator
RuntimeLeaseReplays RuntimeLeaseReplayStore
StorageFiles storage.FilesBroker
StorageKV storage.KVBroker
StorageSQLite storage.SQLiteBroker
Connectivity connectivity.Broker
NetworkExecutor connectivity.NetworkExecutor
StreamSink RuntimeStreamSink
Now func() time.Time
HandshakeTimeout time.Duration
HeartbeatInterval time.Duration
MaxHeartbeatStaleness time.Duration
}
type RevokeResult ¶
type RuntimeLeasePublicKey ¶
type RuntimeLeasePublicKey struct {
Algorithm string `json:"algorithm"`
KeyID string `json:"key_id"`
PublicKeyBase64 string `json:"public_key_base64"`
}
func NormalizeRuntimeLeasePublicKeys ¶
func NormalizeRuntimeLeasePublicKeys(keys []RuntimeLeasePublicKey) ([]RuntimeLeasePublicKey, error)
func RuntimeLeasePublicKeyFromEd25519 ¶
func RuntimeLeasePublicKeyFromEd25519(keyID string, publicKey ed25519.PublicKey) (RuntimeLeasePublicKey, error)
type RuntimeLeaseReplayListRequest ¶
type RuntimeLeaseReplayListRequest struct {
PluginInstanceID string `json:"plugin_instance_id,omitempty"`
}
type RuntimeLeaseReplayLister ¶
type RuntimeLeaseReplayLister interface {
ListRuntimeLeaseReplays(ctx context.Context, req RuntimeLeaseReplayListRequest) ([]RuntimeLeaseReplayRecord, error)
}
type RuntimeLeaseReplayRecord ¶
type RuntimeLeaseReplayRecord struct {
LeaseID string `json:"lease_id"`
LeaseNonceHash string `json:"lease_nonce_hash"`
PluginInstanceID string `json:"plugin_instance_id"`
RuntimeGenerationID string `json:"runtime_generation_id"`
Method string `json:"method"`
PolicyRevision uint64 `json:"policy_revision"`
ManagementRevision uint64 `json:"management_revision"`
RevokeEpoch uint64 `json:"revoke_epoch"`
ConsumedAt time.Time `json:"consumed_at"`
ExpiresAt time.Time `json:"expires_at"`
}
type RuntimeLeaseReplayStore ¶
type RuntimeLeaseReplayStore interface {
ConsumeRuntimeLease(ctx context.Context, req RuntimeLeaseReplayConsumeRequest) (RuntimeLeaseReplayRecord, error)
}
type RuntimeLeaseSigningKey ¶
type RuntimeLeaseSigningKey struct {
KeyID string `json:"key_id"`
PublicKey ed25519.PublicKey `json:"-"`
RuntimeShardID string `json:"runtime_shard_id,omitempty"`
RuntimeInstanceID string `json:"runtime_instance_id,omitempty"`
RuntimeGenerationID string `json:"runtime_generation_id,omitempty"`
IPCChannelID string `json:"ipc_channel_id,omitempty"`
ConnectionNonce string `json:"connection_nonce,omitempty"`
Revoked bool `json:"revoked,omitempty"`
Metadata map[string]string `json:"metadata,omitempty"`
}
type RuntimeLeaseSigningKeyLookupRequest ¶
type RuntimeLeaseSigningKeyLookupRequest struct {
KeyID string `json:"key_id"`
RuntimeShardID string `json:"runtime_shard_id,omitempty"`
RuntimeInstanceID string `json:"runtime_instance_id,omitempty"`
RuntimeGenerationID string `json:"runtime_generation_id"`
IPCChannelID string `json:"ipc_channel_id,omitempty"`
ConnectionNonce string `json:"connection_nonce,omitempty"`
PluginInstanceID string `json:"plugin_instance_id,omitempty"`
Method string `json:"method,omitempty"`
}
type RuntimeLeaseSigningKeyring ¶
type RuntimeLeaseSigningKeyring interface {
LookupRuntimeLeaseSigningKey(ctx context.Context, req RuntimeLeaseSigningKeyLookupRequest) (RuntimeLeaseSigningKey, error)
}
type RuntimeLeaseVerifier ¶
type RuntimeLeaseVerifier interface {
VerifyRuntimeLease(ctx context.Context, req RuntimeLeaseVerificationRequest) error
}
type RuntimeStreamSink ¶ added in v0.3.0
type SQLiteRuntimeLeaseReplayStore ¶
type SQLiteRuntimeLeaseReplayStore struct {
// contains filtered or unexported fields
}
func NewSQLiteRuntimeLeaseReplayStore ¶
func NewSQLiteRuntimeLeaseReplayStore(ctx context.Context, path string) (*SQLiteRuntimeLeaseReplayStore, error)
func (*SQLiteRuntimeLeaseReplayStore) Close ¶
func (s *SQLiteRuntimeLeaseReplayStore) Close() error
func (*SQLiteRuntimeLeaseReplayStore) ConsumeRuntimeLease ¶
func (s *SQLiteRuntimeLeaseReplayStore) ConsumeRuntimeLease(ctx context.Context, req RuntimeLeaseReplayConsumeRequest) (RuntimeLeaseReplayRecord, error)
func (*SQLiteRuntimeLeaseReplayStore) ListRuntimeLeaseReplays ¶
func (s *SQLiteRuntimeLeaseReplayStore) ListRuntimeLeaseReplays(ctx context.Context, req RuntimeLeaseReplayListRequest) ([]RuntimeLeaseReplayRecord, error)
type StaticRuntimeLeaseSigningKeyring ¶
type StaticRuntimeLeaseSigningKeyring struct {
Keys []RuntimeLeaseSigningKey
}
func (StaticRuntimeLeaseSigningKeyring) LookupRuntimeLeaseSigningKey ¶
func (k StaticRuntimeLeaseSigningKeyring) LookupRuntimeLeaseSigningKey(ctx context.Context, req RuntimeLeaseSigningKeyLookupRequest) (RuntimeLeaseSigningKey, error)
type Supervisor ¶
type Supervisor interface {
Start(ctx context.Context, target Target) error
Stop(ctx context.Context) error
Health(ctx context.Context) (Health, error)
Heartbeat(ctx context.Context) (HeartbeatResult, error)
InvokeWorker(ctx context.Context, lease Lease, method string, payload []byte) ([]byte, error)
Revoke(ctx context.Context, pluginInstanceID string, revokeEpoch uint64) (RevokeResult, error)
}
type WorkerErrorOrigin ¶ added in v0.4.0
type WorkerErrorOrigin string
const ( WorkerErrorOriginRuntime WorkerErrorOrigin = "runtime" WorkerErrorOriginHostcall WorkerErrorOrigin = "hostcall" WorkerErrorOriginPlugin WorkerErrorOrigin = "plugin" )
type WorkerExecutionError ¶ added in v0.4.0
type WorkerExecutionError struct {
Code string
Message string
Origin WorkerErrorOrigin
}
func (*WorkerExecutionError) Error ¶ added in v0.4.0
func (e *WorkerExecutionError) Error() string
func (*WorkerExecutionError) Unwrap ¶ added in v0.4.0
func (e *WorkerExecutionError) Unwrap() error
Click to show internal directories.
Click to hide internal directories.