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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/main/java/dev/admin/global/config/CorsConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ public class CorsConfig {

private static final String SERVER_URL = "https://admin.tokkit.site";
private static final String USER_SERVER_URL = "https://www.tokkit.site";

private static final String API_SERVER_URL = "https://api.tokkit.site";
private static final String FRONT_LOCALHOST_URL = "http://localhost:3000";
private static final String SERVER_LOCALHOST_URL = "http://localhost:8080";
Expand Down
15 changes: 12 additions & 3 deletions src/main/java/dev/admin/global/config/RedisConfig.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package dev.admin.global.config;

import org.springframework.boot.autoconfigure.data.redis.RedisProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.connection.RedisConnectionFactory;
Expand All @@ -9,14 +10,22 @@
@Configuration
public class RedisConfig {

private final RedisProperties redisProperties;

public RedisConfig(RedisProperties redisProperties) {
this.redisProperties = redisProperties;
}

@Bean
public RedisConnectionFactory redisConnectionFactory() {
return new LettuceConnectionFactory();
return new LettuceConnectionFactory(
redisProperties.getHost(),
redisProperties.getPort()
);
}

// RedisTemplate 등록
@Bean
public StringRedisTemplate stringRedisTemplate(RedisConnectionFactory connectionFactory) {
return new StringRedisTemplate(connectionFactory);
}
}
}
11 changes: 6 additions & 5 deletions src/main/java/dev/admin/global/config/SecurityConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,16 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
return http
.csrf(csrf -> csrf.disable())
.authorizeHttpRequests(auth -> auth
.requestMatchers("/test/**").permitAll() // ✅ 여기를 추가!
.requestMatchers("/admin-api/health").permitAll() // ✅ 여기를 추가!

.requestMatchers(
"/admin-api/login",
"/admin-api/logout",
"/swagger-ui.html",
"/swagger-ui/**",
"/v3/api-docs/**"
).permitAll() .requestMatchers("/admin-api/me", "/admin-api/**").authenticated()
"/admin-api/swagger-ui.html",
"/admin-api/swagger-ui/**",
"/admin-api/v3/api-docs/**"
).permitAll()
.requestMatchers("/admin-api/me", "/admin-api/**").authenticated()
.anyRequest().denyAll()
)
.sessionManagement(sess -> sess.sessionCreationPolicy(SessionCreationPolicy.STATELESS))
Expand Down
5 changes: 4 additions & 1 deletion src/main/java/dev/admin/global/config/SwaggerConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ public OpenAPI openAPI() {
Server localServer = new Server()
.url("http://localhost:8080")
.description("Local development server");
Server prodServer = new Server()
.url("https://api.tokkit.site:8080")
.description("Local development server");

return new OpenAPI()
.components(new Components()
Expand All @@ -53,6 +56,6 @@ public OpenAPI openAPI() {
.title("토킷(TOKKIT) ADMIN API 명세서")
.description("토킷(TOKKIT) ADMIN API 명세서입니다.")
.version("1.0.0"))
.servers(List.of(defaultServer, localServer));
.servers(List.of(defaultServer, localServer,prodServer));
}
}