Versions in this module Expand all Collapse all v0 v0.2.0 Mar 8, 2026 v0.1.0 Feb 28, 2026 Changes in this version + var ErrIncompatibleVersion = errors.New("incompatible argon2 version") + var ErrInvalidHash = errors.New("invalid hash format") + func HashPassword(password string, params *Argon2idParams) (string, error) + func NeedsRehash(encodedHash string, params *Argon2idParams) (bool, error) + func VerifyPassword(password, encodedHash string) (bool, error) + type Argon2idParams struct + Iterations uint32 + KeyLength uint32 + Memory uint32 + Parallelism uint8 + SaltLength uint32 + func DefaultArgon2idParams() *Argon2idParams + type CreateMembershipInput struct + OrganizationID uuid.UUID + Permissions []string + Role string + UserID uuid.UUID + type CreateOAuthAccountInput struct + AccessToken *string + Provider string + ProviderUserID string + RefreshToken *string + UserID uuid.UUID + type CreateOrganizationInput struct + LogoURL *string + Name string + Plan string + Settings map[string]any + Slug string + type CreateUserInput struct + AvatarURL *string + Email string + IsPlatformAdmin bool + Name string + Password *string + type MembershipInfo struct + ID uuid.UUID + OrganizationID uuid.UUID + Permissions []string + Role string + UserID uuid.UUID + type MembershipService interface + Create func(ctx context.Context, input CreateMembershipInput) (*MembershipInfo, error) + Delete func(ctx context.Context, id uuid.UUID) error + GetByID func(ctx context.Context, id uuid.UUID) (*MembershipInfo, error) + GetByUserAndOrg func(ctx context.Context, userID, orgID uuid.UUID) (*MembershipInfo, error) + HasAnyRole func(ctx context.Context, userID, orgID uuid.UUID, roles []string) (bool, error) + HasRole func(ctx context.Context, userID, orgID uuid.UUID, role string) (bool, error) + ListForOrg func(ctx context.Context, orgID uuid.UUID) ([]*MembershipInfo, error) + ListForUser func(ctx context.Context, userID uuid.UUID) ([]*MembershipInfo, error) + Update func(ctx context.Context, id uuid.UUID, input UpdateMembershipInput) (*MembershipInfo, error) + type OAuthAccountInfo struct + ID uuid.UUID + Provider string + ProviderUserID string + UserID uuid.UUID + type OAuthService interface + Create func(ctx context.Context, input CreateOAuthAccountInput) (*OAuthAccountInfo, error) + Delete func(ctx context.Context, id uuid.UUID) error + GetByProviderUser func(ctx context.Context, provider, providerUserID string) (*OAuthAccountInfo, error) + ListForUser func(ctx context.Context, userID uuid.UUID) ([]*OAuthAccountInfo, error) + type OrganizationInfo struct + Active bool + ID uuid.UUID + LogoURL *string + Name string + Plan string + Settings map[string]any + Slug string + type OrganizationService interface + Create func(ctx context.Context, input CreateOrganizationInput) (*OrganizationInfo, error) + Delete func(ctx context.Context, id uuid.UUID) error + GetByID func(ctx context.Context, id uuid.UUID) (*OrganizationInfo, error) + GetBySlug func(ctx context.Context, slug string) (*OrganizationInfo, error) + ListForUser func(ctx context.Context, userID uuid.UUID) ([]*OrganizationInfo, error) + Update func(ctx context.Context, id uuid.UUID, input UpdateOrganizationInput) (*OrganizationInfo, error) + type UpdateMembershipInput struct + Permissions []string + Role *string + type UpdateOrganizationInput struct + Active *bool + LogoURL *string + Name *string + Plan *string + Settings map[string]any + Slug *string + type UpdateUserInput struct + Active *bool + AvatarURL *string + Email *string + IsPlatformAdmin *bool + Name *string + type UserInfo struct + Active bool + AvatarURL *string + Email string + ID uuid.UUID + IsPlatformAdmin bool + Name string + type UserService interface + Create func(ctx context.Context, input CreateUserInput) (*UserInfo, error) + Delete func(ctx context.Context, id uuid.UUID) error + GetByEmail func(ctx context.Context, email string) (*UserInfo, error) + GetByID func(ctx context.Context, id uuid.UUID) (*UserInfo, error) + SetPassword func(ctx context.Context, id uuid.UUID, password string) error + Update func(ctx context.Context, id uuid.UUID, input UpdateUserInput) (*UserInfo, error) + UpdateLastLogin func(ctx context.Context, id uuid.UUID) error + VerifyPassword func(ctx context.Context, id uuid.UUID, password string) (bool, error)