Skip to content
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

[Feature][scaleph-security] replace carp security module #742

Merged
merged 10 commits into from
Jul 28, 2024
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
4 changes: 2 additions & 2 deletions .github/workflows/release-manual-docker-flink-cdc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ on:
flinkCDCVersion:
description: 'flink-cdc version'
required: true
default: '3.0.0'
default: '3.1.1'
type: choice
options:
- 3.0.0
- 3.1.1
flinkVersion:
description: 'flink version'
required: true
Expand Down
7 changes: 7 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
<packaging>pom</packaging>
<name>scaleph</name>
<description>Scaleph System</description>
<url>https://github.com/flowerfine/scaleph</url>

<licenses>
<license>
Expand Down Expand Up @@ -150,6 +151,7 @@
<okhttp.version>4.10.0</okhttp.version>
<guava.version>32.1.3-jre</guava.version>
<minio.version>8.3.8</minio.version>
<carp.version>0.0.1</carp.version>
<milky.version>1.0.13</milky.version>
<sakura.version>1.0.2</sakura.version>
<hadoop.version>3.3.4</hadoop.version>
Expand Down Expand Up @@ -492,6 +494,11 @@
<version>${disruptor.version}</version>
</dependency>

<dependency>
<groupId>cn.sliew</groupId>
<artifactId>carp-module-security-spring</artifactId>
<version>${carp.version}</version>
</dependency>
<dependency>
<groupId>cn.sliew</groupId>
<artifactId>milky-common</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
@SpringBootApplication(scanBasePackages = "cn.sliew")
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
/**
* @author gleiyu
*/
@Configuration
//@Configuration
public class I18nConfig {
/**
* 配置默认解析器
Expand All @@ -51,7 +51,7 @@ public LocaleResolver localeResolver() {
*
* @return WebMvcConfigurer
*/
@Bean
// @Bean
public WebMvcConfigurer localeInterceptor() {
return new WebMvcConfigurer() {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;

@Configuration
//@Configuration
public class MybatisConfig {

@Bean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
import org.springframework.boot.autoconfigure.AutoConfigureBefore;
import org.springframework.context.annotation.Configuration;

@Configuration
@AutoConfigureBefore(RedissonAutoConfiguration.class)
//@Configuration
//@AutoConfigureBefore(RedissonAutoConfiguration.class)
public class RedissionConfig implements RedissonAutoConfigurationCustomizer {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@

import java.util.Map;

@Configuration
// fixme 这里要用 scaleph 自己的,不能用 carp 的
//@Configuration
public class SwaggerConfig {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@
import java.util.Set;

@Slf4j
@Configuration


//@Configuration
public class WebMvcConfig implements WebMvcConfigurer {

@Autowired
Expand Down Expand Up @@ -90,7 +92,7 @@ public void addInterceptors(InterceptorRegistry registry) {
* 这玩意会造成异步请求结果无法响应,换成{@code AsyncHandlerInterceptor}就一切正常了
*/
@Slf4j
@Component
// @Component
public static class RequestResponseCacheFilter extends OncePerRequestFilter implements Ordered {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@
/**
* https://spring.io/blog/2022/02/21/spring-security-without-the-websecurityconfigureradapter
*/
@Configuration
@EnableWebSecurity
@EnableRedisHttpSession(redisNamespace = "${spring.application.name}")
@EnableGlobalMethodSecurity(prePostEnabled = true, securedEnabled = true)
//@Configuration
//@EnableWebSecurity
//@EnableRedisHttpSession(redisNamespace = "${spring.application.name}")
//@EnableGlobalMethodSecurity(prePostEnabled = true, securedEnabled = true)
public class WebSecurityConfig {

@Autowired
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@

import java.util.List;

@RestController
//@RestController
@RequestMapping("/api/admin/resource/web")
@Tag(name = "系统管理-资源管理-Web")
public class SecResourceWebController {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
*
* @author liyu
*/
@RestController
//@RestController
@RequestMapping("/api/admin/role")
@Tag(name = "系统管理-角色管理")
public class SecRoleController {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
*
* @author liyu
*/
@RestController
//@RestController
@RequestMapping("/api")
@Tag(name = "系统管理-用户管理")
public class SecUserController {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
* @author gleiyu
*/
@Slf4j
@ControllerAdvice
//@ControllerAdvice
public class GlobalExceptionHandler {

/**
Expand Down
5 changes: 5 additions & 0 deletions scaleph-api/src/main/resources/application-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@

spring:
datasource:
carp:
driver-class-name: com.mysql.cj.jdbc.Driver
jdbc-url: jdbc:mysql://${MYSQL_HOST:127.0.0.1}:${MYSQL_PORT:3306}/carp?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&useAffectedRows=true
username: ${MYSQL_USERNAME:root}
password: ${MYSQL_PASSWORD:123456}
master:
driver-class-name: com.mysql.cj.jdbc.Driver
jdbc-url: jdbc:mysql://${MYSQL_HOST:127.0.0.1}:${MYSQL_PORT:3306}/scaleph?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&useAffectedRows=true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
/**
* @author gleiyu
*/
@Component
//@Component
public class I18nUtil {

private static MessageSource messageSource;
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Loading
Loading