Versions in this module Expand all Collapse all v0 v0.3.0 Aug 26, 2026 Changes in this version + var ErrEmailMismatch = errors.New("authit/team: invitation email does not match") + var ErrInvitationInvalid = errors.New("authit/team: invitation invalid, expired, or already used") + var ErrLastOwner = errors.New("authit/team: team must have at least one owner") + var ErrMemberNotFound = errors.New("authit/team: member not found") + var ErrMembershipRejected = errors.New("authit/team: membership rejected") + var ErrNotOwner = errors.New("authit/team: caller is not an owner") + var ErrSlugTaken = errors.New("authit/team: slug already in use") + type Admission interface + AdmitMember func(ctx context.Context, teamID string, currentCount int) error + type Config struct + AuditLogger audit.Logger + InvitationTTL time.Duration + type NopAdmission struct + func (NopAdmission) AdmitMember(context.Context, string, int) error + type Service struct + func NewService(stores Stores, admission Admission, cfg Config) (*Service, error) + func (s *Service) AcceptInvitation(ctx context.Context, rawToken, userID, email, displayName string) (store.Member, error) + func (s *Service) CreateInvitation(ctx context.Context, teamID, invitedByMemberID, email string, role store.Role) (string, store.Invitation, error) + func (s *Service) CreateTeam(ctx context.Context, ...) (store.Team, error) + func (s *Service) GetInvitationByToken(ctx context.Context, rawToken string) (store.Invitation, error) + func (s *Service) GetMember(ctx context.Context, id string) (store.Member, error) + func (s *Service) GetMemberByUserAndTeam(ctx context.Context, userID, teamID string) (store.Member, error) + func (s *Service) GetTeam(ctx context.Context, id string) (store.Team, error) + func (s *Service) GetTeamBySlug(ctx context.Context, slug string) (store.Team, error) + func (s *Service) ListInvitationsByTeam(ctx context.Context, teamID string) ([]store.Invitation, error) + func (s *Service) ListMembersByTeam(ctx context.Context, teamID string) ([]store.Member, error) + func (s *Service) ListMembershipsByUser(ctx context.Context, userID string) ([]store.Member, error) + func (s *Service) RemoveMember(ctx context.Context, memberID string) error + func (s *Service) RevokeInvitation(ctx context.Context, invitationID string) error + func (s *Service) SetMemberActive(ctx context.Context, memberID string, active bool) error + func (s *Service) UpdateMemberRole(ctx context.Context, memberID string, role store.Role) error + type Stores struct + Invitations store.InvitationStore + Members store.MemberStore + Teams store.TeamStore v0.2.0 Aug 25, 2026