-
Notifications
You must be signed in to change notification settings - Fork 0
가입 프로필 정책 개편 및 닉네임 중복검사 API 추가 #32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -42,6 +42,8 @@ bin/ | |
| .DS_Store | ||
|
|
||
| .env | ||
| .env.aws | ||
| .env.prod | ||
| .claudeignore | ||
| .claude | ||
| .mcp.json | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| # AWS 환경 설정 - Docker 컨테이너 간 통신용 | ||
| server: | ||
| port: 9003 | ||
|
|
||
| spring: | ||
| application: | ||
| name: chat-service | ||
|
|
||
| data: | ||
| mongodb: | ||
| host: mongodb | ||
| port: 27017 | ||
| database: comatching_chat | ||
| auto-index-creation: true | ||
|
|
||
| kafka: | ||
| bootstrap-servers: kafka:29092 | ||
| producer: | ||
| key-serializer: org.apache.kafka.common.serialization.StringSerializer | ||
| value-serializer: org.springframework.kafka.support.serializer.JsonSerializer | ||
| consumer: | ||
| group-id: chat-service-group | ||
| auto-offset-reset: latest | ||
| key-deserializer: org.apache.kafka.common.serialization.StringDeserializer | ||
| value-deserializer: org.apache.kafka.common.serialization.StringDeserializer | ||
|
|
||
| cloud: | ||
| aws: | ||
| credentials: | ||
| access-key: ${AWS_ACCESS_KEY} | ||
| secret-key: ${AWS_SECRET_KEY} | ||
| region: | ||
| static: ap-northeast-2 | ||
| s3: | ||
| bucket: ${AWS_S3_BUCKET} | ||
|
|
||
| jwt: | ||
| secret: ${JWT_SECRET} | ||
| access-token: | ||
| expiration: ${ACCESS_TOKEN_EXP:86400000} | ||
| refresh-token: | ||
| expiration: ${REFRESH_TOKEN_EXP:604800000} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,9 +14,10 @@ public static ResponseCookie createAccessTokenCookie(String accessToken) { | |
| return ResponseCookie.from("accessToken", accessToken) | ||
| .path("/") | ||
| .httpOnly(true) | ||
| .secure(false) // HTTPS 환경에서는 true | ||
| .secure(false) | ||
| .maxAge(Duration.ofDays(1).toSeconds()) | ||
| .sameSite("Lax") | ||
| // .domain("comatching.site") | ||
| .build(); | ||
| } | ||
|
|
||
|
|
@@ -25,9 +26,10 @@ public static ResponseCookie createRefreshTokenCookie(String refreshToken) { | |
| return ResponseCookie.from("refreshToken", refreshToken) | ||
| .path("/api/auth") | ||
| .httpOnly(true) | ||
| .secure(false) // HTTPS 환경에서는 true | ||
| .secure(false) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||
| .maxAge(Duration.ofDays(7).toSeconds()) | ||
| .sameSite("Lax") | ||
| .domain("comatching.site") | ||
| .build(); | ||
| } | ||
|
|
||
|
|
@@ -36,7 +38,8 @@ public static ResponseCookie createExpiredCookie(String cookieName) { | |
| return ResponseCookie.from(cookieName, "") | ||
| .path(cookieName.equals("accessToken") ? "/" :"/api/auth") | ||
| .httpOnly(true) | ||
| .maxAge(0) // 즉시 만료 | ||
| .maxAge(0) | ||
| .domain("comatching.site") | ||
| .build(); | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,100 @@ | ||
| # AWS 환경 설정 - Docker 컨테이너 간 통신용 | ||
| server: | ||
| port: 8080 | ||
|
|
||
| spring: | ||
| application: | ||
| name: gateway-service | ||
|
|
||
| cloud: | ||
| gateway: | ||
| server: | ||
| webflux: | ||
| # CORS 설정 | ||
| globalcors: | ||
| cors-configurations: | ||
| '[/**]': | ||
| allowedOrigins: | ||
| - "https://comatching.site" | ||
| - "http://localhost:3000" | ||
| - "http://localhost:5173" | ||
| allowedMethods: [GET, POST, PUT, DELETE, OPTIONS] | ||
| allowedHeaders: "*" | ||
| allowCredentials: true | ||
|
|
||
| # 라우팅 규칙 - 컨테이너 이름 사용 | ||
| routes: | ||
| - id: user-service-public | ||
| uri: http://user-service:9000 | ||
| predicates: | ||
| - Path=/api/auth/login, /api/auth/signup, /api/auth/signup/nickname/availability, /api/auth/participants, /api/auth/email/**, /oauth2/**, /login/**, /default-ui.css | ||
|
|
||
| - id: user-service-protected | ||
| uri: http://user-service:9000 | ||
| predicates: | ||
| - Path=/api/auth/signup/profile, /api/auth/logout, /api/auth/reissue, /api/auth/password/**, /api/auth/withdraw, /api/members/**, /api/internal/users/** | ||
| filters: | ||
| - AuthorizationHeaderFilter | ||
|
|
||
| - id: user-service-swagger | ||
| uri: http://user-service:9000 | ||
| predicates: | ||
| - Path=/user-doc/** | ||
| filters: | ||
| - RewritePath=/user-doc/(?<segment>.*), /$\{segment} | ||
|
|
||
| - id: matching-service | ||
| uri: http://matching-service:9001 | ||
| predicates: | ||
| - Path=/api/matching/**, /api/internal/matching/** | ||
| filters: | ||
| - AuthorizationHeaderFilter | ||
|
|
||
| - id: matching-service-swagger | ||
| uri: http://matching-service:9001 | ||
| predicates: | ||
| - Path=/matching-doc/** | ||
| filters: | ||
| - RewritePath=/matching-doc/(?<segment>.*), /$\{segment} | ||
|
|
||
| - id: chat-service | ||
| uri: http://chat-service:9003 | ||
| predicates: | ||
| - Path=/api/chat/**, /api/internal/chat/**, /ws/** | ||
| filters: | ||
| - AuthorizationHeaderFilter | ||
|
|
||
| - id: chat-service-swagger | ||
| uri: http://chat-service:9003 | ||
| predicates: | ||
| - Path=/chat-doc/** | ||
| filters: | ||
| - RewritePath=/chat-doc/(?<segment>.*), /$\{segment} | ||
|
|
||
| - id: item-service | ||
| uri: http://item-service:9006 | ||
| predicates: | ||
| - Path=/api/items/**, /api/internal/items/** | ||
| filters: | ||
| - AuthorizationHeaderFilter | ||
|
|
||
| - id: notification-service | ||
| uri: http://notification:9005 | ||
| predicates: | ||
| - Path=/api/fcm/** | ||
| filters: | ||
| - AuthorizationHeaderFilter | ||
|
|
||
| default-filters: | ||
| - DedupeResponseHeader=Access-Control-Allow-Origin Access-Control-Allow-Credentials, RETAIN_FIRST | ||
|
|
||
| jwt: | ||
| secret: ${JWT_SECRET} | ||
| access-token: | ||
| expiration: ${ACCESS_TOKEN_EXP:86400000} | ||
| refresh-token: | ||
| expiration: ${REFRESH_TOKEN_EXP:604800000} | ||
|
|
||
| logging: | ||
| level: | ||
| org.springframework.cloud.gateway: INFO |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
secureflag for authentication cookies is set tofalse. This allows sensitive tokens (accessToken and refreshToken) to be transmitted over unencrypted HTTP connections, making them vulnerable to interception via Man-in-the-Middle (MitM) attacks. It is highly recommended to set this totruefor production environments.