Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
9acb3ee
Merge pull request #171 from teamterning/develop
JungYoonShin Nov 1, 2024
e60506d
Merge pull request #172 from teamterning/staging
JungYoonShin Nov 2, 2024
4664817
Merge pull request #182 from teamterning/develop
junggyo1020 Dec 11, 2024
5535ae8
Merge pull request #184 from teamterning/develop
junggyo1020 Dec 13, 2024
896064c
Merge pull request #187 from teamterning/develop
jsoonworld Dec 21, 2024
a89de38
Merge pull request #189 from teamterning/develop
junggyo1020 Dec 29, 2024
d2f8666
Update README.md
jsoonworld Jan 4, 2025
02fdb2c
Merge pull request #190 from teamterning/jsoonworld-patch-1
jsoonworld Jan 4, 2025
1d121ab
Merge pull request #192 from teamterning/develop
junggyo1020 Jan 5, 2025
a4ade93
Merge pull request #194 from teamterning/develop
junggyo1020 Jan 12, 2025
182ba97
Update DOCKER-CD.yml
junggyo1020 Jan 18, 2025
69ef707
[πŸ”₯ !hotfix] μš΄μ˜μ„œλ²„ λ§ˆμ΄κ·Έλ ˆμ΄μ…˜ μž‘μ—… μ§„ν–‰
junggyo1020 Jan 18, 2025
995958d
[πŸ”₯ !hotfix] μš΄μ˜μ„œλ²„ λ§ˆμ΄κ·Έλ ˆμ΄μ…˜ μž‘μ—… μ§„ν–‰
junggyo1020 Jan 18, 2025
23060ec
Merge pull request #188 from teamterning/staging
junggyo1020 Jan 18, 2025
3521887
[πŸ”₯ !hotfix] μš΄μ˜μ„œλ²„ λ§ˆμ΄κ·Έλ ˆμ΄μ…˜ μž‘μ—… μ§„ν–‰
junggyo1020 Jan 18, 2025
90e672a
Update DOCKER-CD-STAGING.yml
junggyo1020 Jan 18, 2025
2fbcbd2
[πŸ”₯ !hotfix] μŠ€ν…Œμ΄μ§• μ„œλ²„ λ§ˆμ΄κ·Έλ ˆμ΄μ…˜ μž‘μ—… μ§„ν–‰
junggyo1020 Jan 18, 2025
6b6e2f5
Merge pull request #195 from teamterning/main
junggyo1020 Jan 18, 2025
f3eb6b3
Merge pull request #209 from teamterning/develop
junggyo1020 Mar 28, 2025
adfadfe
Merge pull request #217 from teamterning/develop
JungYoonShin Apr 1, 2025
6a84c4b
Merge pull request #223 from teamterning/develop
junggyo1020 Apr 6, 2025
feca3f0
[ !hotfix] NOT NULL 속성에 μ˜ν•œ 였λ₯˜μΈμ§€ 확인
junggyo1020 Apr 6, 2025
c343848
[chore] testλ₯Ό μœ„ν•œ μ£Όμ„μ²˜λ¦¬
junggyo1020 Apr 13, 2025
9acfa18
[chore] HS256 μ•Œκ³ λ¦¬μ¦˜ 적용
junggyo1020 Apr 13, 2025
d7f8bf1
[chore] HS256 μ•Œκ³ λ¦¬μ¦˜ 적용
junggyo1020 Apr 13, 2025
83ac110
[chore] RS256 μ•Œκ³ λ¦¬μ¦˜ 재적용
junggyo1020 Apr 13, 2025
79b3557
[chore] RS256 μ•Œκ³ λ¦¬μ¦˜ 재적용
junggyo1020 Apr 13, 2025
d688ebb
[chore] RS256 μ•Œκ³ λ¦¬μ¦˜ 재적용
junggyo1020 Apr 13, 2025
211ad16
[chore] HS256 μ•Œκ³ λ¦¬μ¦˜ 재적용
junggyo1020 Apr 13, 2025
3688894
[chore] JwtKeyProviderκ°€ 자체적으둜 RSA ν‚€ νŽ˜μ–΄λ₯Ό μƒμ„±ν•˜λ„λ‘ μ½”λ“œλ₯Ό μˆ˜μ •
junggyo1020 Apr 14, 2025
71c8673
[chore] Apple 둜그인이 μ•ˆλ˜λ˜ 문제 ν•΄κ²°
junggyo1020 Apr 14, 2025
8a0da9b
[chore] 짧은 μ„œλ²„κ°„ μ‘λ‹΅μ‹œκ°„ μ‘°μ •
junggyo1020 Apr 14, 2025
f79003e
Merge branch 'staging' into fix/#228-preQA
junggyo1020 Apr 14, 2025
6d80592
[πŸ”¨ fix] 동기적 λ°©μ‹μœΌλ‘œ μ•Œλ¦Όμ„œλ²„μ— username 변경을 μ μš©ν•˜λ„λ‘ λ³€κ²½
junggyo1020 Apr 14, 2025
46baf67
[πŸ”¨ fix] 동기적 λ°©μ‹μœΌλ‘œ μ•Œλ¦Όμ„œλ²„μ— νšŒμ› νƒˆν‡΄λ₯Ό μ μš©ν•˜λ„λ‘ λ³€κ²½
junggyo1020 Apr 14, 2025
af2c537
[✨ feat] μ†Œμ…œλ‘œκ·ΈμΈ μ‹œ, ν΄λΌμ΄μ–ΈνŠΈ μΈ‘μ—μ„œ fcmToken을 RequestBody둜 μ „λ‹¬ν•˜λ„λ‘ μΆ”κ°€
junggyo1020 Apr 14, 2025
79edcbb
[✨ feat] fcmToken이 μ—†λŠ” μœ μ €κ°€ μ†Œμ…œλ‘œκ·ΈμΈμ„ ν•˜λ©΄ μƒˆλ‘­κ²Œ λ°œκΈ‰λ°›λ„λ‘ μˆ˜μ •
junggyo1020 Apr 14, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/DOCKER-CD-STAGING.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ jobs:

- name: docker image λΉŒλ“œ 및 ν‘Έμ‹œ
run: |
docker build -f Dockerfile-staging --platform linux/amd64 -t terningpoint/terning-staging .
docker push terningpoint/terning-staging
docker build -f Dockerfile-staging --platform linux/amd64 -t terningpoint/terning2025-staging .
docker push terningpoint/terning2025-staging
working-directory: ${{ env.working-directory }}

cd:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/DOCKER-CD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ jobs:

- name: docker image λΉŒλ“œ 및 ν‘Έμ‹œ
run: |
docker build --platform linux/amd64 -t terningpoint/terning-deploy .
docker push terningpoint/terning-deploy
docker build --platform linux/amd64 -t terningpoint/terning2025 .
docker push terningpoint/terning2025
working-directory: ${{ env.working-directory }}

cd:
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,10 @@
<br/>



## Back-end (Spring 🌱)

| <img src="https://github.com/user-attachments/assets/8e71a4f2-70e7-4a80-b658-de0eea90b0e0" width=300px alt="μ„œλ²„/정정ꡐ"/> | <img src="https://github.com/user-attachments/assets/7cdc140f-5281-45b5-88ac-a952cc327247" width=300px alt="μ„œλ²„/μ‹ μ •μœ€"/> | <img src="https://github.com/user-attachments/assets/54c89379-08b8-4737-8da0-5bfad27e49fe" width=300px alt="μ„œλ²„/ꢌμž₯순"/>
| <img src="https://github.com/user-attachments/assets/8e71a4f2-70e7-4a80-b658-de0eea90b0e0" width=300px alt="μ„œλ²„/정정ꡐ"/> | <img src="https://github.com/user-attachments/assets/7cdc140f-5281-45b5-88ac-a952cc327247" width=300px alt="μ„œλ²„/μ‹ μ •μœ€"/> | <img src="https://github.com/user-attachments/assets/4f3006b2-4869-408e-b12b-d954a5b79d9d" width=300px alt="μ„œλ²„/ꢌμž₯순"/>
| :-----: | :-----: | :-----: |
| [정정ꡐ/Junggyo1020](https://github.com/junggyo1020) | [μ‹ μ •μœ€/JungYoonShin](https://github.com/JungYoonShin) | [ꢌμž₯순/jsoonworld](https://github.com/jsoonworld) |

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import org.springframework.transaction.annotation.Transactional;
import org.terning.terningserver.auth.application.social.SocialAuthProvider;
import org.terning.terningserver.auth.application.social.SocialAuthServiceManager;
import org.terning.terningserver.external.notification.FcmTokenValidationClient;
import org.terning.terningserver.external.notification.NotificationUserClient;
import org.terning.terningserver.jwt.application.JwtTokenManager;
import org.terning.terningserver.domain.Token;
import org.terning.terningserver.domain.User;
Expand All @@ -21,7 +21,8 @@ public class AuthSignInServiceImpl implements AuthSignInService {
private final SocialAuthServiceManager socialAuthServiceManager;
private final JwtTokenManager jwtTokenManager;
private final UserRepository userRepository;
private final FcmTokenValidationClient fcmTokenValidationClient;
private final NotificationUserClient notificationUserClient;
// private final FcmTokenValidationClient fcmTokenValidationClient;

@Transactional
@Override
Expand All @@ -30,15 +31,21 @@ public SignInResponse signIn(String authAccessToken, SignInRequest request) {
User user = findUserByAuthIdAndType(authId, request.authType());

if (user == null) {
return SignInResponse.of(null, authId, request.authType(), null, false);
// return SignInResponse.of(null, authId, request.authType(), null, false);
return SignInResponse.of(null, authId, request.authType(), null);
}

Token token = jwtTokenManager.generateToken(user);
user.updateRefreshToken(token.getRefreshToken());

boolean fcmReissueRequired = fcmTokenValidationClient.requestFcmTokenValidation(user.getId());
// boolean fcmReissueRequired = fcmTokenValidationClient.requestFcmTokenValidation(user.getId());

return SignInResponse.of(token, authId, request.authType(), user.getId(), fcmReissueRequired);
if (request.fcmToken() != null && !request.fcmToken().trim().isEmpty()) {
notificationUserClient.updateFcmToken(user.getId(), request.fcmToken());
}

// return SignInResponse.of(token, authId, request.authType(), user.getId(), fcmReissueRequired);
return SignInResponse.of(token, authId, request.authType(), user.getId());
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,10 @@ private PublicKey getPublicKey(JsonObject object) {
String modulus = object.get(MODULUS).getAsString();
String exponent = object.get(EXPONENT).getAsString();

byte[] modulusBytes = Base64.getUrlDecoder().decode(modulus.substring(QUOTES, modulus.length() - QUOTES));
byte[] exponentBytes = Base64.getUrlDecoder().decode(exponent.substring(QUOTES, exponent.length() - QUOTES));
// byte[] modulusBytes = Base64.getUrlDecoder().decode(modulus.substring(QUOTES, modulus.length() - QUOTES));
byte[] modulusBytes = Base64.getUrlDecoder().decode(modulus);
// byte[] exponentBytes = Base64.getUrlDecoder().decode(exponent.substring(QUOTES, exponent.length() - QUOTES));
byte[] exponentBytes = Base64.getUrlDecoder().decode(exponent);

BigInteger modulusValue = new BigInteger(POSITIVE_NUMBER, modulusBytes);
BigInteger exponentValue = new BigInteger(POSITIVE_NUMBER, exponentBytes);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import lombok.NonNull;
import org.terning.terningserver.domain.enums.AuthType;

public record SignInRequest(@NonNull AuthType authType) {
public static SignInRequest of(AuthType authType){
return new SignInRequest(authType);
public record SignInRequest(@NonNull AuthType authType, String fcmToken) {
public static SignInRequest of(AuthType authType, String fcmToken){
return new SignInRequest(authType, fcmToken);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ public record SignInResponse(
String refreshToken,
Long userId,
String authId,
AuthType authType,
boolean fcmTokenReissueRequired
AuthType authType
// boolean fcmTokenReissueRequired
) {
public static SignInResponse of(Token token, String authId, AuthType authType, Long userId, boolean fcmTokenReissueRequired) {
public static SignInResponse of(Token token, String authId, AuthType authType, Long userId) {
return new SignInResponse(
Optional.ofNullable(token).map(Token::getAccessToken).orElse(null),
Optional.ofNullable(token).map(Token::getRefreshToken).orElse(null),
userId,
authId,
authType,
fcmTokenReissueRequired
authType
// fcmTokenReissueRequired
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
@OpenAPIDefinition(
servers = {
@Server(url = "https://www.terning-official.p-e.kr", description = "Default Server url"),
@Server(url = "https://www.terning-official.n-e.kr", description = "Default Server url (2025 ver.)"),
@Server(url = "http://15.165.242.132", description = "Staging Server URL"),
@Server(url = "http://54.180.215.35", description = "Staging Server URL (2025 ver.)"),
@Server(url = "http://localhost:8080", description = "Local Development Server URL")
}
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ public void addCorsMappings(CorsRegistry registry) {
"http://localhost:8080",
"http://localhost:3000",
"https://www.terning-official.p-e.kr/",
"http://15.165.242.132") // ν—ˆμš©ν•  좜처 : νŠΉμ • λ„λ©”μΈλ§Œ 받을 수 있음
"https://www.terning-official.n-e.kr/",
"http://15.165.242.132",
"http://54.180.215.35") // ν—ˆμš©ν•  좜처 : νŠΉμ • λ„λ©”μΈλ§Œ 받을 수 있음
.allowedMethods("GET", "POST", "PUT", "DELETE", "PATCH") // ν—ˆμš©ν•  HTTP method
.allowCredentials(true); // μΏ ν‚€ 인증 μš”μ²­ ν—ˆμš©
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/terning/terningserver/domain/Scrap.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class Scrap extends BaseTimeEntity {
private Color color;

@Embedded
@AttributeOverride(name = "value", column = @Column(name = "synced", nullable = false))
@AttributeOverride(name = "value", column = @Column(name = "synced"))
private SyncStatus syncStatus;

private Scrap(User user, InternshipAnnouncement internshipAnnouncement, Color color) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
@Configuration
public class WebClientConfig {

private static final int CONNECT_TIMEOUT_MILLIS = 2000;
private static final int CONNECT_TIMEOUT_MILLIS = 5000;
private static final int READ_TIMEOUT_SECONDS = 2;
private static final int WRITE_TIMEOUT_SECONDS = 2;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,23 @@ public void createUserOnNotificationServer(
log.info("User (id={}) created on notification server : ", userId);
}

/**
* μ•Œλ¦Όμ„œλ²„μ— μƒˆλ‘œμš΄ fcm 토큰을 μ „λ‹¬ν•©λ‹ˆλ‹€.
*
* @param userId μ‚¬μš©μž ID
* @param newToken μƒˆλ‘œμš΄ fcm 토큰
*/
public void updateFcmToken(Long userId, String newToken) {
notificationWebClient.put()
.uri("/api/v1/users/{userId}/fcm-tokens", userId)
.body(Mono.just(newToken), String.class)
.retrieve()
.bodyToMono(Void.class)
.block();

log.info("FCM tokens updated for user (id={}): {}", userId, newToken);
}

/**
* μ•Œλ¦Όμ„œλ²„μ— μ‹ κ·œ μ‚¬μš©μž 정보λ₯Ό μ „λ‹¬ν•˜μ—¬ μ‚¬μš©μž λ ˆμ½”λ“œλ₯Ό μƒμ„±ν•©λ‹ˆλ‹€.
* μš΄μ˜μ„œλ²„μ—μ„œλŠ” pushStatus 값을 DB에 μ €μž₯ν•˜μ§€ μ•Šκ³ ,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
package org.terning.terningserver.jwt.provider;

import io.jsonwebtoken.SignatureAlgorithm;
import io.jsonwebtoken.security.Keys;
import java.security.KeyPair;
import java.security.PrivateKey;
import java.security.PublicKey;
import org.springframework.stereotype.Component;
import org.terning.terningserver.config.ValueConfig;

import javax.crypto.SecretKey;

@Component
public class JwtKeyProvider {

public static SecretKey getSigningKey(ValueConfig valueConfig) {
return Keys.hmacShaKeyFor(valueConfig.getSecretKey().getBytes());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import org.terning.terningserver.dto.user.request.ProfileUpdateRequestDto;
import org.terning.terningserver.exception.CustomException;
import org.terning.terningserver.exception.enums.ErrorMessage;
import org.terning.terningserver.external.notification.NotificationUserClient;
import org.terning.terningserver.external.user.application.UserSyncEventService;
import org.terning.terningserver.repository.user.UserRepository;
import org.terning.terningserver.dto.user.response.ProfileResponseDto;
Expand All @@ -22,13 +23,15 @@ public class UserServiceImpl implements UserService {

private final UserRepository userRepository;
private final UserSyncEventService userSyncEventService;
private final NotificationUserClient notificationUserClient;

@Override
@Transactional
public void deleteUser(User user) {
try {
userRepository.delete(user);
userSyncEventService.recordWithdraw(user.getId());
// userSyncEventService.recordWithdraw(user.getId());
notificationUserClient.deleteUser(user.getId());
} catch (Exception e) {
throw new CustomException(FAILED_WITHDRAW);
}
Expand All @@ -54,7 +57,8 @@ public void updateProfile(Long userId, ProfileUpdateRequestDto request){
ProfileImage profileImage = ProfileImage.fromValue(request.profileImage());

if (!user.getName().equals(request.name())) {
userSyncEventService.recordNameChange(userId, request.name());
// userSyncEventService.recordNameChange(userId, request.name());
notificationUserClient.updateUserName(userId, request.name());
}

//ν”„λ‘œν•„ μ—…λ°μ΄νŠΈ
Expand Down
Loading