Documentation
¶
Overview ¶
Package marble provides attestation utilities for TEE services.
Package marble provides the core Marble SDK for MarbleRun integration. Each service runs as a Marble inside an EGo SGX enclave.
Package marble provides the service framework for MarbleRun Marbles.
Index ¶
- func ComputeAttestationHash(m *Marble, serviceID string) []byte
- type Config
- type Marble
- func (m *Marble) ExternalHTTPClient() *http.Client
- func (m *Marble) HTTPClient() *http.Client
- func (m *Marble) Initialize(ctx context.Context) error
- func (m *Marble) IsEnclave() bool
- func (m *Marble) MarbleType() string
- func (m *Marble) Report() *attestation.Report
- func (m *Marble) Secret(name string) ([]byte, bool)
- func (m *Marble) SetTestReport(report *attestation.Report)
- func (m *Marble) SetTestSecret(name string, value []byte)
- func (m *Marble) TLSConfig() *tls.Config
- func (m *Marble) UUID() string
- func (m *Marble) UseSecret(name string, fn func([]byte) error) error
- type Service
- func (s *Service) DB() database.RepositoryInterface
- func (s *Service) ID() string
- func (s *Service) IsRunning() bool
- func (s *Service) Marble() *Marble
- func (s *Service) Name() string
- func (s *Service) Router() *mux.Router
- func (s *Service) Start(ctx context.Context) error
- func (s *Service) Stop() error
- func (s *Service) Version() string
- type ServiceConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ComputeAttestationHash ¶
ComputeAttestationHash computes a SHA-256 hash for attestation purposes. It tries multiple sources in order: report, MARBLE_CERT, marble type/UUID. The serviceID is used as a fallback identifier when no other source is available.
Types ¶
type Marble ¶
type Marble struct {
// contains filtered or unexported fields
}
Marble represents a MarbleRun Marble instance. It handles attestation, secrets injection, and secure communication.
func (*Marble) ExternalHTTPClient ¶
ExternalHTTPClient returns an HTTP client suitable for outbound calls to non-Marblerun endpoints (Supabase, Neo RPC, third-party APIs).
It never installs the MarbleRun root CA or client certificate, ensuring the connection uses the system trust store and does not attempt mTLS.
func (*Marble) HTTPClient ¶
HTTPClient returns an HTTP client configured for mTLS.
func (*Marble) Initialize ¶
Initialize performs Marble initialization with the Coordinator. This is called automatically by MarbleRun before the application starts.
func (*Marble) MarbleType ¶
MarbleType returns the Marble type.
func (*Marble) Report ¶
func (m *Marble) Report() *attestation.Report
Report returns the enclave self-report.
func (*Marble) SetTestReport ¶
func (m *Marble) SetTestReport(report *attestation.Report)
SetTestReport sets an enclave report for testing purposes only. This method should only be used in tests.
func (*Marble) SetTestSecret ¶
SetTestSecret sets a secret for testing purposes only. This method should only be used in tests.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is a minimal base for Marble-hosted services.
Prefer embedding `infrastructure/service.BaseService` in actual services; it wraps this type and provides lifecycle hooks, workers, and standard routes.
func NewService ¶
func NewService(cfg ServiceConfig) *Service
NewService creates a new base service.
func (*Service) DB ¶
func (s *Service) DB() database.RepositoryInterface
DB returns the database repository.
type ServiceConfig ¶
type ServiceConfig struct {
ID string
Name string
Version string
Marble *Marble
DB database.RepositoryInterface
}
ServiceConfig holds service configuration.