Documentation
¶
Overview ¶
Package auth is Skiff's accounts + teams layer: users belong to teams, and projects/env/deploys are scoped to a team. 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 ¶
func (*Store) CreateInvite ¶
func (*Store) CreateUser ¶
func (*Store) CreateUserNoTeam ¶
CreateUserNoTeam adds a user without a personal team, for the invite flow where they join the inviter's team instead.
func (*Store) DeleteTeam ¶
DeleteTeam removes a team with its memberships and invites; callers must first ensure it owns no apps or databases.
func (*Store) DeleteUser ¶
DeleteUser removes a user and their 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.