fix():
This commit is contained in:
@@ -27,7 +27,7 @@ func Load() (*Config, error) {
|
||||
_ = godotenv.Load()
|
||||
|
||||
return &Config{
|
||||
GRPCPort: mustGetInt("AUTH_GRPC_PORT", 50052),
|
||||
GRPCPort: mustGetInt("AUTH_GRPC_PORT", 50051),
|
||||
GRPCEnableReflection: mustGetBool("AUTH_GRPC_ENABLE_REFLECTION", false),
|
||||
HTTPPort: mustGetInt("AUTH_HTTP_PORT", 8081),
|
||||
LogLevel: getEnv("LOG_LEVEL", "info"),
|
||||
|
||||
@@ -53,7 +53,10 @@ func (h *AuthHandler) SignIn(ctx context.Context, req *pb.SignInRequest) (*pb.Si
|
||||
return &pb.SignInResponse{Token: token}, nil
|
||||
}
|
||||
|
||||
func (h *AuthHandler) ValidateToken(ctx context.Context, req *pb.ValidateTokenRequest) (*pb.ValidateTokenResponse, error) {
|
||||
func (h *AuthHandler) ValidateToken(
|
||||
ctx context.Context,
|
||||
req *pb.ValidateTokenRequest,
|
||||
) (*pb.ValidateTokenResponse, error) {
|
||||
token := req.Token
|
||||
|
||||
if token == "" {
|
||||
|
||||
@@ -12,13 +12,13 @@ import (
|
||||
)
|
||||
|
||||
type SignUpRequest struct {
|
||||
Email string `json:"email" binding:"required,email"`
|
||||
Email string `json:"email" binding:"required,email"`
|
||||
Username string `json:"username" binding:"required"`
|
||||
Password string `json:"password" binding:"required"`
|
||||
}
|
||||
|
||||
type SignInRequest struct {
|
||||
Email string `json:"email" binding:"required,email"`
|
||||
Email string `json:"email" binding:"required,email"`
|
||||
Password string `json:"password" binding:"required"`
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ func Load() (*Config, error) {
|
||||
_ = godotenv.Load()
|
||||
|
||||
return &Config{
|
||||
GRPCPort: mustGetInt("COMPETITION_GRPC_PORT", 50053),
|
||||
GRPCPort: mustGetInt("COMPETITION_GRPC_PORT", 50051),
|
||||
GRPCEnableReflection: mustGetBool("COMPETITION_GRPC_ENABLE_REFLECTION", false),
|
||||
HTTPPort: mustGetInt("COMPETITION_HTTP_PORT", 8082),
|
||||
LogLevel: getEnv("LOG_LEVEL", "info"),
|
||||
|
||||
@@ -60,7 +60,7 @@ func Load() (*Config, error) {
|
||||
S3: S3Config{
|
||||
AccessKeyID: getEnvRequired("AWS_ACCESS_KEY_ID"),
|
||||
SecretAccessKey: getEnvRequired("AWS_SECRET_ACCESS_KEY"),
|
||||
Region: getEnvRequired("AWS_REGION"),
|
||||
Region: getEnv("AWS_REGION", ""),
|
||||
Bucket: getEnvRequired("S3_BUCKET"),
|
||||
Endpoint: getEnv("S3_ENDPOINT", ""),
|
||||
},
|
||||
|
||||
@@ -22,27 +22,17 @@ type Config struct {
|
||||
DBPassword string
|
||||
DBName string
|
||||
RedisURI string
|
||||
AuthGRPCAddr string
|
||||
CacheEnabled bool
|
||||
}
|
||||
|
||||
func Load() (*Config, error) {
|
||||
_ = godotenv.Load()
|
||||
|
||||
return &Config{
|
||||
GRPCPort: mustGetInt("GRPC_PORT", 50051), //nolint:mnd // false-positive
|
||||
GRPCEnableReflection: mustGetBool("GRPC_ENABLE_REFLECTION", false),
|
||||
EnableHTTPHandler: mustGetBool("HTTP_HANDLER_ENABLE", false),
|
||||
HTTPPort: mustGetInt("HTTP_PORT", 8080), //nolint:mnd // false-positive
|
||||
LogLevel: getEnv("LOG_LEVEL", "info"),
|
||||
DBHost: getEnv("POSTGRES_HOST", "localhost"),
|
||||
DBPort: mustGetInt("POSTGRES_PORT", 5432), //nolint:mnd // false-positive
|
||||
DBUser: getEnv("POSTGRES_USERNAME", "postgres"),
|
||||
DBPassword: getEnv("POSTGRES_PASSWORD", "postgres"),
|
||||
DBName: getEnv("POSTGRES_DATABASE", "postgres"),
|
||||
RedisURI: getEnv("REDIS_URI", "redis://localhost:6379"),
|
||||
AuthGRPCAddr: getEnv("AUTH_GRPC_ADDR", "localhost:50052"),
|
||||
CacheEnabled: mustGetBool("CACHE_ENABLED", true),
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user