gateway

package
v0.0.0-...-991afdd Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2025 License: AGPL-3.0 Imports: 19 Imported by: 0

Documentation

Overview

File Path: monorepo/cloud/maplepress-backend/internal/interface/http/handler/gateway/hello_handler.go

File Path: monorepo/cloud/maplepress-backend/internal/interface/http/handler/gateway/login_handler.go

File Path: monorepo/cloud/maplepress-backend/internal/interface/http/handler/gateway/me_handler.go

File Path: monorepo/cloud/maplepress-backend/internal/interface/http/handler/gateway/refresh_handler.go

File Path: monorepo/cloud/maplepress-backend/internal/interface/http/handler/gateway/register_handler.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HelloHandler

type HelloHandler struct {
	// contains filtered or unexported fields
}

HelloHandler handles the hello endpoint for authenticated users

func ProvideHelloHandler

func ProvideHelloHandler(logger *zap.Logger) *HelloHandler

ProvideHelloHandler creates a new HelloHandler

func (*HelloHandler) Handle

func (h *HelloHandler) Handle(w http.ResponseWriter, r *http.Request)

Handle handles the HTTP request for the hello endpoint Security: CWE-20, CWE-79, CWE-117 - Comprehensive input validation and sanitization

type HelloRequest

type HelloRequest struct {
	Name string `json:"name"`
}

HelloRequest represents the request body for the hello endpoint

type HelloResponse

type HelloResponse struct {
	Message string `json:"message"`
}

HelloResponse represents the response for the hello endpoint

type LoginHandler

type LoginHandler struct {
	// contains filtered or unexported fields
}

LoginHandler handles HTTP requests for user login

func NewLoginHandler

func NewLoginHandler(
	loginService gatewaysvc.LoginService,
	loginRateLimiter ratelimit.LoginRateLimiter,
	securityEventLogger securityeventservice.Logger,
	ipExtractor *clientip.Extractor,
	logger *zap.Logger,
) *LoginHandler

NewLoginHandler creates a new login handler CWE-307: Integrates rate limiting and account lockout protection CWE-778: Integrates security event logging for audit trails

func ProvideLoginHandler

func ProvideLoginHandler(
	loginService gatewaysvc.LoginService,
	loginRateLimiter ratelimit.LoginRateLimiter,
	securityEventLogger securityeventservice.Logger,
	ipExtractor *clientip.Extractor,
	logger *zap.Logger,
) *LoginHandler

ProvideLoginHandler creates a new LoginHandler for dependency injection

func (*LoginHandler) Handle

func (h *LoginHandler) Handle(w http.ResponseWriter, r *http.Request)

Handle processes POST /api/v1/login requests CWE-307: Implements rate limiting and account lockout protection against brute force attacks

type MeHandler

type MeHandler struct {
	// contains filtered or unexported fields
}

MeHandler handles the /me endpoint for getting authenticated user profile

func ProvideMeHandler

func ProvideMeHandler(logger *zap.Logger) *MeHandler

ProvideMeHandler creates a new MeHandler

func (*MeHandler) Handle

func (h *MeHandler) Handle(w http.ResponseWriter, r *http.Request)

Handle handles the HTTP request for the /me endpoint

type MeResponse

type MeResponse struct {
	UserID   string `json:"user_id"`
	Email    string `json:"email"`
	Name     string `json:"name"`
	Role     string `json:"role"`
	TenantID string `json:"tenant_id"`
}

MeResponse represents the user profile response

type RefreshTokenHandler

type RefreshTokenHandler struct {
	// contains filtered or unexported fields
}

RefreshTokenHandler handles HTTP requests for token refresh

func NewRefreshTokenHandler

func NewRefreshTokenHandler(
	refreshTokenService gatewaysvc.RefreshTokenService,
	logger *zap.Logger,
) *RefreshTokenHandler

NewRefreshTokenHandler creates a new refresh token handler

func ProvideRefreshTokenHandler

func ProvideRefreshTokenHandler(
	refreshTokenService gatewaysvc.RefreshTokenService,
	logger *zap.Logger,
) *RefreshTokenHandler

ProvideRefreshTokenHandler creates a new RefreshTokenHandler for dependency injection

func (*RefreshTokenHandler) Handle

Handle processes POST /api/v1/refresh requests CWE-613: Validates session still exists before issuing new tokens

type RegisterHandler

type RegisterHandler struct {
	// contains filtered or unexported fields
}

RegisterHandler handles user registration HTTP requests

func ProvideRegisterHandler

func ProvideRegisterHandler(
	service gatewaysvc.RegisterService,
	ipExtractor *clientip.Extractor,
	logger *zap.Logger,
) *RegisterHandler

ProvideRegisterHandler creates a new RegisterHandler

func (*RegisterHandler) Handle

func (h *RegisterHandler) Handle(w http.ResponseWriter, r *http.Request)

Handle handles the HTTP request for user registration

Jump to

Keyboard shortcuts

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