domain

package
v1.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 25, 2024 License: AGPL-3.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Module = fx.Module(
	"domain",
	fx.Provide(fxDomain),
)

Functions

This section is empty.

Types

type Domain

type Domain interface {
	SetRemoteLoginAuthHeader(ctx context.Context, loginId repos.ID, authHeader string) error
	GetRemoteLogin(ctx context.Context, loginId repos.ID, secret string) (*entities.RemoteLogin, error)
	CreateRemoteLogin(ctx context.Context, secret string) (repos.ID, error)

	Login(ctx context.Context, email string, password string) (*common.AuthSession, error)
	SignUp(ctx context.Context, name string, email string, password string, captchaToken string) (*common.AuthSession, error)
	EnsureUserByEmail(ctx context.Context, email string) (*entities.User, error)
	GetUserById(ctx context.Context, id repos.ID) (*entities.User, error)
	GetUserByEmail(ctx context.Context, email string) (*entities.User, error)
	SetUserMetadata(ctx context.Context, userId repos.ID, metadata entities.UserMetadata) (*entities.User, error)
	ClearUserMetadata(ctx context.Context, id repos.ID) (*entities.User, error)
	VerifyEmail(ctx context.Context, token string) (*common.AuthSession, error)
	ResetPassword(ctx context.Context, token string, password string) (bool, error)
	RequestResetPassword(ctx context.Context, email string, captchaToken string) (bool, error)
	ChangeEmail(ctx context.Context, id repos.ID, email string) (bool, error)
	ResendVerificationEmail(ctx context.Context, userId repos.ID) (bool, error)
	ChangePassword(ctx context.Context, id repos.ID, currentPassword string, newPassword string) (bool, error)
	GetAccessToken(ctx context.Context, provider string, userId string, tokenId string) (*entities.AccessToken, error)
	GetLoginDetails(ctx context.Context, provider string, state *string) (string, error)
	InviteUser(ctx context.Context, email string, name string) (repos.ID, error)
	OauthRequestLogin(ctx context.Context, provider string, state string) (string, error)
	OauthLogin(ctx context.Context, provider string, state string, code string) (*common.AuthSession, error)
	OauthAddLogin(ctx context.Context, userId repos.ID, provider string, state string, code string) (bool, error)

	CreateInviteCode(ctx context.Context, name string, inviteCode string) (*entities.InviteCode, error)
	DeleteInviteCode(ctx context.Context, invCodeId string) error

	VerifyInviteCode(ctx context.Context, userId repos.ID, invitationCode string) (bool, error)
}

type Github

type Github interface {
	Authorize(ctx context.Context, state string) (string, error)
	Callback(ctx context.Context, code, state string) (*github.User, *oauth2.Token, error)
	GetOAuthToken(ctx context.Context, token *oauth2.Token) (*oauth2.Token, error)
	GetPrimaryEmail(ctx context.Context, token *oauth2.Token) (string, error)
}

type Gitlab

type Gitlab interface {
	Authorize(ctx context.Context, state string) (string, error)
	Callback(ctx context.Context, code, state string) (*gitlab.User, *oauth2.Token, error)
	GetOAuthToken(ctx context.Context, token *oauth2.Token) (*oauth2.Token, error)
}

type Google

type Google interface {
	Authorize(ctx context.Context, state string) (string, error)
	Callback(ctx context.Context, code, state string) (*GoogleUser, *oauth2.Token, error)
}

type GoogleUser

type GoogleUser struct {
	Email     string  `json:"email"`
	AvatarURL *string `json:"picture"`
	Name      string  `json:"name"`
}

google oauth user struct

type Messenger

type Messenger interface {
	SendEmail(ctx context.Context, template string, payload map[string]any) error
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL