handler

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2025 License: MPL-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthHandler

type AuthHandler struct {
	userpb.UnimplementedAuthServiceServer
	// contains filtered or unexported fields
}

func NewAuthHandler

func NewAuthHandler(
	db *gorm.DB,
	rdb redis.UniversalClient,
	sessionService service.SessionService,
	oauthService service.OAuthService,
) *AuthHandler

func (*AuthHandler) GetOAuthCodeURL

GetOAuthCodeURL generates OAuth authorization URL with embedded CSRF protection

func (*AuthHandler) GetUserToken

func (h *AuthHandler) GetUserToken(
	ctx context.Context,
	req *userpb.GetUserTokenRequest,
) (*userpb.UserToken, error)

GetUserToken generates JWT token for authenticated users

func (*AuthHandler) LoginByOAuth

func (h *AuthHandler) LoginByOAuth(
	ctx context.Context,
	req *userpb.LoginByOAuthRequest,
) (*userpb.LoginSession, error)

LoginByOAuth handles OAuth login flow with CSRF protection

func (*AuthHandler) LoginByPassword

func (h *AuthHandler) LoginByPassword(
	ctx context.Context,
	req *userpb.LoginByPasswordRequest,
) (*userpb.LoginSession, error)

LoginByPassword handles password-based login

type UserHandler

type UserHandler struct {
	userpb.UnimplementedUserServiceServer
	// contains filtered or unexported fields
}

func NewUserHandler

func NewUserHandler(userService service.UserService) *UserHandler

func (*UserHandler) CreateUser

func (h *UserHandler) CreateUser(
	ctx context.Context,
	req *userpb.CreateUserRequest,
) (*emptypb.Empty, error)

func (*UserHandler) DeleteUser

func (h *UserHandler) DeleteUser(
	ctx context.Context,
	req *userpb.DeleteUserRequest,
) (*emptypb.Empty, error)

func (*UserHandler) GetCurrentUser

func (h *UserHandler) GetCurrentUser(
	ctx context.Context,
	req *emptypb.Empty,
) (*userpb.User, error)

func (*UserHandler) GetUser

func (h *UserHandler) GetUser(
	ctx context.Context,
	req *userpb.GetUserRequest,
) (*userpb.User, error)

func (*UserHandler) ListUsers

func (*UserHandler) UpdateUser

func (h *UserHandler) UpdateUser(
	ctx context.Context,
	req *userpb.UpdateUserRequest,
) (*emptypb.Empty, error)

Jump to

Keyboard shortcuts

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