Documentation
¶
Overview ¶
Package auth is Skiff's accounts + teams layer: users authenticate, belong to teams, and everything else (projects, env, deploys) is scoped to a team. It's a self-hosted, single-instance model — teams organize collaborators on your own box, not a central SaaS. Backed by SQLite.
Index ¶
- Constants
- type Invite
- type Member
- type Store
- func (s *Store) AcceptInvite(token, userID string) (Team, error)
- func (s *Store) Authenticate(email, password string) (User, bool)
- func (s *Store) ChangePassword(userID, current, next string) error
- func (s *Store) CreateInvite(email, teamID, role string) (Invite, error)
- func (s *Store) CreateTeam(name, ownerID string) (Team, error)
- func (s *Store) CreateUser(email, name, password string) (User, Team, error)
- func (s *Store) CreateUserNoTeam(email, name, password string) (User, error)
- func (s *Store) DeleteTeam(teamID string) error
- func (s *Store) DeleteUser(userID string) error
- func (s *Store) HasUsers() bool
- func (s *Store) Invite(token string) (Invite, bool)
- func (s *Store) LeaveTeam(userID, teamID string) error
- func (s *Store) Members(teamID string) []Member
- func (s *Store) RemoveMember(teamID, userID string) error
- func (s *Store) RenameTeam(teamID, name string) error
- func (s *Store) Role(userID, teamID string) (string, bool)
- func (s *Store) TeamsForUser(userID string) []Team
- func (s *Store) UpdateName(userID, name string) error
- func (s *Store) User(userID string) (User, bool)
- func (s *Store) UserByEmail(email string) (User, bool)
- type Team
- type User
Constants ¶
const ( RoleOwner = "owner" RoleMember = "member" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (*Store) ChangePassword ¶
ChangePassword verifies the current password, then sets a new one.
func (*Store) CreateInvite ¶
func (*Store) CreateUser ¶
CreateUser adds a user with a bcrypt-hashed password and a personal team.
func (*Store) CreateUserNoTeam ¶
CreateUserNoTeam adds a user with no personal team — used when accepting an invite, where the user joins the inviter's team rather than getting one of their own.
func (*Store) DeleteTeam ¶
DeleteTeam removes a team along with its memberships and pending invites. Callers must first ensure the team owns no apps or databases.
func (*Store) DeleteUser ¶
DeleteUser removes a user and all their team memberships. Callers must first deal with any teams the user solely owns.
func (*Store) LeaveTeam ¶
LeaveTeam drops the caller's own membership, refusing if they're the last owner.
func (*Store) RemoveMember ¶
RemoveMember drops a user from a team, refusing to remove the last owner.
func (*Store) RenameTeam ¶
RenameTeam changes a team's name (and slug).
func (*Store) TeamsForUser ¶
func (*Store) UpdateName ¶
UpdateName changes a user's display name.