Skip to content

Conversation

@sangyunpark99
Copy link
Collaborator

No description provided.

- TokenValidator를 제거하고 TokenProvider 중심의 인증 구조로 통일
- isValidToken 메서드를 extractClaims로 대체하여 Claims 반환 기반 검증 방식으로 변경
- 블랙리스트 체크 및 토큰 파싱 로직을 하나의 흐름으로 통합
- Claims 기반으로 사용자 이메일, 타입, 상태 정보를 헤더에 추가
- 필터에서 인증 후 사용자 정보 전달을 위한 ServerWebExchange 변형 지원
@sangyunpark99 sangyunpark99 changed the title Feat/7 api gateway feat: api-gateway 구현 Apr 17, 2025
validateStoredRefreshToken(email, refreshToken);
Token newToken = generateAndStoreToken(email, userPrincipal.getUserType(), userPrincipal.getUserStatus());
Token newToken = generateAndStoreToken(email, UserType.valueOf(userType), UserStatus.valueOf(userStatus));
return new TokenResponseDto(newToken);
Copy link
Collaborator

Choose a reason for hiding this comment

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

    return new TokenResponseDto(this.generateAndStoreToken(email, UserType.valueOf(userType), UserStatus.valueOf(userStatus)));

public Mono<Void> filter(final ServerWebExchange exchange, final GatewayFilterChain chain) {
final ServerHttpRequest request = exchange.getRequest();

if (isWhitelisted(request)) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

WhitelistMatcher.isWhitelisted;

public String resolveToken(final ServerHttpRequest request) {
final String authHeader = request.getHeaders().getFirst(HttpHeaders.AUTHORIZATION);
if (authHeader == null || !authHeader.startsWith(BEARER_PREFIX)) {
return null;
Copy link
Collaborator

Choose a reason for hiding this comment

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

return "";


public class HttpResponseUtils {

private static final String JSON_CONTENT_TYPE = "application/json";
Copy link
Collaborator

Choose a reason for hiding this comment

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

private final String JSON_CONTENT_TYPE = "application/json";

Copy link
Collaborator

Choose a reason for hiding this comment

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

private String JSON_CONTENT_TYPE = "application/json";

@RequiredArgsConstructor
public class RedisTokenRepository {

private static final String BLACKLIST_KEY = "black_list:";
Copy link
Collaborator

Choose a reason for hiding this comment

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

private static final String BLACKLIST_KEY = "black_list:";
private final String BLACKLIST_KEY = "black_list:";

@sangyunpark99 sangyunpark99 merged commit 675f97b into develop Apr 19, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants