feat(identity): 인증 API와 mock adapter 구성 #48 - #53
Conversation
|
Important Review skippedAuto reviews are limited based on label configuration. 🏷️ Required labels (at least one) (1)
🚫 Excluded labels (none allowed) (2)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthrough인증 포트와 서비스, JWT 생성·검증, 계정 영속성 어댑터, HTTP 인증 API와 Spring Security 구성이 추가되었습니다. 관련 Bazel 의존성과 모듈 테스트 스위트도 갱신되었습니다. Changes인증 애플리케이션과 JWT
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant Client
participant JwtFilter
participant AuthController
participant AuthService
participant AccountRepository
Client->>JwtFilter: JWT 포함 인증 요청
JwtFilter->>JwtFilter: JWT 검증
JwtFilter->>AuthController: 인증된 요청 전달
AuthController->>AuthService: 인증 Command 전달
AuthService->>AccountRepository: 계정 조회 또는 저장
AuthService-->>AuthController: 인증 Result 반환
AuthController-->>Client: ApiResponse와 토큰 쿠키 반환
Possibly related PRs
Suggested labels: ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 14
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@systems/identity/identity-adapter-in/src/main/kotlin/hs/kr/entrydsm/identity/adapterin/web/AuthController.kt`:
- Around line 107-120: Replace the fixed values in mockAccessTokenCookie and
mockRefreshTokenCookie with a token pair produced by the AuthPort login/refresh
results or the configured token generator. Ensure mock tokens are valid signed
HS256 JWTs and are unique per user/session, then preserve the existing cookie
security, path, and expiration settings.
In
`@systems/identity/identity-adapter-in/src/test/kotlin/hs/kr/entrydsm/identity/adapterin/web/AuthControllerTest.kt`:
- Around line 118-124: AuthControllerTest의 fake 구현에서 refreshToken과
resetPassword로 전달된 커맨드를 저장하도록 변경하고, 각 실제 컨트롤러 엔드포인트를 직접 호출하는 테스트를 추가하세요. refresh
cookie 전달, 커맨드 필드 매핑, 갱신 쿠키 발급 결과를 검증하는 결정적이고 의미 있는 단언을 작성하며, 항상 참인
assertNotNull 검증은 제거하세요.
In
`@systems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/in/command/LoginCommand.kt`:
- Around line 3-6: Override toString consistently for the sensitive data
classes: mask password in LoginCommand at
systems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/in/command/LoginCommand.kt:3-6,
authorization in LogoutCommand at
systems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/in/command/LogoutCommand.kt:3-5,
refreshToken in RefreshTokenCommand at
systems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/in/command/RefreshTokenCommand.kt:3-5,
and JwtToken.value in JwtTokenGenerator at
systems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/security/jwt/JwtTokenGenerator.kt:112-117;
use one shared masking convention or utility and ensure no credential value
appears in the generated string.
In
`@systems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/in/command/LogoutCommand.kt`:
- Around line 3-5: Update AuthController and LogoutCommand so the HTTP
Authorization header is parsed in the adapter layer and LogoutCommand receives
only the extracted token value; keep Bearer-prefix handling out of the
application layer and preserve the logout flow using the pure token.
In
`@systems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/security/jwt/JwtTokenGenerator.kt`:
- Around line 36-102: Replace the custom JWT construction in
JwtTokenGenerator.generateToken, including json, escapeJson, base64UrlEncode,
and hmacSha256, with the project’s standard JWT library used by JwtFilter. Build
the header and claims through that library, sign with the configured secret and
HS256, and return a JwtToken while preserving issuer, subject, type, issuedAt,
and expiresAt values.
In
`@systems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/service/AuthService.kt`:
- Around line 29-39: Replace the in-memory AtomicLong user ID generation in
AuthService.signup with the established persistent sequence, database-generated
ID, or durable ID-generation port, ensuring IDs remain unique across instances
and restarts. Remove the nextUserId counter usage while preserving the existing
Account.create flow.
- Around line 21-28: Remove the Spring-specific `@Service` annotation and its
org.springframework.stereotype.Service import from AuthService, leaving the
application service as a framework-independent class. Register and construct
AuthService in the bootstrap layer through a `@Bean` or adapter configuration
instead.
- Around line 53-54: AuthService의 계정 저장과 applicationDataPort.create 호출을 하나의 트랜잭션
또는 원자적 포트 연산으로 묶어, 애플리케이션 초기화 실패 시 계정 저장도 함께 롤백되도록 수정하세요.
accountRepository.save와 applicationDataPort.create가 동일한 트랜잭션 경계에서 실행되게 하며,
IdentityServiceSupport.findApplication의 기존 조회 동작은 변경하지 마세요.
- Around line 31-99: AuthService의 signup, login, resetPassword 동작을 검증하는 행동 테스트를
identity-application 테스트 영역에 추가하세요. 정상 회원가입과 중복 계정, 비활성 계정 로그인, 비밀번호 재설정 입력 및
사용자 검증 실패를 각각 검증하고, accountRepository.save 실패가 올바르게 전파되는지도 확인하세요. 기존 테스트 가이드와
테스트 더블 패턴을 따르며 관련 의존성 상호작용까지 검증하세요.
In
`@systems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/service/IdentityServiceSupport.kt`:
- Around line 11-22: Update AccountRepository.resolveAccount and the
AuthService.logout flow to use only the principal validated and injected by
JwtFilter through SecurityFilterChain, rather than parsing
LogoutCommand.authorization or accepting arbitrary Bearer user_XXX values.
Remove the token-to-userId interpretation from resolveAccount, and handle
mock-access-token/access-token behavior only through an explicit test or
mode-specific path.
In
`@systems/identity/identity-application/src/test/kotlin/hs/kr/entrydsm/TestMain.kt`:
- Around line 3-11: IdentityApplicationModuleTest의 SuiteClasses에 AuthService,
MockAuthPortAdapter, IdentityResultMapper, IdentityServiceSupport 관련 테스트를 추가해
identity-application의 프로덕션 로직이 모두 실행되도록 하세요. 해당 테스트가 존재하지 않거나 의도적으로 제외해야 한다면, 그
근거를 테스트 코드에 명시하고 JwtTokenGeneratorTest만 포함하는 현재 범위를 명확히 설명하세요.
In
`@systems/identity/identity-bootstrap/src/main/kotlin/hs/kr/entrydsm/identity/config/security/JwtFilter.kt`:
- Around line 33-50: Update JwtFilter to bypass JWT validation and continue the
filter chain for public authentication endpoints, including the login, token,
password-reset, and signup paths. Keep the existing token resolution and
verification behavior unchanged for all other requests, including requests
without a token.
In
`@systems/identity/identity-bootstrap/src/main/kotlin/hs/kr/entrydsm/identity/config/SecurityConfig.kt`:
- Around line 57-58: Update the SecurityFilterChain configuration around csrf
and JwtFilter.resolveToken so cookie-based authentication is protected:
configure an appropriate CSRF token repository and asynchronous-request
protection, or remove the access_token cookie fallback so only
Authorization-header authentication remains. Do not rely on the existing cors
disablement as CSRF protection.
In
`@systems/identity/identity-bootstrap/src/test/kotlin/hs/kr/entrydsm/TestMain.kt`:
- Around line 18-35: Expand the tests in TestMain to cover the JWT filter and
security chain using a fixed Clock: verify valid, expired, tampered-signature,
malformed, and missing-token requests, including security context population and
401 versus filter-chain continuation behavior. Reuse the existing security
configuration and token-related symbols rather than limiting coverage to Java
Time mapping.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 459e6080-113b-44e6-8695-eed6a8f02cb1
📒 Files selected for processing (29)
systems/identity/identity-adapter-in/BUILD.bazelsystems/identity/identity-adapter-in/src/main/kotlin/hs/kr/entrydsm/identity/adapterin/web/AuthController.ktsystems/identity/identity-adapter-in/src/main/kotlin/hs/kr/entrydsm/identity/adapterin/web/dto/request/LoginRequest.ktsystems/identity/identity-adapter-in/src/main/kotlin/hs/kr/entrydsm/identity/adapterin/web/dto/request/PasswordResetRequest.ktsystems/identity/identity-adapter-in/src/main/kotlin/hs/kr/entrydsm/identity/adapterin/web/dto/request/SignupRequest.ktsystems/identity/identity-adapter-in/src/test/kotlin/hs/kr/entrydsm/TestMain.ktsystems/identity/identity-adapter-in/src/test/kotlin/hs/kr/entrydsm/identity/adapterin/web/AuthControllerTest.ktsystems/identity/identity-adapter-in/src/test/kotlin/hs/kr/entrydsm/identity/adapterin/web/exception/GlobalExceptionHandlerTest.ktsystems/identity/identity-application/BUILD.bazelsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/mock/MockAuthPortAdapter.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/in/AuthPort.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/in/command/LoginCommand.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/in/command/LogoutCommand.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/in/command/PasswordResetCommand.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/in/command/RefreshTokenCommand.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/in/command/SignupCommand.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/security/jwt/JwtTokenGenerator.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/service/AuthService.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/service/IdentityResultMapper.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/service/IdentityServiceSupport.ktsystems/identity/identity-application/src/test/kotlin/hs/kr/entrydsm/TestMain.ktsystems/identity/identity-application/src/test/kotlin/hs/kr/entrydsm/identity/application/security/jwt/JwtTokenGeneratorTest.ktsystems/identity/identity-bootstrap/BUILD.bazelsystems/identity/identity-bootstrap/src/main/kotlin/hs/kr/entrydsm/identity/config/SecurityConfig.ktsystems/identity/identity-bootstrap/src/main/kotlin/hs/kr/entrydsm/identity/config/security/JwtAuthenticationEntryPoint.ktsystems/identity/identity-bootstrap/src/main/kotlin/hs/kr/entrydsm/identity/config/security/JwtAuthorizationDeniedHandler.ktsystems/identity/identity-bootstrap/src/main/kotlin/hs/kr/entrydsm/identity/config/security/JwtFilter.ktsystems/identity/identity-bootstrap/src/main/kotlin/hs/kr/entrydsm/identity/config/security/JwtProperties.ktsystems/identity/identity-bootstrap/src/test/kotlin/hs/kr/entrydsm/TestMain.kt
📜 Review details
🧰 Additional context used
📓 Path-based instructions (6)
**/*.{kt,go}
📄 CodeRabbit inference engine (Custom checks)
If production logic is changed in Kotlin or Go files, require corresponding test updates in the same subsystem unless the PR description explicitly justifies why tests are unnecessary
Files:
systems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/in/command/RefreshTokenCommand.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/in/command/SignupCommand.ktsystems/identity/identity-adapter-in/src/main/kotlin/hs/kr/entrydsm/identity/adapterin/web/dto/request/SignupRequest.ktsystems/identity/identity-adapter-in/src/main/kotlin/hs/kr/entrydsm/identity/adapterin/web/dto/request/LoginRequest.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/in/command/LogoutCommand.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/in/command/PasswordResetCommand.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/in/AuthPort.ktsystems/identity/identity-bootstrap/src/main/kotlin/hs/kr/entrydsm/identity/config/security/JwtProperties.ktsystems/identity/identity-adapter-in/src/main/kotlin/hs/kr/entrydsm/identity/adapterin/web/dto/request/PasswordResetRequest.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/in/command/LoginCommand.ktsystems/identity/identity-bootstrap/src/main/kotlin/hs/kr/entrydsm/identity/config/security/JwtAuthorizationDeniedHandler.ktsystems/identity/identity-application/src/test/kotlin/hs/kr/entrydsm/TestMain.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/service/IdentityResultMapper.ktsystems/identity/identity-bootstrap/src/main/kotlin/hs/kr/entrydsm/identity/config/security/JwtAuthenticationEntryPoint.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/mock/MockAuthPortAdapter.ktsystems/identity/identity-adapter-in/src/test/kotlin/hs/kr/entrydsm/identity/adapterin/web/exception/GlobalExceptionHandlerTest.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/service/IdentityServiceSupport.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/security/jwt/JwtTokenGenerator.ktsystems/identity/identity-application/src/test/kotlin/hs/kr/entrydsm/identity/application/security/jwt/JwtTokenGeneratorTest.ktsystems/identity/identity-bootstrap/src/main/kotlin/hs/kr/entrydsm/identity/config/SecurityConfig.ktsystems/identity/identity-adapter-in/src/test/kotlin/hs/kr/entrydsm/TestMain.ktsystems/identity/identity-adapter-in/src/test/kotlin/hs/kr/entrydsm/identity/adapterin/web/AuthControllerTest.ktsystems/identity/identity-bootstrap/src/test/kotlin/hs/kr/entrydsm/TestMain.ktsystems/identity/identity-adapter-in/src/main/kotlin/hs/kr/entrydsm/identity/adapterin/web/AuthController.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/service/AuthService.ktsystems/identity/identity-bootstrap/src/main/kotlin/hs/kr/entrydsm/identity/config/security/JwtFilter.kt
**/*-application/**/*.{java,kt,scala,groovy}
📄 CodeRabbit inference engine (Custom checks)
For files under *-application modules, flag direct dependency on infrastructure-specific framework classes unless justified
Files:
systems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/in/command/RefreshTokenCommand.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/in/command/SignupCommand.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/in/command/LogoutCommand.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/in/command/PasswordResetCommand.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/in/AuthPort.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/in/command/LoginCommand.ktsystems/identity/identity-application/src/test/kotlin/hs/kr/entrydsm/TestMain.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/service/IdentityResultMapper.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/mock/MockAuthPortAdapter.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/service/IdentityServiceSupport.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/security/jwt/JwtTokenGenerator.ktsystems/identity/identity-application/src/test/kotlin/hs/kr/entrydsm/identity/application/security/jwt/JwtTokenGeneratorTest.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/service/AuthService.kt
**/*.{java,kt,scala,groovy,go,js,ts,tsx,jsx,py,rb,rs,cpp,c,h,hpp,cs}
📄 CodeRabbit inference engine (Custom checks)
Flag TODO/FIXME comments introduced by this PR that do not include an issue reference in the form
#123or a full tracker key like PROJ-123
Files:
systems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/in/command/RefreshTokenCommand.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/in/command/SignupCommand.ktsystems/identity/identity-adapter-in/src/main/kotlin/hs/kr/entrydsm/identity/adapterin/web/dto/request/SignupRequest.ktsystems/identity/identity-adapter-in/src/main/kotlin/hs/kr/entrydsm/identity/adapterin/web/dto/request/LoginRequest.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/in/command/LogoutCommand.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/in/command/PasswordResetCommand.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/in/AuthPort.ktsystems/identity/identity-bootstrap/src/main/kotlin/hs/kr/entrydsm/identity/config/security/JwtProperties.ktsystems/identity/identity-adapter-in/src/main/kotlin/hs/kr/entrydsm/identity/adapterin/web/dto/request/PasswordResetRequest.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/in/command/LoginCommand.ktsystems/identity/identity-bootstrap/src/main/kotlin/hs/kr/entrydsm/identity/config/security/JwtAuthorizationDeniedHandler.ktsystems/identity/identity-application/src/test/kotlin/hs/kr/entrydsm/TestMain.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/service/IdentityResultMapper.ktsystems/identity/identity-bootstrap/src/main/kotlin/hs/kr/entrydsm/identity/config/security/JwtAuthenticationEntryPoint.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/mock/MockAuthPortAdapter.ktsystems/identity/identity-adapter-in/src/test/kotlin/hs/kr/entrydsm/identity/adapterin/web/exception/GlobalExceptionHandlerTest.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/service/IdentityServiceSupport.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/security/jwt/JwtTokenGenerator.ktsystems/identity/identity-application/src/test/kotlin/hs/kr/entrydsm/identity/application/security/jwt/JwtTokenGeneratorTest.ktsystems/identity/identity-bootstrap/src/main/kotlin/hs/kr/entrydsm/identity/config/SecurityConfig.ktsystems/identity/identity-adapter-in/src/test/kotlin/hs/kr/entrydsm/TestMain.ktsystems/identity/identity-adapter-in/src/test/kotlin/hs/kr/entrydsm/identity/adapterin/web/AuthControllerTest.ktsystems/identity/identity-bootstrap/src/test/kotlin/hs/kr/entrydsm/TestMain.ktsystems/identity/identity-adapter-in/src/main/kotlin/hs/kr/entrydsm/identity/adapterin/web/AuthController.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/service/AuthService.ktsystems/identity/identity-bootstrap/src/main/kotlin/hs/kr/entrydsm/identity/config/security/JwtFilter.kt
**/*.kt
⚙️ CodeRabbit configuration file
**/*.kt: Apply Kotlin Official Coding Conventions.Formatting and structure:
- Use 4 spaces for indentation; no tabs.
- Keep files focused and readable; avoid horizontal alignment for spacing.
- Place related declarations together and keep overloads adjacent.
- Keep implementation member order stable and logical for readability.
Naming:
- Package names are lowercase and do not use underscores.
- Class/object names use UpperCamelCase.
- Functions/properties/local variables use lowerCamelCase.
- Constants use UPPER_SNAKE_CASE only for true constants.
API and null-safety:
- Avoid platform type leakage in public APIs.
- Use explicit types in public APIs when inference obscures meaning.
- Prefer immutable values (
val) over mutable values (var) unless mutation is required.- Flag nullable flows that can be replaced with safer modeling.
Imports and idioms:
- Avoid wildcard imports unless justified by language/tooling conventions.
- Prefer expression bodies for short, clear functions.
- Prefer standard library idioms over custom utility wrappers when equivalent.
Architecture and tests:
- Respect module boundaries (domain/application/adapter/bootstrap layering).
- Highlight behavior-changing code that lacks corresponding unit/integration tests.
- Ask for deterministic tests and meaningful assertions, not only happy-path checks.
Files:
systems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/in/command/RefreshTokenCommand.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/in/command/SignupCommand.ktsystems/identity/identity-adapter-in/src/main/kotlin/hs/kr/entrydsm/identity/adapterin/web/dto/request/SignupRequest.ktsystems/identity/identity-adapter-in/src/main/kotlin/hs/kr/entrydsm/identity/adapterin/web/dto/request/LoginRequest.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/in/command/LogoutCommand.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/in/command/PasswordResetCommand.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/in/AuthPort.ktsystems/identity/identity-bootstrap/src/main/kotlin/hs/kr/entrydsm/identity/config/security/JwtProperties.ktsystems/identity/identity-adapter-in/src/main/kotlin/hs/kr/entrydsm/identity/adapterin/web/dto/request/PasswordResetRequest.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/in/command/LoginCommand.ktsystems/identity/identity-bootstrap/src/main/kotlin/hs/kr/entrydsm/identity/config/security/JwtAuthorizationDeniedHandler.ktsystems/identity/identity-application/src/test/kotlin/hs/kr/entrydsm/TestMain.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/service/IdentityResultMapper.ktsystems/identity/identity-bootstrap/src/main/kotlin/hs/kr/entrydsm/identity/config/security/JwtAuthenticationEntryPoint.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/mock/MockAuthPortAdapter.ktsystems/identity/identity-adapter-in/src/test/kotlin/hs/kr/entrydsm/identity/adapterin/web/exception/GlobalExceptionHandlerTest.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/service/IdentityServiceSupport.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/security/jwt/JwtTokenGenerator.ktsystems/identity/identity-application/src/test/kotlin/hs/kr/entrydsm/identity/application/security/jwt/JwtTokenGeneratorTest.ktsystems/identity/identity-bootstrap/src/main/kotlin/hs/kr/entrydsm/identity/config/SecurityConfig.ktsystems/identity/identity-adapter-in/src/test/kotlin/hs/kr/entrydsm/TestMain.ktsystems/identity/identity-adapter-in/src/test/kotlin/hs/kr/entrydsm/identity/adapterin/web/AuthControllerTest.ktsystems/identity/identity-bootstrap/src/test/kotlin/hs/kr/entrydsm/TestMain.ktsystems/identity/identity-adapter-in/src/main/kotlin/hs/kr/entrydsm/identity/adapterin/web/AuthController.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/service/AuthService.ktsystems/identity/identity-bootstrap/src/main/kotlin/hs/kr/entrydsm/identity/config/security/JwtFilter.kt
**/{BUILD.bazel,*.bzl}
📄 CodeRabbit inference engine (Custom checks)
In BUILD.bazel and .bzl files, require buildifier-compatible formatting and stable target naming
Files:
systems/identity/identity-adapter-in/BUILD.bazelsystems/identity/identity-bootstrap/BUILD.bazelsystems/identity/identity-application/BUILD.bazel
**/BUILD.bazel
⚙️ CodeRabbit configuration file
**/BUILD.bazel: Apply Bazel BUILD style guidance.Core rules:
- BUILD formatting must match buildifier output.
- Prefer DAMP BUILD files over over-abstracted DRY patterns.
- Keep top-level layout clear: load() first, then package/default visibility, then targets.
Target definitions:
- Keep deps explicit and close to each target's real direct dependencies.
- Avoid recursive globs unless there is a clear, documented reason.
- Avoid top-level list comprehensions for generating many targets.
- Prefer literal labels and stable naming for readability and tooling compatibility.
- Use boolean values (True/False), not numeric stand-ins.
Maintenance:
- Flag duplicated target logic that should be moved into a macro.
- Flag macro usage that hides important dependency or visibility decisions.
Files:
systems/identity/identity-adapter-in/BUILD.bazelsystems/identity/identity-bootstrap/BUILD.bazelsystems/identity/identity-application/BUILD.bazel
🪛 ast-grep (0.44.1)
systems/identity/identity-bootstrap/src/main/kotlin/hs/kr/entrydsm/identity/config/security/JwtFilter.kt
[warning] 109-109: A credential is hard-coded by assigning a string literal to a password/secret/API-key variable. Secrets stored in source code can be leaked and abused by internal or external malicious actors. Remove the literal, rotate the exposed secret, and load it at runtime from an environment variable, a secure secret vault, or a Hardware Security Module (HSM).
Context: private const val ACCESS_TOKEN_COOKIE = "access_token"
Note: [CWE-798]: Use of Hard-coded Credentials [OWASP A07:2021]: Identification and Authentication Failures
(hardcoded-password-string-literal-kotlin)
[warning] 110-110: A credential is hard-coded by assigning a string literal to a password/secret/API-key variable. Secrets stored in source code can be leaked and abused by internal or external malicious actors. Remove the literal, rotate the exposed secret, and load it at runtime from an environment variable, a secure secret vault, or a Hardware Security Module (HSM).
Context: private const val ACCESS_TOKEN_TYPE = "access"
Note: [CWE-798]: Use of Hard-coded Credentials [OWASP A07:2021]: Identification and Authentication Failures
(hardcoded-password-string-literal-kotlin)
🪛 detekt (1.23.8)
systems/identity/identity-bootstrap/src/main/kotlin/hs/kr/entrydsm/identity/config/security/JwtFilter.kt
[warning] 86-86: The caught exception is too generic. Prefer catching specific exceptions to the case that is currently handled.
(detekt.exceptions.TooGenericExceptionCaught)
🔇 Additional comments (18)
systems/identity/identity-adapter-in/src/main/kotlin/hs/kr/entrydsm/identity/adapterin/web/AuthController.kt (1)
33-49: LGTM!Also applies to: 68-78, 92-105
systems/identity/identity-adapter-in/src/main/kotlin/hs/kr/entrydsm/identity/adapterin/web/dto/request/LoginRequest.kt (1)
1-9: LGTM!systems/identity/identity-adapter-in/src/main/kotlin/hs/kr/entrydsm/identity/adapterin/web/dto/request/PasswordResetRequest.kt (1)
1-12: LGTM!systems/identity/identity-adapter-in/src/main/kotlin/hs/kr/entrydsm/identity/adapterin/web/dto/request/SignupRequest.kt (1)
1-14: LGTM!systems/identity/identity-adapter-in/src/test/kotlin/hs/kr/entrydsm/identity/adapterin/web/AuthControllerTest.kt (1)
28-84: LGTM!systems/identity/identity-adapter-in/src/test/kotlin/hs/kr/entrydsm/identity/adapterin/web/exception/GlobalExceptionHandlerTest.kt (1)
10-42: LGTM!systems/identity/identity-adapter-in/src/test/kotlin/hs/kr/entrydsm/TestMain.kt (1)
3-13: LGTM!systems/identity/identity-adapter-in/BUILD.bazel (1)
20-20: LGTM!systems/identity/identity-bootstrap/src/main/kotlin/hs/kr/entrydsm/identity/config/SecurityConfig.kt (2)
26-28: 🩺 Stability & Availability
Clock빈 등록 여부를 확인하세요.
JwtFilter가Clock을 생성자 주입받지만 이 구성에는 해당 빈이 없습니다. 별도 빈이 없다면 컨텍스트 시작 시 주입에 실패합니다.Clock.systemUTC()를 반환하는 빈을 등록하거나 기존 정의를 확인하세요.
3-11: 📐 Maintainability & Code QualityJackson 3 전환은 해당되지 않습니다.
현재 Spring Boot 4 빌드도
jackson-module-kotlin을com.fasterxml.jackson.module:jackson-module-kotlin:2.18.2로 선언하고 있어, 현재com.fasterxml.jackson.*및jacksonObjectMapper()import는 Jackson 2 API와 일치합니다.> Likely an incorrect or invalid review comment.systems/identity/identity-bootstrap/src/main/kotlin/hs/kr/entrydsm/identity/config/security/JwtProperties.kt (1)
5-9: 🔒 Security & Privacy보안 설정값 검증이 이미 수행되고 있습니다.
JwtFilter에서secret의 byte 길이가 32 바이트 미만이면 예외가 발생하므로 빈/짧은 HMAC 키 사용은 시작 시 제거됩니다. 같은 동작을JwtProperties에 중복 추가할 필요는 없습니다.> Likely an incorrect or invalid review comment.systems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/in/AuthPort.kt (1)
11-21: LGTM!systems/identity/identity-application/src/test/kotlin/hs/kr/entrydsm/identity/application/security/jwt/JwtTokenGeneratorTest.kt (1)
12-67: LGTM!systems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/in/command/PasswordResetCommand.kt (1)
1-10: LGTM!systems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/in/command/SignupCommand.kt (1)
1-12: LGTM!systems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/mock/MockAuthPortAdapter.kt (1)
1-42: LGTM!systems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/service/IdentityResultMapper.kt (1)
1-27: LGTM!systems/identity/identity-application/BUILD.bazel (1)
14-21: LGTM!
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 8
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@systems/identity/identity-adapter-out/deps.bzl`:
- Around line 1-6: KOTLIN_DEPS에서 spring-boot-starter-security 의존성을 제거하고,
BCryptPasswordEncoder 사용에 필요한 spring-security-crypto Maven 라벨로 교체하세요. 기존 JPA 및
애플리케이션·도메인 의존성은 유지하세요.
In
`@systems/identity/identity-adapter-out/src/main/kotlin/hs/kr/entrydsm/identity/adapterout/persistence/MysqlUserIdGenerator.kt`:
- Around line 7-12: 추가된 MysqlUserIdGenerator가 의존하는 identity_user_id_sequence
테이블과 초기 USER 행을 생성하는 migration을 추가하세요. 스키마는 sequence_name을 VARCHAR(32) 기본 키로,
next_id를 BIGINT NOT NULL로 정의하고, USER 키의 next_id 초기값을 설정해 첫 회원가입이 정상적으로 ID를 할당하도록
하세요.
In
`@systems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/in/command/SignupCommand.kt`:
- Around line 6-12: Implement safe toString() overrides for SignupCommand in
systems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/in/command/SignupCommand.kt#L6-L12
and PasswordResetCommand in
systems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/in/command/PasswordResetCommand.kt#L5-L12,
masking password, loginId, name, phone, and birthdate while preserving only
non-sensitive fields such as signupType; ensure no credential or PII is emitted
in logs or exceptions.
In
`@systems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/service/AuthService.kt`:
- Around line 80-89: Remove the hardcoded "mock-refresh-token" validation from
AuthService.refreshToken and replace it with verification of the refresh JWT’s
signature, expiration, and token type. Extract the verified subject, load the
corresponding account, and issue tokens using that account’s user ID, role, and
status; preserve invalid and expired token errors and ensure refresh JWTs
generated by the existing token issuance flow are accepted.
In
`@systems/identity/identity-application/src/test/kotlin/hs/kr/entrydsm/identity/application/service/AuthServiceTest.kt`:
- Around line 182-183: Update the default AccountRegistrationPort lambda in the
service helper to accept both register arguments, Account and Instant, while
preserving the existing account-returning behavior.
- Around line 3-6: AuthServiceTest.kt에서 사용하는 RefreshTokenCommand가 import되지
않았습니다. 기존 command import 목록에
hs.kr.entrydsm.identity.application.port.`in`.command.RefreshTokenCommand
import를 추가해 테스트가 컴파일되도록 수정하세요.
In
`@systems/identity/identity-application/src/test/kotlin/hs/kr/entrydsm/identity/application/service/IdentityServiceSupportTest.kt`:
- Around line 10-21: Update signupValidationRejectsBlankRequiredFields to
capture the thrown IdentityDomainException instead of using the expected
annotation, then assert that its error code is INVALID_REQUEST_BODY. Preserve
the existing invalid SignupCommand setup and requireValidSignup invocation.
In
`@systems/identity/identity-bootstrap/src/test/kotlin/hs/kr/entrydsm/identity/config/security/JwtFilterTest.kt`:
- Around line 50-52: Update tamperedAndMalformedTokensReturnUnauthorized so the
tampered case uses a well-formed JWT issued with a different secret key,
ensuring signature verification deterministically fails; keep the malformed
“not-a-jwt” case and existing unauthorized assertions unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 797ae6af-e298-46f9-94c8-c9d667115ca4
⛔ Files ignored due to path filters (1)
kotlin.MODULE.bazelis excluded by none and included by none
📒 Files selected for processing (53)
systems/identity/identity-adapter-in/BUILD.bazelsystems/identity/identity-adapter-in/deps.bzlsystems/identity/identity-adapter-in/src/main/kotlin/hs/kr/entrydsm/identity/adapterin/web/AuthController.ktsystems/identity/identity-adapter-in/src/main/kotlin/hs/kr/entrydsm/identity/adapterin/web/dto/request/LoginRequest.ktsystems/identity/identity-adapter-in/src/main/kotlin/hs/kr/entrydsm/identity/adapterin/web/dto/request/PasswordResetRequest.ktsystems/identity/identity-adapter-in/src/main/kotlin/hs/kr/entrydsm/identity/adapterin/web/dto/request/SignupRequest.ktsystems/identity/identity-adapter-in/src/test/kotlin/hs/kr/entrydsm/TestMain.ktsystems/identity/identity-adapter-in/src/test/kotlin/hs/kr/entrydsm/identity/adapterin/web/AuthControllerTest.ktsystems/identity/identity-adapter-in/src/test/kotlin/hs/kr/entrydsm/identity/adapterin/web/exception/GlobalExceptionHandlerTest.ktsystems/identity/identity-adapter-out/deps.bzlsystems/identity/identity-adapter-out/src/main/kotlin/hs/kr/entrydsm/identity/adapterout/persistence/AccountCommandPersistenceAdapter.ktsystems/identity/identity-adapter-out/src/main/kotlin/hs/kr/entrydsm/identity/adapterout/persistence/AccountQueryPersistenceAdapter.ktsystems/identity/identity-adapter-out/src/main/kotlin/hs/kr/entrydsm/identity/adapterout/persistence/MysqlUserIdGenerator.ktsystems/identity/identity-adapter-out/src/main/kotlin/hs/kr/entrydsm/identity/adapterout/persistence/TransactionalAccountRegistrationAdapter.ktsystems/identity/identity-adapter-out/src/main/kotlin/hs/kr/entrydsm/identity/adapterout/security/BCryptPasswordHasher.ktsystems/identity/identity-adapter-out/src/test/kotlin/hs/kr/entrydsm/TestMain.ktsystems/identity/identity-adapter-out/src/test/kotlin/hs/kr/entrydsm/identity/adapterout/persistence/TransactionalAccountRegistrationAdapterTest.ktsystems/identity/identity-application/BUILD.bazelsystems/identity/identity-application/deps.bzlsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/mock/MockAuthPortAdapter.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/in/AuthPort.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/in/command/LoginCommand.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/in/command/LogoutCommand.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/in/command/PasswordResetCommand.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/in/command/RefreshTokenCommand.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/in/command/SignupCommand.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/in/result/AuthTokenResult.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/out/AccountCommandPort.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/out/AccountQueryPort.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/out/AccountRegistrationPort.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/out/UserIdGenerator.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/security/AuthenticatedUser.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/security/jwt/JwtTokenGenerator.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/service/AuthService.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/service/IdentityResultMapper.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/service/IdentityServiceSupport.ktsystems/identity/identity-application/src/test/kotlin/hs/kr/entrydsm/TestMain.ktsystems/identity/identity-application/src/test/kotlin/hs/kr/entrydsm/identity/application/mock/MockAuthPortAdapterTest.ktsystems/identity/identity-application/src/test/kotlin/hs/kr/entrydsm/identity/application/security/jwt/JwtTokenGeneratorTest.ktsystems/identity/identity-application/src/test/kotlin/hs/kr/entrydsm/identity/application/service/AuthServiceTest.ktsystems/identity/identity-application/src/test/kotlin/hs/kr/entrydsm/identity/application/service/IdentityResultMapperTest.ktsystems/identity/identity-application/src/test/kotlin/hs/kr/entrydsm/identity/application/service/IdentityServiceSupportTest.ktsystems/identity/identity-bootstrap/BUILD.bazelsystems/identity/identity-bootstrap/deps.bzlsystems/identity/identity-bootstrap/src/main/kotlin/hs/kr/entrydsm/identity/config/IdentityApplicationConfig.ktsystems/identity/identity-bootstrap/src/main/kotlin/hs/kr/entrydsm/identity/config/SecurityConfig.ktsystems/identity/identity-bootstrap/src/main/kotlin/hs/kr/entrydsm/identity/config/UserIdGeneratorConfig.ktsystems/identity/identity-bootstrap/src/main/kotlin/hs/kr/entrydsm/identity/config/security/JwtAuthenticationEntryPoint.ktsystems/identity/identity-bootstrap/src/main/kotlin/hs/kr/entrydsm/identity/config/security/JwtAuthorizationDeniedHandler.ktsystems/identity/identity-bootstrap/src/main/kotlin/hs/kr/entrydsm/identity/config/security/JwtFilter.ktsystems/identity/identity-bootstrap/src/main/kotlin/hs/kr/entrydsm/identity/config/security/JwtProperties.ktsystems/identity/identity-bootstrap/src/test/kotlin/hs/kr/entrydsm/TestMain.ktsystems/identity/identity-bootstrap/src/test/kotlin/hs/kr/entrydsm/identity/config/security/JwtFilterTest.kt
📜 Review details
🧰 Additional context used
📓 Path-based instructions (7)
**/*.{kt,go}
📄 CodeRabbit inference engine (Custom checks)
If production logic is changed in Kotlin or Go files, require corresponding test updates in the same subsystem unless the PR description explicitly justifies why tests are unnecessary
Files:
systems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/out/AccountCommandPort.ktsystems/identity/identity-adapter-out/src/main/kotlin/hs/kr/entrydsm/identity/adapterout/persistence/AccountQueryPersistenceAdapter.ktsystems/identity/identity-adapter-in/src/main/kotlin/hs/kr/entrydsm/identity/adapterin/web/dto/request/LoginRequest.ktsystems/identity/identity-adapter-in/src/test/kotlin/hs/kr/entrydsm/identity/adapterin/web/exception/GlobalExceptionHandlerTest.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/in/command/LoginCommand.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/security/AuthenticatedUser.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/in/command/PasswordResetCommand.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/in/command/RefreshTokenCommand.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/in/command/SignupCommand.ktsystems/identity/identity-adapter-out/src/main/kotlin/hs/kr/entrydsm/identity/adapterout/security/BCryptPasswordHasher.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/out/AccountQueryPort.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/out/UserIdGenerator.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/in/command/LogoutCommand.ktsystems/identity/identity-bootstrap/src/main/kotlin/hs/kr/entrydsm/identity/config/security/JwtProperties.ktsystems/identity/identity-adapter-in/src/main/kotlin/hs/kr/entrydsm/identity/adapterin/web/dto/request/SignupRequest.ktsystems/identity/identity-application/src/test/kotlin/hs/kr/entrydsm/identity/application/service/IdentityServiceSupportTest.ktsystems/identity/identity-adapter-out/src/main/kotlin/hs/kr/entrydsm/identity/adapterout/persistence/TransactionalAccountRegistrationAdapter.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/out/AccountRegistrationPort.ktsystems/identity/identity-adapter-out/src/main/kotlin/hs/kr/entrydsm/identity/adapterout/persistence/AccountCommandPersistenceAdapter.ktsystems/identity/identity-adapter-in/src/main/kotlin/hs/kr/entrydsm/identity/adapterin/web/dto/request/PasswordResetRequest.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/service/IdentityServiceSupport.ktsystems/identity/identity-adapter-in/src/test/kotlin/hs/kr/entrydsm/TestMain.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/in/result/AuthTokenResult.ktsystems/identity/identity-application/src/test/kotlin/hs/kr/entrydsm/TestMain.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/in/AuthPort.ktsystems/identity/identity-adapter-out/src/test/kotlin/hs/kr/entrydsm/TestMain.ktsystems/identity/identity-bootstrap/src/main/kotlin/hs/kr/entrydsm/identity/config/security/JwtAuthenticationEntryPoint.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/service/IdentityResultMapper.ktsystems/identity/identity-application/src/test/kotlin/hs/kr/entrydsm/identity/application/service/IdentityResultMapperTest.ktsystems/identity/identity-bootstrap/src/main/kotlin/hs/kr/entrydsm/identity/config/security/JwtAuthorizationDeniedHandler.ktsystems/identity/identity-application/src/test/kotlin/hs/kr/entrydsm/identity/application/security/jwt/JwtTokenGeneratorTest.ktsystems/identity/identity-adapter-out/src/test/kotlin/hs/kr/entrydsm/identity/adapterout/persistence/TransactionalAccountRegistrationAdapterTest.ktsystems/identity/identity-bootstrap/src/main/kotlin/hs/kr/entrydsm/identity/config/IdentityApplicationConfig.ktsystems/identity/identity-bootstrap/src/test/kotlin/hs/kr/entrydsm/TestMain.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/security/jwt/JwtTokenGenerator.ktsystems/identity/identity-bootstrap/src/main/kotlin/hs/kr/entrydsm/identity/config/UserIdGeneratorConfig.ktsystems/identity/identity-adapter-out/src/main/kotlin/hs/kr/entrydsm/identity/adapterout/persistence/MysqlUserIdGenerator.ktsystems/identity/identity-application/src/test/kotlin/hs/kr/entrydsm/identity/application/mock/MockAuthPortAdapterTest.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/service/AuthService.ktsystems/identity/identity-adapter-in/src/test/kotlin/hs/kr/entrydsm/identity/adapterin/web/AuthControllerTest.ktsystems/identity/identity-bootstrap/src/main/kotlin/hs/kr/entrydsm/identity/config/SecurityConfig.ktsystems/identity/identity-bootstrap/src/main/kotlin/hs/kr/entrydsm/identity/config/security/JwtFilter.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/mock/MockAuthPortAdapter.ktsystems/identity/identity-bootstrap/src/test/kotlin/hs/kr/entrydsm/identity/config/security/JwtFilterTest.ktsystems/identity/identity-adapter-in/src/main/kotlin/hs/kr/entrydsm/identity/adapterin/web/AuthController.ktsystems/identity/identity-application/src/test/kotlin/hs/kr/entrydsm/identity/application/service/AuthServiceTest.kt
**/*-application/**/*.{java,kt,scala,groovy}
📄 CodeRabbit inference engine (Custom checks)
For files under *-application modules, flag direct dependency on infrastructure-specific framework classes unless justified
Files:
systems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/out/AccountCommandPort.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/in/command/LoginCommand.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/security/AuthenticatedUser.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/in/command/PasswordResetCommand.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/in/command/RefreshTokenCommand.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/in/command/SignupCommand.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/out/AccountQueryPort.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/out/UserIdGenerator.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/in/command/LogoutCommand.ktsystems/identity/identity-application/src/test/kotlin/hs/kr/entrydsm/identity/application/service/IdentityServiceSupportTest.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/out/AccountRegistrationPort.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/service/IdentityServiceSupport.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/in/result/AuthTokenResult.ktsystems/identity/identity-application/src/test/kotlin/hs/kr/entrydsm/TestMain.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/in/AuthPort.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/service/IdentityResultMapper.ktsystems/identity/identity-application/src/test/kotlin/hs/kr/entrydsm/identity/application/service/IdentityResultMapperTest.ktsystems/identity/identity-application/src/test/kotlin/hs/kr/entrydsm/identity/application/security/jwt/JwtTokenGeneratorTest.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/security/jwt/JwtTokenGenerator.ktsystems/identity/identity-application/src/test/kotlin/hs/kr/entrydsm/identity/application/mock/MockAuthPortAdapterTest.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/service/AuthService.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/mock/MockAuthPortAdapter.ktsystems/identity/identity-application/src/test/kotlin/hs/kr/entrydsm/identity/application/service/AuthServiceTest.kt
**/*.{java,kt,scala,groovy,go,js,ts,tsx,jsx,py,rb,rs,cpp,c,h,hpp,cs}
📄 CodeRabbit inference engine (Custom checks)
Flag TODO/FIXME comments introduced by this PR that do not include an issue reference in the form
#123or a full tracker key like PROJ-123
Files:
systems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/out/AccountCommandPort.ktsystems/identity/identity-adapter-out/src/main/kotlin/hs/kr/entrydsm/identity/adapterout/persistence/AccountQueryPersistenceAdapter.ktsystems/identity/identity-adapter-in/src/main/kotlin/hs/kr/entrydsm/identity/adapterin/web/dto/request/LoginRequest.ktsystems/identity/identity-adapter-in/src/test/kotlin/hs/kr/entrydsm/identity/adapterin/web/exception/GlobalExceptionHandlerTest.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/in/command/LoginCommand.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/security/AuthenticatedUser.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/in/command/PasswordResetCommand.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/in/command/RefreshTokenCommand.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/in/command/SignupCommand.ktsystems/identity/identity-adapter-out/src/main/kotlin/hs/kr/entrydsm/identity/adapterout/security/BCryptPasswordHasher.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/out/AccountQueryPort.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/out/UserIdGenerator.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/in/command/LogoutCommand.ktsystems/identity/identity-bootstrap/src/main/kotlin/hs/kr/entrydsm/identity/config/security/JwtProperties.ktsystems/identity/identity-adapter-in/src/main/kotlin/hs/kr/entrydsm/identity/adapterin/web/dto/request/SignupRequest.ktsystems/identity/identity-application/src/test/kotlin/hs/kr/entrydsm/identity/application/service/IdentityServiceSupportTest.ktsystems/identity/identity-adapter-out/src/main/kotlin/hs/kr/entrydsm/identity/adapterout/persistence/TransactionalAccountRegistrationAdapter.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/out/AccountRegistrationPort.ktsystems/identity/identity-adapter-out/src/main/kotlin/hs/kr/entrydsm/identity/adapterout/persistence/AccountCommandPersistenceAdapter.ktsystems/identity/identity-adapter-in/src/main/kotlin/hs/kr/entrydsm/identity/adapterin/web/dto/request/PasswordResetRequest.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/service/IdentityServiceSupport.ktsystems/identity/identity-adapter-in/src/test/kotlin/hs/kr/entrydsm/TestMain.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/in/result/AuthTokenResult.ktsystems/identity/identity-application/src/test/kotlin/hs/kr/entrydsm/TestMain.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/in/AuthPort.ktsystems/identity/identity-adapter-out/src/test/kotlin/hs/kr/entrydsm/TestMain.ktsystems/identity/identity-bootstrap/src/main/kotlin/hs/kr/entrydsm/identity/config/security/JwtAuthenticationEntryPoint.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/service/IdentityResultMapper.ktsystems/identity/identity-application/src/test/kotlin/hs/kr/entrydsm/identity/application/service/IdentityResultMapperTest.ktsystems/identity/identity-bootstrap/src/main/kotlin/hs/kr/entrydsm/identity/config/security/JwtAuthorizationDeniedHandler.ktsystems/identity/identity-application/src/test/kotlin/hs/kr/entrydsm/identity/application/security/jwt/JwtTokenGeneratorTest.ktsystems/identity/identity-adapter-out/src/test/kotlin/hs/kr/entrydsm/identity/adapterout/persistence/TransactionalAccountRegistrationAdapterTest.ktsystems/identity/identity-bootstrap/src/main/kotlin/hs/kr/entrydsm/identity/config/IdentityApplicationConfig.ktsystems/identity/identity-bootstrap/src/test/kotlin/hs/kr/entrydsm/TestMain.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/security/jwt/JwtTokenGenerator.ktsystems/identity/identity-bootstrap/src/main/kotlin/hs/kr/entrydsm/identity/config/UserIdGeneratorConfig.ktsystems/identity/identity-adapter-out/src/main/kotlin/hs/kr/entrydsm/identity/adapterout/persistence/MysqlUserIdGenerator.ktsystems/identity/identity-application/src/test/kotlin/hs/kr/entrydsm/identity/application/mock/MockAuthPortAdapterTest.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/service/AuthService.ktsystems/identity/identity-adapter-in/src/test/kotlin/hs/kr/entrydsm/identity/adapterin/web/AuthControllerTest.ktsystems/identity/identity-bootstrap/src/main/kotlin/hs/kr/entrydsm/identity/config/SecurityConfig.ktsystems/identity/identity-bootstrap/src/main/kotlin/hs/kr/entrydsm/identity/config/security/JwtFilter.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/mock/MockAuthPortAdapter.ktsystems/identity/identity-bootstrap/src/test/kotlin/hs/kr/entrydsm/identity/config/security/JwtFilterTest.ktsystems/identity/identity-adapter-in/src/main/kotlin/hs/kr/entrydsm/identity/adapterin/web/AuthController.ktsystems/identity/identity-application/src/test/kotlin/hs/kr/entrydsm/identity/application/service/AuthServiceTest.kt
**/*.kt
⚙️ CodeRabbit configuration file
**/*.kt: Apply Kotlin Official Coding Conventions.Formatting and structure:
- Use 4 spaces for indentation; no tabs.
- Keep files focused and readable; avoid horizontal alignment for spacing.
- Place related declarations together and keep overloads adjacent.
- Keep implementation member order stable and logical for readability.
Naming:
- Package names are lowercase and do not use underscores.
- Class/object names use UpperCamelCase.
- Functions/properties/local variables use lowerCamelCase.
- Constants use UPPER_SNAKE_CASE only for true constants.
API and null-safety:
- Avoid platform type leakage in public APIs.
- Use explicit types in public APIs when inference obscures meaning.
- Prefer immutable values (
val) over mutable values (var) unless mutation is required.- Flag nullable flows that can be replaced with safer modeling.
Imports and idioms:
- Avoid wildcard imports unless justified by language/tooling conventions.
- Prefer expression bodies for short, clear functions.
- Prefer standard library idioms over custom utility wrappers when equivalent.
Architecture and tests:
- Respect module boundaries (domain/application/adapter/bootstrap layering).
- Highlight behavior-changing code that lacks corresponding unit/integration tests.
- Ask for deterministic tests and meaningful assertions, not only happy-path checks.
Files:
systems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/out/AccountCommandPort.ktsystems/identity/identity-adapter-out/src/main/kotlin/hs/kr/entrydsm/identity/adapterout/persistence/AccountQueryPersistenceAdapter.ktsystems/identity/identity-adapter-in/src/main/kotlin/hs/kr/entrydsm/identity/adapterin/web/dto/request/LoginRequest.ktsystems/identity/identity-adapter-in/src/test/kotlin/hs/kr/entrydsm/identity/adapterin/web/exception/GlobalExceptionHandlerTest.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/in/command/LoginCommand.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/security/AuthenticatedUser.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/in/command/PasswordResetCommand.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/in/command/RefreshTokenCommand.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/in/command/SignupCommand.ktsystems/identity/identity-adapter-out/src/main/kotlin/hs/kr/entrydsm/identity/adapterout/security/BCryptPasswordHasher.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/out/AccountQueryPort.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/out/UserIdGenerator.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/in/command/LogoutCommand.ktsystems/identity/identity-bootstrap/src/main/kotlin/hs/kr/entrydsm/identity/config/security/JwtProperties.ktsystems/identity/identity-adapter-in/src/main/kotlin/hs/kr/entrydsm/identity/adapterin/web/dto/request/SignupRequest.ktsystems/identity/identity-application/src/test/kotlin/hs/kr/entrydsm/identity/application/service/IdentityServiceSupportTest.ktsystems/identity/identity-adapter-out/src/main/kotlin/hs/kr/entrydsm/identity/adapterout/persistence/TransactionalAccountRegistrationAdapter.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/out/AccountRegistrationPort.ktsystems/identity/identity-adapter-out/src/main/kotlin/hs/kr/entrydsm/identity/adapterout/persistence/AccountCommandPersistenceAdapter.ktsystems/identity/identity-adapter-in/src/main/kotlin/hs/kr/entrydsm/identity/adapterin/web/dto/request/PasswordResetRequest.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/service/IdentityServiceSupport.ktsystems/identity/identity-adapter-in/src/test/kotlin/hs/kr/entrydsm/TestMain.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/in/result/AuthTokenResult.ktsystems/identity/identity-application/src/test/kotlin/hs/kr/entrydsm/TestMain.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/in/AuthPort.ktsystems/identity/identity-adapter-out/src/test/kotlin/hs/kr/entrydsm/TestMain.ktsystems/identity/identity-bootstrap/src/main/kotlin/hs/kr/entrydsm/identity/config/security/JwtAuthenticationEntryPoint.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/service/IdentityResultMapper.ktsystems/identity/identity-application/src/test/kotlin/hs/kr/entrydsm/identity/application/service/IdentityResultMapperTest.ktsystems/identity/identity-bootstrap/src/main/kotlin/hs/kr/entrydsm/identity/config/security/JwtAuthorizationDeniedHandler.ktsystems/identity/identity-application/src/test/kotlin/hs/kr/entrydsm/identity/application/security/jwt/JwtTokenGeneratorTest.ktsystems/identity/identity-adapter-out/src/test/kotlin/hs/kr/entrydsm/identity/adapterout/persistence/TransactionalAccountRegistrationAdapterTest.ktsystems/identity/identity-bootstrap/src/main/kotlin/hs/kr/entrydsm/identity/config/IdentityApplicationConfig.ktsystems/identity/identity-bootstrap/src/test/kotlin/hs/kr/entrydsm/TestMain.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/security/jwt/JwtTokenGenerator.ktsystems/identity/identity-bootstrap/src/main/kotlin/hs/kr/entrydsm/identity/config/UserIdGeneratorConfig.ktsystems/identity/identity-adapter-out/src/main/kotlin/hs/kr/entrydsm/identity/adapterout/persistence/MysqlUserIdGenerator.ktsystems/identity/identity-application/src/test/kotlin/hs/kr/entrydsm/identity/application/mock/MockAuthPortAdapterTest.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/service/AuthService.ktsystems/identity/identity-adapter-in/src/test/kotlin/hs/kr/entrydsm/identity/adapterin/web/AuthControllerTest.ktsystems/identity/identity-bootstrap/src/main/kotlin/hs/kr/entrydsm/identity/config/SecurityConfig.ktsystems/identity/identity-bootstrap/src/main/kotlin/hs/kr/entrydsm/identity/config/security/JwtFilter.ktsystems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/mock/MockAuthPortAdapter.ktsystems/identity/identity-bootstrap/src/test/kotlin/hs/kr/entrydsm/identity/config/security/JwtFilterTest.ktsystems/identity/identity-adapter-in/src/main/kotlin/hs/kr/entrydsm/identity/adapterin/web/AuthController.ktsystems/identity/identity-application/src/test/kotlin/hs/kr/entrydsm/identity/application/service/AuthServiceTest.kt
**/{BUILD.bazel,*.bzl}
📄 CodeRabbit inference engine (Custom checks)
In BUILD.bazel and .bzl files, require buildifier-compatible formatting and stable target naming
Files:
systems/identity/identity-adapter-out/deps.bzlsystems/identity/identity-adapter-in/deps.bzlsystems/identity/identity-adapter-in/BUILD.bazelsystems/identity/identity-bootstrap/BUILD.bazelsystems/identity/identity-bootstrap/deps.bzlsystems/identity/identity-application/BUILD.bazelsystems/identity/identity-application/deps.bzl
**/*.bzl
⚙️ CodeRabbit configuration file
**/*.bzl: Apply Bazel Starlark (.bzl) style guidance.Readability and docs:
- Keep file/module docstrings and docstrings for public functions/macros.
- Use descriptive parameter names and document attribute intent.
API design:
- Macros should take a
nameargument and derive generated target names from it.- Prefer keyword arguments when calling macros for clarity and stability.
- Keep macro side effects predictable and visible.
Encapsulation:
- Use private visibility for helper targets created by macros unless explicitly public.
- Avoid exposing internal implementation targets unintentionally.
Tooling:
- Enforce buildifier formatting and lint compliance.
Files:
systems/identity/identity-adapter-out/deps.bzlsystems/identity/identity-adapter-in/deps.bzlsystems/identity/identity-bootstrap/deps.bzlsystems/identity/identity-application/deps.bzl
**/BUILD.bazel
⚙️ CodeRabbit configuration file
**/BUILD.bazel: Apply Bazel BUILD style guidance.Core rules:
- BUILD formatting must match buildifier output.
- Prefer DAMP BUILD files over over-abstracted DRY patterns.
- Keep top-level layout clear: load() first, then package/default visibility, then targets.
Target definitions:
- Keep deps explicit and close to each target's real direct dependencies.
- Avoid recursive globs unless there is a clear, documented reason.
- Avoid top-level list comprehensions for generating many targets.
- Prefer literal labels and stable naming for readability and tooling compatibility.
- Use boolean values (True/False), not numeric stand-ins.
Maintenance:
- Flag duplicated target logic that should be moved into a macro.
- Flag macro usage that hides important dependency or visibility decisions.
Files:
systems/identity/identity-adapter-in/BUILD.bazelsystems/identity/identity-bootstrap/BUILD.bazelsystems/identity/identity-application/BUILD.bazel
🪛 ast-grep (0.44.1)
systems/identity/identity-application/src/test/kotlin/hs/kr/entrydsm/identity/application/security/jwt/JwtTokenGeneratorTest.kt
[warning] 83-83: A credential is hard-coded by assigning a string literal to a password/secret/API-key variable. Secrets stored in source code can be leaked and abused by internal or external malicious actors. Remove the literal, rotate the exposed secret, and load it at runtime from an environment variable, a secure secret vault, or a Hardware Security Module (HSM).
Context: const val SECRET = "01234567890123456789012345678901"
Note: [CWE-798]: Use of Hard-coded Credentials [OWASP A07:2021]: Identification and Authentication Failures
(hardcoded-password-string-literal-kotlin)
systems/identity/identity-application/src/test/kotlin/hs/kr/entrydsm/identity/application/mock/MockAuthPortAdapterTest.kt
[warning] 35-35: A credential is hard-coded by assigning a string literal to a password/secret/API-key variable. Secrets stored in source code can be leaked and abused by internal or external malicious actors. Remove the literal, rotate the exposed secret, and load it at runtime from an environment variable, a secure secret vault, or a Hardware Security Module (HSM).
Context: const val SECRET = "01234567890123456789012345678901"
Note: [CWE-798]: Use of Hard-coded Credentials [OWASP A07:2021]: Identification and Authentication Failures
(hardcoded-password-string-literal-kotlin)
systems/identity/identity-bootstrap/src/main/kotlin/hs/kr/entrydsm/identity/config/security/JwtFilter.kt
[warning] 112-112: A credential is hard-coded by assigning a string literal to a password/secret/API-key variable. Secrets stored in source code can be leaked and abused by internal or external malicious actors. Remove the literal, rotate the exposed secret, and load it at runtime from an environment variable, a secure secret vault, or a Hardware Security Module (HSM).
Context: private const val ACCESS_TOKEN_COOKIE = "access_token"
Note: [CWE-798]: Use of Hard-coded Credentials [OWASP A07:2021]: Identification and Authentication Failures
(hardcoded-password-string-literal-kotlin)
[warning] 113-113: A credential is hard-coded by assigning a string literal to a password/secret/API-key variable. Secrets stored in source code can be leaked and abused by internal or external malicious actors. Remove the literal, rotate the exposed secret, and load it at runtime from an environment variable, a secure secret vault, or a Hardware Security Module (HSM).
Context: private const val ACCESS_TOKEN_TYPE = "access"
Note: [CWE-798]: Use of Hard-coded Credentials [OWASP A07:2021]: Identification and Authentication Failures
(hardcoded-password-string-literal-kotlin)
systems/identity/identity-bootstrap/src/test/kotlin/hs/kr/entrydsm/identity/config/security/JwtFilterTest.kt
[warning] 164-164: A credential is hard-coded by assigning a string literal to a password/secret/API-key variable. Secrets stored in source code can be leaked and abused by internal or external malicious actors. Remove the literal, rotate the exposed secret, and load it at runtime from an environment variable, a secure secret vault, or a Hardware Security Module (HSM).
Context: const val SECRET = "01234567890123456789012345678901"
Note: [CWE-798]: Use of Hard-coded Credentials [OWASP A07:2021]: Identification and Authentication Failures
(hardcoded-password-string-literal-kotlin)
systems/identity/identity-application/src/test/kotlin/hs/kr/entrydsm/identity/application/service/AuthServiceTest.kt
[warning] 216-216: A credential is hard-coded by assigning a string literal to a password/secret/API-key variable. Secrets stored in source code can be leaked and abused by internal or external malicious actors. Remove the literal, rotate the exposed secret, and load it at runtime from an environment variable, a secure secret vault, or a Hardware Security Module (HSM).
Context: const val SECRET = "01234567890123456789012345678901"
Note: [CWE-798]: Use of Hard-coded Credentials [OWASP A07:2021]: Identification and Authentication Failures
(hardcoded-password-string-literal-kotlin)
🪛 detekt (1.23.8)
systems/identity/identity-adapter-out/src/main/kotlin/hs/kr/entrydsm/identity/adapterout/persistence/MysqlUserIdGenerator.kt
[warning] 26-26: The caught exception is too generic. Prefer catching specific exceptions to the case that is currently handled.
(detekt.exceptions.TooGenericExceptionCaught)
🔇 Additional comments (50)
systems/identity/identity-adapter-in/BUILD.bazel (1)
14-21: LGTM!systems/identity/identity-adapter-in/deps.bzl (1)
1-11: LGTM!systems/identity/identity-adapter-in/src/main/kotlin/hs/kr/entrydsm/identity/adapterin/web/AuthController.kt (1)
1-138: LGTM!systems/identity/identity-adapter-in/src/main/kotlin/hs/kr/entrydsm/identity/adapterin/web/dto/request/LoginRequest.kt (1)
1-9: LGTM!systems/identity/identity-adapter-in/src/main/kotlin/hs/kr/entrydsm/identity/adapterin/web/dto/request/PasswordResetRequest.kt (1)
1-12: LGTM!systems/identity/identity-adapter-in/src/main/kotlin/hs/kr/entrydsm/identity/adapterin/web/dto/request/SignupRequest.kt (1)
1-14: LGTM!systems/identity/identity-adapter-in/src/test/kotlin/hs/kr/entrydsm/TestMain.kt (1)
3-13: LGTM!systems/identity/identity-adapter-in/src/test/kotlin/hs/kr/entrydsm/identity/adapterin/web/AuthControllerTest.kt (1)
1-210: LGTM!systems/identity/identity-adapter-in/src/test/kotlin/hs/kr/entrydsm/identity/adapterin/web/exception/GlobalExceptionHandlerTest.kt (1)
1-42: LGTM!systems/identity/identity-bootstrap/BUILD.bazel (1)
28-30: LGTM!systems/identity/identity-bootstrap/deps.bzl (1)
3-3: LGTM!Also applies to: 10-12
systems/identity/identity-bootstrap/src/main/kotlin/hs/kr/entrydsm/identity/config/IdentityApplicationConfig.kt (1)
14-35: LGTM!systems/identity/identity-bootstrap/src/main/kotlin/hs/kr/entrydsm/identity/config/SecurityConfig.kt (2)
29-98: LGTM!
100-132: LGTM!systems/identity/identity-bootstrap/src/main/kotlin/hs/kr/entrydsm/identity/config/UserIdGeneratorConfig.kt (1)
9-14: LGTM!systems/identity/identity-bootstrap/src/main/kotlin/hs/kr/entrydsm/identity/config/security/JwtAuthenticationEntryPoint.kt (1)
14-33: LGTM!systems/identity/identity-bootstrap/src/main/kotlin/hs/kr/entrydsm/identity/config/security/JwtAuthorizationDeniedHandler.kt (1)
14-33: LGTM!systems/identity/identity-bootstrap/src/main/kotlin/hs/kr/entrydsm/identity/config/security/JwtFilter.kt (3)
22-64: LGTM!
66-108: LGTM!
110-123: LGTM!systems/identity/identity-bootstrap/src/main/kotlin/hs/kr/entrydsm/identity/config/security/JwtProperties.kt (1)
5-9: LGTM!systems/identity/identity-bootstrap/src/test/kotlin/hs/kr/entrydsm/TestMain.kt (1)
21-47: LGTM!systems/identity/identity-application/BUILD.bazel (1)
20-22: LGTM!systems/identity/identity-application/deps.bzl (1)
3-5: LGTM!Also applies to: 10-10
systems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/mock/MockAuthPortAdapter.kt (1)
16-51: LGTM!systems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/out/UserIdGenerator.kt (1)
3-5: LGTM!systems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/security/AuthenticatedUser.kt (1)
3-5: LGTM!systems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/security/jwt/JwtTokenGenerator.kt (1)
17-65: LGTM!Also applies to: 69-84
systems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/service/IdentityResultMapper.kt (1)
9-26: LGTM!systems/identity/identity-application/src/test/kotlin/hs/kr/entrydsm/TestMain.kt (1)
3-19: LGTM!systems/identity/identity-application/src/test/kotlin/hs/kr/entrydsm/identity/application/mock/MockAuthPortAdapterTest.kt (1)
16-46: LGTM!systems/identity/identity-application/src/test/kotlin/hs/kr/entrydsm/identity/application/security/jwt/JwtTokenGeneratorTest.kt (1)
13-85: LGTM!systems/identity/identity-application/src/test/kotlin/hs/kr/entrydsm/identity/application/service/IdentityResultMapperTest.kt (1)
17-61: LGTM!systems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/in/AuthPort.kt (1)
1-21: LGTM!systems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/in/command/LoginCommand.kt (1)
1-8: LGTM!systems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/in/command/LogoutCommand.kt (1)
1-5: LGTM!systems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/in/command/RefreshTokenCommand.kt (1)
1-7: LGTM!systems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/out/AccountCommandPort.kt (1)
1-8: LGTM!systems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/out/AccountRegistrationPort.kt (1)
1-9: LGTM!systems/identity/identity-application/src/test/kotlin/hs/kr/entrydsm/identity/application/service/AuthServiceTest.kt (1)
7-138: LGTM!Also applies to: 149-180, 194-220
systems/identity/identity-adapter-out/src/test/kotlin/hs/kr/entrydsm/TestMain.kt (1)
3-23: LGTM!systems/identity/identity-adapter-out/src/test/kotlin/hs/kr/entrydsm/identity/adapterout/persistence/TransactionalAccountRegistrationAdapterTest.kt (1)
1-52: LGTM!systems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/in/result/AuthTokenResult.kt (1)
6-15: LGTM!systems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/out/AccountQueryPort.kt (1)
5-10: LGTM!systems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/service/AuthService.kt (1)
25-78: LGTM!Also applies to: 92-121
systems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/service/IdentityServiceSupport.kt (1)
11-21: LGTM!systems/identity/identity-adapter-out/src/main/kotlin/hs/kr/entrydsm/identity/adapterout/persistence/AccountCommandPersistenceAdapter.kt (1)
8-14: LGTM!systems/identity/identity-adapter-out/src/main/kotlin/hs/kr/entrydsm/identity/adapterout/persistence/AccountQueryPersistenceAdapter.kt (1)
8-17: LGTM!systems/identity/identity-adapter-out/src/main/kotlin/hs/kr/entrydsm/identity/adapterout/persistence/TransactionalAccountRegistrationAdapter.kt (1)
11-21: LGTM!systems/identity/identity-adapter-out/src/main/kotlin/hs/kr/entrydsm/identity/adapterout/security/BCryptPasswordHasher.kt (1)
8-17: LGTM!
| KOTLIN_DEPS = [ | ||
| "@maven//:org_springframework_boot_spring_boot_starter_data_jpa", | ||
| "@maven//:org_springframework_boot_spring_boot_starter_security", | ||
| "//systems/identity/identity-application:main", | ||
| "//systems/identity/identity-domain:main", | ||
| ] |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
rg -n --glob '*.bzl' \
'org_springframework_boot_spring_boot_starter_security|org_springframework_security_spring_security_crypto' .
buildifier -mode=check systems/identity/identity-adapter-out/deps.bzlRepository: EntryDSM/entrydsm-platform
Length of output: 572
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "## relevant deps.bzl files"
for f in systems/identity/identity-bootstrap/deps.bzl systems/identity/identity-adapter-in/deps.bzl systems/identity/identity-adapter-out/deps.bzl; do
echo "--- $f"
cat -n "$f"
done
echo
echo "## BCryptPasswordEncoder usages"
rg -n "BCryptPasswordEncoder|new BCrypt|BCrypt" .Repository: EntryDSM/entrydsm-platform
Length of output: 2756
🌐 Web query:
Maven Central spring-security-crypto dependency coordinate org.springframework.security spring-security-crypto
💡 Result:
The dependency coordinate for Spring Security Crypto on Maven Central is: Group ID: org.springframework.security Artifact ID: spring-security-crypto For Maven projects, you can include it in your pom.xml file as follows: org.springframework.security spring-security-crypto 7.0.5 For Gradle projects, you can add it to your build.gradle file: implementation("org.springframework.security:spring-security-crypto:7.0.5") This module provides support for symmetric encryption, key generation, and password encoding and is designed to have no dependencies on other Spring Security or Spring Framework code [1]. Version 7.0.5 is a recent release available on Maven Central [2][3].
Citations:
- 1: https://docs.spring.io/spring-security/reference/features/integrations/cryptography.html
- 2: https://central.sonatype.com/artifact/org.springframework.security/spring-security-crypto
- 3: https://central.sonatype.com/artifact/org.springframework.security/spring-security-crypto/7.0.5
Security starter 대신 crypto 라이브러리로 의존성을 좁히세요.
identity-adapter-out은 BCryptPasswordEncoder만 직접 참조하는데, spring-boot-starter-security를 가져와 불필요한 Spring Security 트랜지티브 의존성을 생성합니다. @maven//:org_springframework_boot_spring_boot_starter_security 대신 org.springframework.security:spring-security-crypto Maven 라벨을 선언하세요.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@systems/identity/identity-adapter-out/deps.bzl` around lines 1 - 6,
KOTLIN_DEPS에서 spring-boot-starter-security 의존성을 제거하고, BCryptPasswordEncoder 사용에
필요한 spring-security-crypto Maven 라벨로 교체하세요. 기존 JPA 및 애플리케이션·도메인 의존성은 유지하세요.
Source: Path instructions
| /** | ||
| * Allocates user IDs from a durable MySQL counter row. | ||
| * | ||
| * The counter row must be created by the database schema: | ||
| * `identity_user_id_sequence(sequence_name VARCHAR(32) PRIMARY KEY, next_id BIGINT NOT NULL)`. | ||
| */ |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
시퀀스 테이블과 초기 행을 생성하는 migration을 함께 추가하세요.
이 구현은 identity_user_id_sequence와 USER 행이 존재한다고 가정합니다. PR 범위에서 migration이 제외되어 현재 상태로는 첫 회원가입이 SQL 오류로 실패합니다. 테이블 생성과 초기 next_id 삽입 migration을 포함하세요.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In
`@systems/identity/identity-adapter-out/src/main/kotlin/hs/kr/entrydsm/identity/adapterout/persistence/MysqlUserIdGenerator.kt`
around lines 7 - 12, 추가된 MysqlUserIdGenerator가 의존하는 identity_user_id_sequence
테이블과 초기 USER 행을 생성하는 migration을 추가하세요. 스키마는 sequence_name을 VARCHAR(32) 기본 키로,
next_id를 BIGINT NOT NULL로 정의하고, USER 키의 next_id 초기값을 설정해 첫 회원가입이 정상적으로 ID를 할당하도록
하세요.
| data class SignupCommand( | ||
| val password: String, | ||
| val name: String, | ||
| val phone: String, | ||
| val birthdate: LocalDate, | ||
| val signupType: SignupType, | ||
| ) |
There was a problem hiding this comment.
🔒 Security & Privacy | 🟠 Major | ⚡ Quick win
인증 커맨드의 toString()에서 자격증명과 PII를 모두 마스킹하세요.
SignupCommand는 기본 toString()으로 password, 이름, 전화번호, 생년월일을 노출하고, PasswordResetCommand도 loginId·이름·생년월일을 노출합니다. 로그나 예외에 포함되면 자격증명 및 개인정보가 유출됩니다.
systems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/in/command/SignupCommand.kt#L6-L12: password와 가입자 PII를 마스킹하는toString()을 구현하세요.systems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/in/command/PasswordResetCommand.kt#L5-L12: 현재 노출되는 loginId, name, birthdate도 마스킹하세요.
📍 Affects 2 files
systems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/in/command/SignupCommand.kt#L6-L12(this comment)systems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/in/command/PasswordResetCommand.kt#L5-L12
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In
`@systems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/in/command/SignupCommand.kt`
around lines 6 - 12, Implement safe toString() overrides for SignupCommand in
systems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/in/command/SignupCommand.kt#L6-L12
and PasswordResetCommand in
systems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/in/command/PasswordResetCommand.kt#L5-L12,
masking password, loginId, name, phone, and birthdate while preserving only
non-sensitive fields such as signupType; ensure no credential or PII is emitted
in logs or exceptions.
| override fun refreshToken(command: RefreshTokenCommand): AuthTokenResult { | ||
| val token = command.refreshToken?.takeIf { it.isNotBlank() } | ||
| ?: throw IdentityDomainException(ErrorCode.INVALID_REFRESH_TOKEN) | ||
| if (token.startsWith("expired-")) { | ||
| throw IdentityDomainException(ErrorCode.EXPIRED_REFRESH_TOKEN) | ||
| } | ||
| if (token != "mock-refresh-token") { | ||
| throw IdentityDomainException(ErrorCode.INVALID_REFRESH_TOKEN) | ||
| } | ||
| return issueTokens(userId = 123L, role = "STUDENT", status = AccountStatus.ACTIVE) |
There was a problem hiding this comment.
🔒 Security & Privacy | 🔴 Critical | 🏗️ Heavy lift
운영 경로의 고정 mock refresh token 검증을 제거하세요.
Line 86의 고정 값은 누구나 userId=123, role=STUDENT 토큰을 발급받게 하며, 동일 파일 Line 115-116에서 발급한 실제 refresh JWT는 거절됩니다. 서명·만료·토큰 유형을 검증한 뒤 subject의 계정을 조회하여 토큰을 재발급하도록 바꾸세요.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In
`@systems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/service/AuthService.kt`
around lines 80 - 89, Remove the hardcoded "mock-refresh-token" validation from
AuthService.refreshToken and replace it with verification of the refresh JWT’s
signature, expiration, and token type. Extract the verified subject, load the
corresponding account, and issue tokens using that account’s user ID, role, and
status; preserve invalid and expired token errors and ensure refresh JWTs
generated by the existing token issuance flow are accepted.
| import hs.kr.entrydsm.identity.application.port.`in`.command.LoginCommand | ||
| import hs.kr.entrydsm.identity.application.port.`in`.command.LogoutCommand | ||
| import hs.kr.entrydsm.identity.application.port.`in`.command.PasswordResetCommand | ||
| import hs.kr.entrydsm.identity.application.port.`in`.command.SignupCommand |
There was a problem hiding this comment.
🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
FILE="systems/identity/identity-application/src/test/kotlin/hs/kr/entrydsm/identity/application/service/AuthServiceTest.kt"
echo "== file exists =="
test -f "$FILE" && echo yes || echo no
echo "== imports and relevant usages =="
rg -n "import .*Command|RefreshTokenCommand|RefreshToken|refreshToken|Line 142|142" "$FILE" || true
sed -n '1,30p;130,150p' "$FILE"
echo "== source declaration candidates =="
fd -i "RefreshTokenCommand.kt|RefreshToken" . | sed -n '1,80p'
echo "== precise usage/import probe =="
python3 - <<'PY'
from pathlib import Path
p = Path("systems/identity/identity-application/src/test/kotlin/hs/kr/entrydsm/identity/application/service/AuthServiceTest.kt")
src = p.read_text()
lines = src.splitlines()
need_import = set()
for i,l in enumerate(lines,1):
if "RefreshTokenCommand" in l:
print(f"{i}:{l.strip()}")
imports = {line.strip() for line in lines if line.startswith("import ")}
for name in ("hs.kr.entrydsm.identity.application.port.`in`.command.RefreshTokenCommand", "RefreshTokenCommand"):
print(f"{name} present in imports:", any(name in imp for imp in imports))
PYRepository: EntryDSM/entrydsm-platform
Length of output: 3800
RefreshTokenCommand import를 추가하세요.
AuthServiceTest.kt에서 142, 151행에 RefreshTokenCommand를 사용하고 있지만 import가 없어 테스트 파일이 컴파일되지 않습니다.
수정 예시
import hs.kr.entrydsm.identity.application.port.`in`.command.PasswordResetCommand
+import hs.kr.entrydsm.identity.application.port.`in`.command.RefreshTokenCommand
import hs.kr.entrydsm.identity.application.port.`in`.command.SignupCommand📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| import hs.kr.entrydsm.identity.application.port.`in`.command.LoginCommand | |
| import hs.kr.entrydsm.identity.application.port.`in`.command.LogoutCommand | |
| import hs.kr.entrydsm.identity.application.port.`in`.command.PasswordResetCommand | |
| import hs.kr.entrydsm.identity.application.port.`in`.command.SignupCommand | |
| import hs.kr.entrydsm.identity.application.port.`in`.command.LoginCommand | |
| import hs.kr.entrydsm.identity.application.port.`in`.command.LogoutCommand | |
| import hs.kr.entrydsm.identity.application.port.`in`.command.PasswordResetCommand | |
| import hs.kr.entrydsm.identity.application.port.`in`.command.RefreshTokenCommand | |
| import hs.kr.entrydsm.identity.application.port.`in`.command.SignupCommand |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In
`@systems/identity/identity-application/src/test/kotlin/hs/kr/entrydsm/identity/application/service/AuthServiceTest.kt`
around lines 3 - 6, AuthServiceTest.kt에서 사용하는 RefreshTokenCommand가 import되지
않았습니다. 기존 command import 목록에
hs.kr.entrydsm.identity.application.port.`in`.command.RefreshTokenCommand
import를 추가해 테스트가 컴파일되도록 수정하세요.
| private fun service( | ||
| registration: AccountRegistrationPort = AccountRegistrationPort { account -> account }, |
There was a problem hiding this comment.
🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== locate files =="
git ls-files | rg 'AuthServiceTest\.kt|AccountRegistrationPort|AuthService'
echo "== inspect test around register/service helper =="
if [ -f systems/identity/identity-application/src/test/kotlin/hs/kr/entrydsm/identity/application/service/AuthServiceTest.kt ]; then
sed -n '150,210p' systems/identity/identity-application/src/test/kotlin/hs/kr/entrydsm/identity/application/service/AuthServiceTest.kt | cat -n
fi
echo "== search AccountRegistrationPort definitions/usages =="
rg -n "interface AccountRegistrationPort|class AccountRegistrationPort|typealias AccountRegistrationPort|AccountRegistrationPort" -S .Repository: EntryDSM/entrydsm-platform
Length of output: 5370
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== locate files =="
git ls-files | rg 'AuthServiceTest\.kt|AccountRegistrationPort|AuthService'
echo "== inspect test around register/service helper =="
if [ -f systems/identity/identity-application/src/test/kotlin/hs/kr/entrydsm/identity/application/service/AuthServiceTest.kt ];则
sed -n '150,210p' systems/identity/identity-application/src/test/kotlin/hs/kr/entrydsm/identity/application/service/AuthServiceTest.kt | cat -n
fi
echo "== search AccountRegistrationPort definitions/usages =="
rg -n "interface AccountRegistrationPort|class AccountRegistrationPort|typealias AccountRegistrationPort|AccountRegistrationPort" -S .Repository: EntryDSM/entrydsm-platform
Length of output: 644
🏁 Script executed:
#!/bin/bash
set -euo pipefail
python3 - <<'PY'
from pathlib import Path
import re
for p in [
"systems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/out/AccountRegistrationPort.kt",
"systems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/service/AuthService.kt",
"systems/identity/identity-application/src/test/kotlin/hs/kr/entrydsm/identity/application/service/AuthServiceTest.kt",
]:
if not Path(p).exists():
print(f"MISSING: {p}")
continue
text = Path(p).read_text()
print(f"\n== {p} ==")
for i, line in enumerate(text.splitlines(), start=1):
if any(tok in line for tok in ["interface AccountRegistrationPort", "AccountRegistrationPort {", "register(", "fun service(", "AccountRegistrationPort { account -> account", "AccountRegistrationPort { account, _ ->"]):
print(f"{i:4}: {line}")
PORT = Path("systems/identity/identity-application/src/main/kotlin/hs/kr/entrydsm/identity/application/port/out/AccountRegistrationPort.kt").read_text()
MATCH = re.search(r"fun interface AccountRegistrationPort\s*\{([^}]*)\}", PORT, re.S)
if MATCH:
body = MATCH.group(1)
print(f"\n== extracted function interface body ==")
print(body.strip())
print("parameter_count_estimate:", body.count(","))
PYRepository: EntryDSM/entrydsm-platform
Length of output: 1057
기본 AccountRegistrationPort 람다의 인자를 두 개로 맞추세요.
register가 Account, Instant 두 인자를 받기 때문에 기본값 람다도 두 번째 인자를 표현해야 컴파일됩니다.
수정 예시
- registration: AccountRegistrationPort = AccountRegistrationPort { account -> account },
+ registration: AccountRegistrationPort = AccountRegistrationPort { account, _ -> account },📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| private fun service( | |
| registration: AccountRegistrationPort = AccountRegistrationPort { account -> account }, | |
| private fun service( | |
| registration: AccountRegistrationPort = AccountRegistrationPort { account, _ -> account }, |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In
`@systems/identity/identity-application/src/test/kotlin/hs/kr/entrydsm/identity/application/service/AuthServiceTest.kt`
around lines 182 - 183, Update the default AccountRegistrationPort lambda in the
service helper to accept both register arguments, Account and Instant, while
preserving the existing account-returning behavior.
| @Test(expected = IdentityDomainException::class) | ||
| fun signupValidationRejectsBlankRequiredFields() { | ||
| requireValidSignup( | ||
| SignupCommand( | ||
| password = "", | ||
| name = "홍길동", | ||
| phone = "01012345678", | ||
| birthdate = LocalDate.of(2009, 3, 15), | ||
| signupType = SignupType.SELF, | ||
| ) | ||
| ) | ||
| } |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
예외 유형뿐 아니라 오류 코드도 검증하세요.
현재는 어떤 IdentityDomainException이 발생해도 통과합니다. 예외를 캡처하고 INVALID_REQUEST_BODY를 assertion하여 입력 검증 계약을 고정하세요.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In
`@systems/identity/identity-application/src/test/kotlin/hs/kr/entrydsm/identity/application/service/IdentityServiceSupportTest.kt`
around lines 10 - 21, Update signupValidationRejectsBlankRequiredFields to
capture the thrown IdentityDomainException instead of using the expected
annotation, then assert that its error code is INVALID_REQUEST_BODY. Preserve
the existing invalid SignupCommand setup and requireValidSignup invocation.
Source: Path instructions
| fun tamperedAndMalformedTokensReturnUnauthorized() { | ||
| val tamperedResult = runFilter(accessToken().dropLast(1) + "x") | ||
| val malformedResult = runFilter("not-a-jwt") |
There was a problem hiding this comment.
🔒 Security & Privacy | 🟡 Minor | ⚡ Quick win
서명 불일치를 결정적으로 만들도록 변경하세요.
마지막 Base64URL 문자만 바꾸면 패딩 비트만 달라져 동일한 서명 바이트로 해석될 수 있습니다. 다른 비밀키로 발급한 정상 형식 JWT를 사용해 서명 검증 실패를 보장하세요.
수정 예시
- val tamperedResult = runFilter(accessToken().dropLast(1) + "x")
+ val tamperedResult = runFilter(
+ JwtTokenGenerator(
+ secret = "abcdefghijklmnopqrstuvwxyz123456",
+ issuer = ISSUER,
+ clock = Clock.fixed(FIXED_NOW, UTC),
+ ).generateAccessToken("user_123").value
+ )📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| fun tamperedAndMalformedTokensReturnUnauthorized() { | |
| val tamperedResult = runFilter(accessToken().dropLast(1) + "x") | |
| val malformedResult = runFilter("not-a-jwt") | |
| fun tamperedAndMalformedTokensReturnUnauthorized() { | |
| val tamperedResult = runFilter( | |
| JwtTokenGenerator( | |
| secret = "abcdefghijklmnopqrstuvwxyz123456", | |
| issuer = ISSUER, | |
| clock = Clock.fixed(FIXED_NOW, UTC), | |
| ).generateAccessToken("user_123").value | |
| ) | |
| val malformedResult = runFilter("not-a-jwt") |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In
`@systems/identity/identity-bootstrap/src/test/kotlin/hs/kr/entrydsm/identity/config/security/JwtFilterTest.kt`
around lines 50 - 52, Update tamperedAndMalformedTokensReturnUnauthorized so the
tampered case uses a well-formed JWT issued with a different secret key,
ensuring signature verification deterministically fails; keep the malformed
“not-a-jwt” case and existing unauthorized assertions unchanged.
Summary
jjwt-api,jjwt-impl,jjwt-jackson을 Bazel Maven 의존성으로 등록하고 기존 Nimbus 의존성을 제거했습니다.AuthenticatedUser로 SecurityContext에 저장합니다.Related Issue
Scope
/api/identity/v11/auth/signup/api/identity/v11/auth/login/api/identity/v11/auth/logout/api/identity/v11/auth/token/api/identity/v11/auth/password-resetImplementation
AuthPort의 login/refresh 결과인AuthTokenResult에 access·refreshJwtToken을 포함했습니다.AuthService와MockAuthPortAdapter가 주입된JwtTokenGenerator로 토큰을 발급하며, controller는 cookie 설정과 응답 변환만 담당합니다.JwtTokenGenerator는 JJWT의Jwts.builder()로 HS256 토큰을 생성하고,JwtFilter는verifyWith·parseSignedClaims로 서명·issuer·type·만료·principal 형식을 검증합니다.AuthenticatedUser로 변환하고 logout은 raw 문자열 principal을 받지 않습니다.AccountRegistrationPort구현체는 계정과 지원서 초기화를 하나의@Transactional경계로 묶습니다.ClockBean은 선행 PR #52에서 제공되며, 이 PR에서는 생성자 주입으로 사용합니다.81ec990 refactor(identity): JWT 구현을 JJWT로 교체 #48Testing
git diff --check통과Deployment Notes
auth.jwt.secret은 최소 32바이트,auth.jwt.issuer는 배포 환경에서 주입해야 합니다.Checklist