Documentation
¶
Index ¶
- Variables
- func ConfigureDB(db *sql.DB) error
- func OpenDB(dbPath string) (*sql.DB, error)
- type AuthStore
- func (s *AuthStore) AssignAgent(ctx context.Context, userID int64, agentID string) error
- func (s *AuthStore) CountUsers(ctx context.Context) (int64, error)
- func (s *AuthStore) CreateIdentity(ctx context.Context, i auth.Identity) (auth.Identity, error)
- func (s *AuthStore) CreatePolicy(ctx context.Context, p auth.Policy) (auth.Policy, error)
- func (s *AuthStore) CreateSession(ctx context.Context, sess auth.Session) (auth.Session, error)
- func (s *AuthStore) CreateUser(ctx context.Context, username, passwordHash string) (auth.AuthUser, error)
- func (s *AuthStore) CreateUserToken(ctx context.Context, token auth.UserToken) (auth.UserToken, error)
- func (s *AuthStore) DeleteExpiredSessions(ctx context.Context) error
- func (s *AuthStore) DeleteIdentity(ctx context.Context, id int64) error
- func (s *AuthStore) DeletePolicy(ctx context.Context, id string) error
- func (s *AuthStore) DeleteSession(ctx context.Context, id string) error
- func (s *AuthStore) DeleteUser(ctx context.Context, id int64) error
- func (s *AuthStore) DeleteUserSessions(ctx context.Context, userID int64) error
- func (s *AuthStore) GetActiveAutoUserToken(ctx context.Context, userID int64) (auth.UserToken, error)
- func (s *AuthStore) GetActiveUserTokenByHash(ctx context.Context, tokenHash string) (auth.UserToken, error)
- func (s *AuthStore) GetIdentity(ctx context.Context, id int64) (auth.Identity, error)
- func (s *AuthStore) GetIdentityByPlatform(ctx context.Context, platform, externalID string) (auth.Identity, error)
- func (s *AuthStore) GetPolicy(ctx context.Context, id string) (auth.Policy, error)
- func (s *AuthStore) GetSession(ctx context.Context, id string) (auth.Session, error)
- func (s *AuthStore) GetUser(ctx context.Context, id int64) (auth.AuthUser, error)
- func (s *AuthStore) GetUserByUsername(ctx context.Context, username string) (auth.AuthUser, error)
- func (s *AuthStore) GetUserTokenByHash(ctx context.Context, tokenHash string) (auth.UserToken, error)
- func (s *AuthStore) ListAgentUserIDs(ctx context.Context, agentID string) ([]int64, error)
- func (s *AuthStore) ListEnabledPolicies(ctx context.Context) ([]auth.Policy, error)
- func (s *AuthStore) ListIdentitiesByUser(ctx context.Context, userID int64) ([]auth.Identity, error)
- func (s *AuthStore) ListPolicies(ctx context.Context) ([]auth.Policy, error)
- func (s *AuthStore) ListUserAgentIDs(ctx context.Context, userID int64) ([]string, error)
- func (s *AuthStore) ListUsers(ctx context.Context) ([]auth.AuthUser, error)
- func (s *AuthStore) RemoveAgent(ctx context.Context, userID int64, agentID string) error
- func (s *AuthStore) RevokeUserToken(ctx context.Context, id int64) (int64, error)
- func (s *AuthStore) RotateUserToken(ctx context.Context, id int64) (int64, error)
- func (s *AuthStore) UpdateIdentityExternalID(ctx context.Context, id int64, externalID string) error
- func (s *AuthStore) UpdatePolicy(ctx context.Context, p auth.Policy) error
- func (s *AuthStore) UpdateSessionExpiry(ctx context.Context, id string, expiresAt time.Time) error
- func (s *AuthStore) UpdateUser(ctx context.Context, u auth.AuthUser) error
- func (s *AuthStore) UpdateUserAgeKeys(ctx context.Context, userID int64, publicKey, privateKey string) error
- func (s *AuthStore) UpdateUserDefaultAgent(ctx context.Context, userID int64, agentID string) error
- func (s *AuthStore) UpdateUserNotifyIdentity(ctx context.Context, userID int64, identityID *int64) error
- func (s *AuthStore) UpdateUserRole(ctx context.Context, userID int64, role string) error
- func (s *AuthStore) UpdateUserTokenLastUsed(ctx context.Context, id int64) (int64, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var MigrationsFS embed.FS
MigrationsFS holds Atlas migration files. Embed the entire directory so it works even when no migrations exist yet.
Functions ¶
func ConfigureDB ¶
ConfigureDB enables the SQLite connection policy Stella relies on. Connection-level pragmas are safe here because OpenDB constrains each handle to a single long-lived underlying connection.
Types ¶
type AuthStore ¶
type AuthStore struct {
// contains filtered or unexported fields
}
AuthStore implements auth.AuthStore using sqlc queries backed by SQLite.
func NewAuthStore ¶
NewAuthStore creates a new AuthStore wrapping the given database connection.
func (*AuthStore) AssignAgent ¶
func (*AuthStore) CreateIdentity ¶
func (*AuthStore) CreatePolicy ¶
func (*AuthStore) CreateSession ¶
func (*AuthStore) CreateUser ¶
func (*AuthStore) CreateUserToken ¶
func (*AuthStore) DeleteExpiredSessions ¶
func (*AuthStore) DeleteIdentity ¶
func (*AuthStore) DeletePolicy ¶
func (*AuthStore) DeleteSession ¶
func (*AuthStore) DeleteUserSessions ¶
func (*AuthStore) GetActiveAutoUserToken ¶
func (*AuthStore) GetActiveUserTokenByHash ¶
func (*AuthStore) GetIdentity ¶
func (*AuthStore) GetIdentityByPlatform ¶
func (*AuthStore) GetSession ¶
func (*AuthStore) GetUserByUsername ¶
func (*AuthStore) GetUserTokenByHash ¶
func (*AuthStore) ListAgentUserIDs ¶
func (*AuthStore) ListEnabledPolicies ¶
func (*AuthStore) ListIdentitiesByUser ¶
func (*AuthStore) ListPolicies ¶
func (*AuthStore) ListUserAgentIDs ¶
func (*AuthStore) RemoveAgent ¶
func (*AuthStore) RevokeUserToken ¶
func (*AuthStore) RotateUserToken ¶
func (*AuthStore) UpdateIdentityExternalID ¶
func (*AuthStore) UpdatePolicy ¶
func (*AuthStore) UpdateSessionExpiry ¶
func (*AuthStore) UpdateUser ¶
func (*AuthStore) UpdateUserAgeKeys ¶
func (*AuthStore) UpdateUserDefaultAgent ¶
func (*AuthStore) UpdateUserNotifyIdentity ¶
func (*AuthStore) UpdateUserRole ¶
Click to show internal directories.
Click to hide internal directories.