Versions in this module Expand all Collapse all v0 v0.2.0 Jun 28, 2026 v0.1.0 Jun 27, 2026 Changes in this version + var ErrAlreadyExists = errors.New("already exists") + var ErrInvalidInput = errors.New("invalid input") + var ErrNotFound = errors.New("not found") + func JoinScopes(scopes []string) string + func SplitScopes(scopes string) []string + type Agent struct + CreatedAt time.Time + Description string + ID string + Name string + PublicKey string + RedirectURI string + Trusted bool + UpdatedAt time.Time + type AuthzServerAdapter struct + func NewAuthzServerAdapter(store Storer) *AuthzServerAdapter + func (a *AuthzServerAdapter) Close() error + func (a *AuthzServerAdapter) CreateScopePolicy(ctx context.Context, policy *authzserver.ScopePolicy) error + func (a *AuthzServerAdapter) CreateToken(ctx context.Context, token *authzserver.Token) error + func (a *AuthzServerAdapter) DeleteScopePolicy(ctx context.Context, id string) error + func (a *AuthzServerAdapter) GetScopePolicy(ctx context.Context, id string) (*authzserver.ScopePolicy, error) + func (a *AuthzServerAdapter) GetToken(ctx context.Context, id string) (*authzserver.Token, error) + func (a *AuthzServerAdapter) ListScopePolicies(ctx context.Context) ([]*authzserver.ScopePolicy, error) + func (a *AuthzServerAdapter) ListTokens(ctx context.Context) ([]*authzserver.Token, error) + func (a *AuthzServerAdapter) RevokeToken(ctx context.Context, id string) error + type Mission struct + AgentID string + ApprovedAt *time.Time + CreatedAt time.Time + DenialReason string + DeniedAt *time.Time + Description string + Duration int64 + ExpiresAt *time.Time + ID string + InteractionType string + Name string + Scopes string + Status MissionStatus + UpdatedAt time.Time + UserID string + func (m *Mission) IsActive() bool + type MissionStatus string + const MissionStatusApproved + const MissionStatusDenied + const MissionStatusExpired + const MissionStatusPending + const MissionStatusRevoked + type PersonServerAdapter struct + func NewPersonServerAdapter(store Storer) *PersonServerAdapter + func (a *PersonServerAdapter) ApproveMission(ctx context.Context, id string, duration time.Duration) error + func (a *PersonServerAdapter) Close() error + func (a *PersonServerAdapter) CreateAgent(ctx context.Context, agent *personserver.Agent) error + func (a *PersonServerAdapter) CreateMission(ctx context.Context, mission *personserver.Mission) error + func (a *PersonServerAdapter) CreateToken(ctx context.Context, token *personserver.Token) error + func (a *PersonServerAdapter) CreateUser(ctx context.Context, user *personserver.User) error + func (a *PersonServerAdapter) DenyMission(ctx context.Context, id, reason string) error + func (a *PersonServerAdapter) GetAgent(ctx context.Context, id string) (*personserver.Agent, error) + func (a *PersonServerAdapter) GetMission(ctx context.Context, id string) (*personserver.Mission, error) + func (a *PersonServerAdapter) GetToken(ctx context.Context, id string) (*personserver.Token, error) + func (a *PersonServerAdapter) GetUser(ctx context.Context, id string) (*personserver.User, error) + func (a *PersonServerAdapter) GetUserByEmail(ctx context.Context, email string) (*personserver.User, error) + func (a *PersonServerAdapter) ListAgents(ctx context.Context) ([]*personserver.Agent, error) + func (a *PersonServerAdapter) ListMissionsByUser(ctx context.Context, userID string) ([]*personserver.Mission, error) + func (a *PersonServerAdapter) ListPendingMissions(ctx context.Context) ([]*personserver.Mission, error) + func (a *PersonServerAdapter) ListUsers(ctx context.Context) ([]*personserver.User, error) + func (a *PersonServerAdapter) RevokeToken(ctx context.Context, id string) error + type PreAuthorization struct + AgentID string + CreatedAt time.Time + ExpiresAt *time.Time + ID string + Scopes string + UserID string + func (p *PreAuthorization) Covers(requestedScopes []string) bool + type SQLiteStore struct + func NewSQLite(dbPath string) (*SQLiteStore, error) + func (s *SQLiteStore) ApproveMission(ctx context.Context, id string, duration time.Duration) error + func (s *SQLiteStore) Close() error + func (s *SQLiteStore) CreateAgent(ctx context.Context, agent *Agent) error + func (s *SQLiteStore) CreateMission(ctx context.Context, mission *Mission) error + func (s *SQLiteStore) CreatePreAuthorization(ctx context.Context, preAuth *PreAuthorization) error + func (s *SQLiteStore) CreateScopePolicy(ctx context.Context, policy *ScopePolicy) error + func (s *SQLiteStore) CreateToken(ctx context.Context, token *Token) error + func (s *SQLiteStore) CreateUser(ctx context.Context, user *User) error + func (s *SQLiteStore) DB() *sql.DB + func (s *SQLiteStore) DeletePreAuthorization(ctx context.Context, userID, agentID string) error + func (s *SQLiteStore) DeleteScopePolicy(ctx context.Context, id string) error + func (s *SQLiteStore) DenyMission(ctx context.Context, id, reason string) error + func (s *SQLiteStore) GetAgent(ctx context.Context, id string) (*Agent, error) + func (s *SQLiteStore) GetMission(ctx context.Context, id string) (*Mission, error) + func (s *SQLiteStore) GetPreAuthorization(ctx context.Context, userID, agentID string) (*PreAuthorization, error) + func (s *SQLiteStore) GetScopePolicy(ctx context.Context, id string) (*ScopePolicy, error) + func (s *SQLiteStore) GetToken(ctx context.Context, id string) (*Token, error) + func (s *SQLiteStore) GetUser(ctx context.Context, id string) (*User, error) + func (s *SQLiteStore) GetUserByEmail(ctx context.Context, email string) (*User, error) + func (s *SQLiteStore) ListAgents(ctx context.Context) ([]*Agent, error) + func (s *SQLiteStore) ListMissionsByUser(ctx context.Context, userID string) ([]*Mission, error) + func (s *SQLiteStore) ListPendingMissions(ctx context.Context) ([]*Mission, error) + func (s *SQLiteStore) ListScopePolicies(ctx context.Context) ([]*ScopePolicy, error) + func (s *SQLiteStore) ListTokens(ctx context.Context) ([]*Token, error) + func (s *SQLiteStore) ListUsers(ctx context.Context) ([]*User, error) + func (s *SQLiteStore) RevokeToken(ctx context.Context, id string) error + type ScopePolicy struct + CreatedAt time.Time + Description string + ID string + InteractionType string + Pattern string + Priority int + Protocol string + type Storer interface + ApproveMission func(ctx context.Context, id string, duration time.Duration) error + Close func() error + CreateAgent func(ctx context.Context, agent *Agent) error + CreateMission func(ctx context.Context, mission *Mission) error + CreatePreAuthorization func(ctx context.Context, preAuth *PreAuthorization) error + CreateScopePolicy func(ctx context.Context, policy *ScopePolicy) error + CreateToken func(ctx context.Context, token *Token) error + CreateUser func(ctx context.Context, user *User) error + DeletePreAuthorization func(ctx context.Context, userID, agentID string) error + DeleteScopePolicy func(ctx context.Context, id string) error + DenyMission func(ctx context.Context, id, reason string) error + GetAgent func(ctx context.Context, id string) (*Agent, error) + GetMission func(ctx context.Context, id string) (*Mission, error) + GetPreAuthorization func(ctx context.Context, userID, agentID string) (*PreAuthorization, error) + GetScopePolicy func(ctx context.Context, id string) (*ScopePolicy, error) + GetToken func(ctx context.Context, id string) (*Token, error) + GetUser func(ctx context.Context, id string) (*User, error) + GetUserByEmail func(ctx context.Context, email string) (*User, error) + ListAgents func(ctx context.Context) ([]*Agent, error) + ListMissionsByUser func(ctx context.Context, userID string) ([]*Mission, error) + ListPendingMissions func(ctx context.Context) ([]*Mission, error) + ListScopePolicies func(ctx context.Context) ([]*ScopePolicy, error) + ListTokens func(ctx context.Context) ([]*Token, error) + ListUsers func(ctx context.Context) ([]*User, error) + RevokeToken func(ctx context.Context, id string) error + type Token struct + AgentID string + ExpiresAt time.Time + ID string + IssuedAt time.Time + MissionID string + Protocol string + RevokedAt *time.Time + Scopes string + TokenType string + UserID string + func (t *Token) IsValid() bool + type User struct + CreatedAt time.Time + Email string + ID string + Name string + UpdatedAt time.Time