app

package
v0.1.32 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2026 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnauthenticated = errors.New("authentication failed")
	ErrDenied          = errors.New("authorization denied")
	ErrAmbiguous       = errors.New("authorization is ambiguous")
	ErrExpired         = errors.New("authority expired")
	ErrConflict        = errors.New("state conflict")
)

Functions

This section is empty.

Types

type AuditAuthority

type AuditAuthority interface {
	AppendAudit(context.Context, core.AuditEvent) error
	AuditEvents() ([]core.AuditEvent, error)
	VerifyAudit() error
}

AuditAuthority is the narrow append and verification boundary that hardened deployments can place behind a separately supervised process or OS account. Hermes runtimes never receive this authority.

type Service

type Service struct {
	Config    config.Config
	Store     *store.Store
	Audit     AuditAuthority
	Hermes    *hermes.Adapter
	Log       *slog.Logger
	Now       func() time.Time
	Current   func() (*user.User, error)
	LookupEnv func(string) (string, bool)

	CredentialAuthority *credentials.Authority
	// contains filtered or unexported fields
}

func New

func New(cfg config.Config, st *store.Store, h *hermes.Adapter, log *slog.Logger) *Service

func (*Service) Apply

func (s *Service) Apply(ctx context.Context, planID, approvalID string) (core.Receipt, error)

func (*Service) ApplyAs

func (s *Service) ApplyAs(ctx context.Context, sub core.Subject, planID, approvalID string) (core.Receipt, error)

func (*Service) AuditCredentialOperation

func (s *Service) AuditCredentialOperation(ctx context.Context, subject core.Subject, eventType, outcome, reason, recordID string) error

AuditCredentialOperation records metadata-only administrative credential events. Credential values, references, destinations, and key material are intentionally excluded from this boundary.

func (*Service) AuditEvents

func (s *Service) AuditEvents(ctx context.Context) ([]core.AuditEvent, error)

func (*Service) AuditEventsAs

func (s *Service) AuditEventsAs(subject core.Subject) ([]core.AuditEvent, error)

func (*Service) AuditManagerCertification added in v0.1.11

func (s *Service) AuditManagerCertification(ctx context.Context, subject core.Subject, outcome, reason string, metadata map[string]string) error

AuditManagerCertification records metadata-only certification attempts. It never accepts prompts, responses, credential material, or model output.

func (*Service) AuditManagerCommand added in v0.1.19

func (s *Service) AuditManagerCommand(ctx context.Context, subject core.Subject, operation, outcome, reason, operationID, scopeDigest string) error

AuditManagerCommand records only canonical registry metadata. Command text, arguments, protected values, evidence, and rendered output are excluded.

func (*Service) AuditManagerOnboarding added in v0.1.11

func (s *Service) AuditManagerOnboarding(ctx context.Context, subject core.Subject, action, outcome, reason string, metadata map[string]string) error

AuditManagerOnboarding records metadata-only acquisition and binding events.

func (*Service) AuditManagerSession added in v0.1.4

func (s *Service) AuditManagerSession(ctx context.Context, subject core.Subject, outcome, reason string, metadata map[string]string) error

AuditManagerSession appends one metadata-only manager lifecycle event.

func (*Service) AuditManagerStartup added in v0.1.9

func (s *Service) AuditManagerStartup(ctx context.Context, subject core.Subject, outcome, reason string, metadata map[string]string) error

AuditManagerStartup appends one metadata-only preflight result while preserving the exact readiness reason selected outside the model.

func (*Service) Authenticate

func (s *Service) Authenticate(ctx context.Context) (core.Subject, error)

Authenticate uses only the kernel-backed process account mapping. No prompt, display name, requested stanza, or CLI authority flag is accepted as evidence.

func (*Service) AuthenticateUnixPeer

func (s *Service) AuthenticateUnixPeer(ctx context.Context, uid uint32) (core.Subject, error)

AuthenticateUnixPeer maps kernel-supplied Unix-socket peer credentials. The UID comes from SO_PEERCRED, never an HTTP field or bearer-token label.

func (*Service) DecideApproval

func (s *Service) DecideApproval(ctx context.Context, id string, approve bool) (core.Approval, error)

func (*Service) DecideApprovalAs

func (s *Service) DecideApprovalAs(ctx context.Context, sub core.Subject, id string, approve bool) (core.Approval, error)

func (*Service) DesignSmoke

func (s *Service) DesignSmoke(ctx context.Context, requirements []byte) (core.CanonicalCharter, error)

DesignSmoke drives Hermes's documented TUI-gateway stdio protocol in a disposable home. Hermes returns proposal bytes; only Aegis can validate, canonicalize, digest, and persist them.

func (*Service) DesignSmokeAs

func (s *Service) DesignSmokeAs(ctx context.Context, sub core.Subject, requirements []byte) (core.CanonicalCharter, error)

func (*Service) EffectiveAuthority

func (s *Service) EffectiveAuthority(ctx context.Context, agent string, rev uint64, requested string, env core.Environment) (string, core.EffectiveAuthority, core.Decision, error)

func (*Service) EffectiveAuthorityAs

func (s *Service) EffectiveAuthorityAs(subject core.Subject, agent string, rev uint64, requested string, env core.Environment) (string, core.EffectiveAuthority, core.Decision, error)

func (*Service) ExecuteBroker

func (s *Service) ExecuteBroker(ctx context.Context, peer broker.Peer, request broker.Request, execute broker.Executor) (broker.Result, error)

func (*Service) Explain

func (s *Service) Explain(ctx context.Context, agent string, rev uint64, requested string, env core.Environment) (core.Decision, error)

func (*Service) ExplainAs

func (s *Service) ExplainAs(ctx context.Context, sub core.Subject, agent string, rev uint64, requested string, env core.Environment) (core.Decision, error)

func (*Service) GetApproval

func (s *Service) GetApproval(id string) (core.Approval, error)

func (*Service) GetCharter

func (s *Service) GetCharter(agent string, rev uint64) (core.CanonicalCharter, error)

func (*Service) GetMandate

func (s *Service) GetMandate(id string) (core.Mandate, error)

func (*Service) GetPlan

func (s *Service) GetPlan(id string) (core.Plan, error)

func (*Service) GetReceipt

func (s *Service) GetReceipt(id string) (core.Receipt, error)

func (*Service) GetSession

func (s *Service) GetSession(id string) (core.Session, error)

func (*Service) ImportCharter

func (s *Service) ImportCharter(ctx context.Context, data []byte) (core.CanonicalCharter, error)

func (*Service) ImportCharterAs

func (s *Service) ImportCharterAs(ctx context.Context, sub core.Subject, data []byte) (core.CanonicalCharter, error)

func (*Service) InspectSession

func (s *Service) InspectSession(id string) (core.Session, bool, error)

func (*Service) ListAgents

func (s *Service) ListAgents() ([]string, error)

func (*Service) ListApprovals

func (s *Service) ListApprovals() ([]core.Approval, error)

func (*Service) ListCharters

func (s *Service) ListCharters(agent string) ([]core.CanonicalCharter, error)

func (*Service) ListPlans

func (s *Service) ListPlans() ([]core.Plan, error)

func (*Service) ListReceipts

func (s *Service) ListReceipts() ([]core.Receipt, error)

func (*Service) ListSessions

func (s *Service) ListSessions() ([]core.Session, error)

func (*Service) PreviewPlan

func (s *Service) PreviewPlan(ctx context.Context, agent string, rev uint64, env core.Environment) (core.Review, error)

func (*Service) PreviewSession

func (s *Service) PreviewSession(ctx context.Context, agent string, rev uint64, requested string, env core.Environment) (core.Mandate, core.Decision, error)

func (*Service) PreviewSessionAs

func (s *Service) PreviewSessionAs(ctx context.Context, sub core.Subject, agent string, rev uint64, requested string, env core.Environment) (core.Mandate, core.Decision, error)

func (*Service) RecoverProvisioning

func (s *Service) RecoverProvisioning(ctx context.Context) error

RecoverProvisioning converts durable in-progress intents left by an interrupted process into failed receipts and removes only matching Aegis-owned artifacts from their approved plan.

func (*Service) RequestApproval

func (s *Service) RequestApproval(ctx context.Context, planID string, ttl time.Duration) (core.Approval, error)

func (*Service) RequestApprovalAs

func (s *Service) RequestApprovalAs(ctx context.Context, sub core.Subject, planID string, ttl time.Duration) (core.Approval, error)

func (*Service) RevokeSession

func (s *Service) RevokeSession(ctx context.Context, id, reason string) error

func (*Service) RevokeSessionAs

func (s *Service) RevokeSessionAs(ctx context.Context, sub core.Subject, id, reason string) error

func (*Service) Runtime

func (s *Service) Runtime(ctx context.Context) (core.RuntimeDescriptor, error)

func (*Service) Select

func (s *Service) Select(c core.CanonicalCharter, sub core.Subject, requested string, env core.Environment) (core.Decision, error)

func (*Service) StartSession

func (s *Service) StartSession(ctx context.Context, mandateID string) (core.Session, error)

func (*Service) StartSessionAs

func (s *Service) StartSessionAs(ctx context.Context, sub core.Subject, mandateID string) (core.Session, error)

func (*Service) Supervise

func (s *Service) Supervise(ctx context.Context) error

Supervise reconciles durable running sessions, schedules expiry, and owns shutdown cleanup while the foreground control plane is alive.

func (*Service) TerminateSession

func (s *Service) TerminateSession(ctx context.Context, id, reason string) error

func (*Service) TerminateSessionAs

func (s *Service) TerminateSessionAs(ctx context.Context, sub core.Subject, id, reason string) error

func (*Service) ValidateCharter

func (s *Service) ValidateCharter(ctx context.Context, data []byte) (core.CanonicalCharter, error)

func (*Service) ValidateCharterAs

func (s *Service) ValidateCharterAs(ctx context.Context, subject core.Subject, data []byte) (core.CanonicalCharter, error)

func (*Service) VerifyAudit

func (s *Service) VerifyAudit(ctx context.Context) error

func (*Service) VerifyAuditAs

func (s *Service) VerifyAuditAs(subject core.Subject) error

Jump to

Keyboard shortcuts

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