Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions docker-compose-local.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
version: "3.8"

services:
auth-server:
build:
context: .
dockerfile: Dockerfile
image: devnogi-auth-server:local
container_name: devnogi-auth-server-local
ports:
- "${SERVER_PORT:-8091}:${SERVER_PORT:-8091}"
env_file:
- .env
environment:
SPRING_PROFILES_ACTIVE: default
SERVER_PORT: ${SERVER_PORT:-8091}
DB_IP: ${DB_IP:-host.docker.internal}
DB_PORT: ${DB_PORT:-3316}
DB_SCHEMA: ${DB_SCHEMA:-devnogi}
DB_USER: ${DB_USER:-devnogi}
DB_PASSWORD: ${DB_PASSWORD:-devnogi0529!}
KAFKA_BOOTSTRAP_SERVERS: ${KAFKA_BOOTSTRAP_SERVERS:-119.194.235.11:9102}
Comment on lines +21 to +22
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The docker-compose file contains hardcoded sensitive information in plain text including database password 'devnogi0529!' on line 21 and Kafka bootstrap server IP address on line 22. Even for local development, credentials should not be hardcoded. These values should be moved to environment variables or a separate .env file that's not committed to version control.

Suggested change
DB_PASSWORD: ${DB_PASSWORD:-devnogi0529!}
KAFKA_BOOTSTRAP_SERVERS: ${KAFKA_BOOTSTRAP_SERVERS:-119.194.235.11:9102}
DB_PASSWORD: ${DB_PASSWORD}
KAFKA_BOOTSTRAP_SERVERS: ${KAFKA_BOOTSTRAP_SERVERS}

Copilot uses AI. Check for mistakes.
KAFKA_TOPIC_USER_VERIFICATION_VERIFY: ${KAFKA_TOPIC_USER_VERIFICATION_VERIFY:-USER_VERIFICATION_VERIFY_EVENT}
KAFKA_CONSUMER_GROUP_ID: ${KAFKA_CONSUMER_GROUP_ID:-devnogi-auth-user-verification-consumer-local}
JAVA_OPTS: -Xms256m -Xmx512m
restart: unless-stopped
extra_hosts:
- "host.docker.internal:host-gateway"
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:${SERVER_PORT:-8091}/actuator/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 90s
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package until.the.eternity.das.common.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.kafka.annotation.EnableKafka;

@Configuration
@EnableKafka
public class KafkaListenerConfig {
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
public class UserUpdateConstant {
public static final String INFO = "USER_INFO_UPDATE_EVENT";
public static final String PASSWORD = "PASSWORD_UPDATE_EVENT";
public static final String USER_VERIFICATION_VERIFY = "USER_VERIFICATION_VERIFY_EVENT";
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The constant USER_VERIFICATION_VERIFY is defined but appears to duplicate the functionality of the kafka topic configuration. The constant name suggests it should match the topic name in application-sample.yml, but this creates a maintenance burden if the topic name changes. Consider either removing this constant and using the property directly, or using this constant consistently throughout the codebase instead of string literals in configuration.

Suggested change
public static final String USER_VERIFICATION_VERIFY = "USER_VERIFICATION_VERIFY_EVENT";

Copilot uses AI. Check for mistakes.
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ public enum GlobalExceptionCode implements ExceptionCode {

// User
USER_INFO_UPDATE_FAILED(INTERNAL_SERVER_ERROR, "사용자 정보 수정에 실패했습니다. 잠시 후 다시 시도해주세요."),
USER_VERIFICATION_GENERATE_FAILED(INTERNAL_SERVER_ERROR, "인증 코드 생성에 실패했습니다. 잠시 후 다시 시도해주세요."),
USER_VERIFICATION_TOKEN_NOT_FOUND(HttpStatus.BAD_REQUEST, "발급된 인증 토큰이 존재하지 않습니다."),
USER_VERIFICATION_TOKEN_ALREADY_EXISTS(HttpStatus.BAD_REQUEST, "이미 유효한 인증 토큰이 존재합니다. 재발급을 이용해주세요."),
USER_VERIFICATION_COOLDOWN_ACTIVE(HttpStatus.BAD_REQUEST, "최근 7일 이내 인증 성공 이력이 있어 토큰 발급이 불가능합니다."),
USER_VERIFICATION_INVALID(HttpStatus.BAD_REQUEST, "유효하지 않거나 만료된 인증 코드입니다."),

// OAUTH
NOT_SUPPORTED_PROVIDER(HttpStatus.BAD_REQUEST, "지원하지 않는 소셜로그인입니다");
Expand Down
28 changes: 27 additions & 1 deletion src/main/java/until/the/eternity/das/user/entity/User.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,18 @@ public class User {
@Enumerated(EnumType.STRING)
private InactivatedType inactivatedType;

@Column(name = "server_name", length = 20)
@Comment("게임 서버명")
private String serverName;

@Column(name = "is_verified", nullable = false)
@Comment("사용자 인증 상태")
private boolean verified;
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new verified field does not have a default value defined in the entity. Since the database migration uses DEFAULT FALSE, the entity should match this with @Builder.Default annotation to ensure consistency when creating User objects via builder pattern. Without this, new User instances created with the builder will have null for primitive boolean, which may cause issues.

Suggested change
private boolean verified;
@Builder.Default
private boolean verified = false;

Copilot uses AI. Check for mistakes.

@Column(name = "verified_at")
@Comment("최근 인증 성공 시각")
private LocalDateTime verifiedAt;

@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "role_id")
private Role role;
Expand All @@ -90,4 +102,18 @@ public void updateUserStatus(Status status) {
this.inactivatedAt = LocalDateTime.now();
}

}
public void updateServerName(String serverName) {
this.serverName = serverName;
}

public void updateVerificationStatus(boolean verified, LocalDateTime verifiedAt) {
this.verified = verified;
this.verifiedAt = verifiedAt;
}

public void updateGameProfile(String nickname, String serverName) {
this.nickname = nickname;
this.serverName = serverName;
}
Comment on lines +114 to +117
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The updateGameProfile method allows updating both nickname and serverName together, but there's no validation to ensure the nickname doesn't conflict with existing users. This could lead to duplicate nickname constraint violations. Consider adding validation or using the existsByNicknameAndIdNot method to check for conflicts before updating, or document that validation should be done by the caller.

Copilot uses AI. Check for mistakes.

}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ public interface UserRepository extends JpaRepository<User, Long> {

boolean existsByNickname(String nickname);

boolean existsByNicknameAndIdNot(String nickname, Long id);

Comment on lines +13 to +14
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The existsByNicknameAndIdNot method is added but not used anywhere in this PR. If this method is intended for future use or is part of another feature, it should be documented. Otherwise, consider removing it to keep the codebase clean.

Suggested change
boolean existsByNicknameAndIdNot(String nickname, Long id);

Copilot uses AI. Check for mistakes.
User save(User user);

Optional<User> findByEmail(String email);
Expand Down
Loading