Skip to content

Commit

Permalink
Merge pull request #25 from guoshiqiufeng/dev
Browse files Browse the repository at this point in the history
1.6.9
  • Loading branch information
guoshiqiufeng authored Mar 29, 2022
2 parents 26d9702 + b8484b9 commit edf7c91
Show file tree
Hide file tree
Showing 69 changed files with 317 additions and 116 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#### 介绍
内核框架
#### 依赖
- spring-boot 2.6.4
- spring-boot 2.6.5
- spring-cloud 2021.0.1
- spring-cloud-alibaba 2021.0.1.0
- kernel-dependencies 1.6.3
Expand Down Expand Up @@ -35,6 +35,7 @@
- [ ] 模块拆分
- [ ] 文档
- [ ] demo
- [vea](https://github.com/guoshiqiufeng/vea) 微服务demo
#### 安装教程
使用maven进行依赖安装

Expand Down
11 changes: 1 addition & 10 deletions kernel-all-spring-boot-starter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,11 @@
<parent>
<groupId>com.gitee.fubluesky.kernel</groupId>
<artifactId>kernel</artifactId>
<version>1.6.7</version>
<version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>kernel-all-spring-boot-starter</artifactId>
<version>1.6.7</version>
<description>spring-boot 依赖引用</description>
<inceptionYear>2021-Now</inceptionYear>
<packaging>pom</packaging>
Expand All @@ -34,42 +33,34 @@
<dependency>
<groupId>com.gitee.fubluesky.kernel</groupId>
<artifactId>jwt-spring-boot-starter</artifactId>
<version>${kernel.version}</version>
</dependency>
<dependency>
<groupId>com.gitee.fubluesky.kernel</groupId>
<artifactId>cache-redis-spring-boot-starter</artifactId>
<version>${kernel.version}</version>
</dependency>
<dependency>
<groupId>com.gitee.fubluesky.kernel</groupId>
<artifactId>db-spring-boot-starter</artifactId>
<version>${kernel.version}</version>
</dependency>
<dependency>
<groupId>com.gitee.fubluesky.kernel</groupId>
<artifactId>security-spring-boot-starter</artifactId>
<version>${kernel.version}</version>
</dependency>
<dependency>
<groupId>com.gitee.fubluesky.kernel</groupId>
<artifactId>auth-spring-boot-starter</artifactId>
<version>${kernel.version}</version>
</dependency>
<dependency>
<groupId>com.gitee.fubluesky.kernel</groupId>
<artifactId>file-all-spring-boot-starter</artifactId>
<version>${kernel.version}</version>
</dependency>
<dependency>
<groupId>com.gitee.fubluesky.kernel</groupId>
<artifactId>file-expand-apk</artifactId>
<version>${kernel.version}</version>
</dependency>
<dependency>
<groupId>com.gitee.fubluesky.kernel</groupId>
<artifactId>push-spring-boot-starter</artifactId>
<version>${kernel.version}</version>
</dependency>
</dependencies>

Expand Down
33 changes: 23 additions & 10 deletions kernel-auth/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,36 @@ pom添加依赖
<dependency>
<groupId>com.gitee.fubluesky.kernel</groupId>
<artifactId>auth-spring-boot-starter</artifactId>
<version>1.6.6</version>
<version>1.6.8</version>
</dependency>
```
### 配置
| 参数 | 名称 | 备注 |
|------------------------------------|-------------------------------------------------------------------------|------------------|
| kernel.auth.token-prefix | jwt 生成 token 前缀 | 默认为Bearer |
| kernel.auth.token-param-name | 请求中token 参数名称 | 默认为Authorization |
| kernel.auth.token-header-name | 请求头中token 参数名称 | 默认为Authorization |
| kernel.auth.token-cookie-name | cookie中token 参数名称 | 默认为Authorization |
| kernel.auth.jwt-app-id-header-name | 请求头中 jwt app id 参数名称 (用于获取jwt模块所使用加密的密钥对应的参数名,若 jwt模块开启多租户则必填,若 未开启可忽略) | 默认为 appId |
| kernel.auth.security-config-enabled | 是否开启spring security config | 默认为 true |
| kernel.auth.security-config-allow-patterns | spring security 放行路径 | |
| 参数 | 名称 | 备注 |
|-------------------------------------|-------------------------------------------------------------------------|------------------|
| kernel.auth.token-prefix | jwt 生成 token 前缀 | 默认为Bearer |
| kernel.auth.token-param-name | 请求中token 参数名称 | 默认为Authorization |
| kernel.auth.token-header-name | 请求头中token 参数名称 | 默认为Authorization |
| kernel.auth.token-cookie-name | cookie中token 参数名称 | 默认为Authorization |
| kernel.auth.jwt-app-id-header-name | 请求头中 jwt app id 参数名称 (用于获取jwt模块所使用加密的密钥对应的参数名,若 jwt模块开启多租户则必填,若 未开启可忽略) | 默认为 appId |
| kernel.auth.security.enabled | 是否开启spring security config | 默认为 true |
| kernel.auth.security.allow-patterns | spring security 放行路径 | |
### security
can set `kernel.auth.security-config-enabled: false` to skip this config
can set `kernel.auth.security-config-allow-patterns: -/url` to allow patterns

若想不使用spring security ,添加依赖时排除`spring-boot-starter-security`依赖
```xml
<dependency>
<groupId>com.gitee.fubluesky.kernel</groupId>
<artifactId>auth-spring-boot-starter</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</exclusion>
</exclusions>
</dependency>
```
#### security-config-allow-patterns example
```yaml
kernel:
Expand Down
2 changes: 1 addition & 1 deletion kernel-auth/auth-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<groupId>com.gitee.fubluesky.kernel</groupId>
<artifactId>kernel-auth</artifactId>
<version>1.6.7</version>
<version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,19 @@ public class AuthProperties {
*/
private String jwtAppIdHeaderName = "appId";

/**
* 是否启用spring security config
*/
private Boolean securityConfigEnabled = true;
private SecurityProperties security;

/**
* 启用 spring security config 后 spring security 放行路径
*/
private List<String> securityConfigAllowPatterns;
@Data
public static class SecurityProperties {

/**
* 是否启用spring security config
*/
private Boolean enabled = true;

/**
* 启用 spring security config 后 spring security 放行路径
*/
private List<String> allowPatterns;
}
}
8 changes: 4 additions & 4 deletions kernel-auth/auth-sdk/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<groupId>com.gitee.fubluesky.kernel</groupId>
<artifactId>kernel-auth</artifactId>
<version>1.6.7</version>
<version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand All @@ -38,17 +38,17 @@
<dependency>
<groupId>com.gitee.fubluesky.kernel</groupId>
<artifactId>security-sdk-captcha</artifactId>
<version>${kernel.version}</version>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.gitee.fubluesky.kernel</groupId>
<artifactId>cache-sdk-redis</artifactId>
<version>${kernel.version}</version>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.gitee.fubluesky.kernel</groupId>
<artifactId>jwt-spring-boot-starter</artifactId>
<version>${kernel.version}</version>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ protected void configure(HttpSecurity http) throws Exception {
http.headers()
.addHeaderWriter(new XFrameOptionsHeaderWriter(XFrameOptionsHeaderWriter.XFrameOptionsMode.SAMEORIGIN));

if (ListUtils.isNotEmpty(authProperties.getSecurityConfigAllowPatterns())) {
http.authorizeRequests().antMatchers(authProperties.getSecurityConfigAllowPatterns().toArray(new String[1]))
if (ListUtils.isNotEmpty(authProperties.getSecurity().getAllowPatterns())) {
http.authorizeRequests().antMatchers(authProperties.getSecurity().getAllowPatterns().toArray(new String[1]))
.permitAll();
}
http.authorizeRequests().requestMatchers(CorsUtils::isPreFlightRequest).permitAll().anyRequest()
Expand Down
6 changes: 3 additions & 3 deletions kernel-auth/auth-spring-boot-starter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<groupId>com.gitee.fubluesky.kernel</groupId>
<artifactId>kernel-auth</artifactId>
<version>1.6.7</version>
<version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand All @@ -38,12 +38,12 @@
<dependency>
<groupId>com.gitee.fubluesky.kernel</groupId>
<artifactId>security-spring-boot-starter</artifactId>
<version>${kernel.version}</version>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.gitee.fubluesky.kernel</groupId>
<artifactId>cache-redis-spring-boot-starter</artifactId>
<version>${kernel.version}</version>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
@EnableWebSecurity
@EnableGlobalMethodSecurity(prePostEnabled = true)
@AutoConfigureAfter(value = { AuthAutoConfiguration.class })
@ConditionalOnProperty(prefix = "kernel.auth", name = "securityConfigEnabled", matchIfMissing = true)
@ConditionalOnProperty(prefix = "kernel.auth.security", name = "enabled", havingValue = "true")
public class SecurityAutoConfiguration {

@Bean
Expand Down
4 changes: 2 additions & 2 deletions kernel-auth/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<groupId>com.gitee.fubluesky.kernel</groupId>
<artifactId>kernel</artifactId>
<version>1.6.7</version>
<version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand All @@ -33,7 +33,7 @@
<dependency>
<groupId>com.gitee.fubluesky.kernel</groupId>
<artifactId>kernel-core</artifactId>
<version>${kernel.version}</version>
<version>${project.version}</version>
</dependency>
</dependencies>

Expand Down
2 changes: 1 addition & 1 deletion kernel-cache/cache-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<groupId>com.gitee.fubluesky.kernel</groupId>
<artifactId>kernel-cache</artifactId>
<version>1.6.7</version>
<version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion kernel-cache/cache-redis-spring-boot-starter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pom添加依赖
<dependency>
<groupId>com.gitee.fubluesky.kernel</groupId>
<artifactId>cache-redis-spring-boot-starter</artifactId>
<version>1.6.6</version>
<version>1.6.8</version>
</dependency>
```

Expand Down
2 changes: 1 addition & 1 deletion kernel-cache/cache-redis-spring-boot-starter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<groupId>com.gitee.fubluesky.kernel</groupId>
<artifactId>kernel-cache</artifactId>
<version>1.6.7</version>
<version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion kernel-cache/cache-sdk-redis/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<groupId>com.gitee.fubluesky.kernel</groupId>
<artifactId>kernel-cache</artifactId>
<version>1.6.7</version>
<version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
3 changes: 1 addition & 2 deletions kernel-cache/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<groupId>com.gitee.fubluesky.kernel</groupId>
<artifactId>kernel</artifactId>
<version>1.6.7</version>
<version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand All @@ -33,7 +33,6 @@
<dependency>
<groupId>com.gitee.fubluesky.kernel</groupId>
<artifactId>kernel-core</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>

Expand Down
2 changes: 1 addition & 1 deletion kernel-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<groupId>com.gitee.fubluesky.kernel</groupId>
<artifactId>kernel</artifactId>
<version>1.6.7</version>
<version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion kernel-db/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pom添加依赖
<dependency>
<groupId>com.gitee.fubluesky.kernel</groupId>
<artifactId>db-spring-boot-starter</artifactId>
<version>1.6.6</version>
<version>1.6.8</version>
</dependency>
```

Expand Down
2 changes: 1 addition & 1 deletion kernel-db/db-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<groupId>com.gitee.fubluesky.kernel</groupId>
<artifactId>kernel-db</artifactId>
<version>1.6.7</version>
<version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion kernel-db/db-sdk-mybatis-plus/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<groupId>com.gitee.fubluesky.kernel</groupId>
<artifactId>kernel-db</artifactId>
<version>1.6.7</version>
<version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion kernel-db/db-spring-boot-starter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<groupId>com.gitee.fubluesky.kernel</groupId>
<artifactId>kernel-db</artifactId>
<version>1.6.7</version>
<version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
3 changes: 1 addition & 2 deletions kernel-db/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<groupId>com.gitee.fubluesky.kernel</groupId>
<artifactId>kernel</artifactId>
<version>1.6.7</version>
<version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand All @@ -33,7 +33,6 @@
<dependency>
<groupId>com.gitee.fubluesky.kernel</groupId>
<artifactId>kernel-core</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>

Expand Down
2 changes: 1 addition & 1 deletion kernel-email/email-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<groupId>com.gitee.fubluesky.kernel</groupId>
<artifactId>kernel-email</artifactId>
<version>1.6.7</version>
<version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion kernel-email/email-sdk-java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<groupId>com.gitee.fubluesky.kernel</groupId>
<artifactId>kernel-email</artifactId>
<version>1.6.7</version>
<version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion kernel-email/email-spring-boot-starter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pom添加依赖
<dependency>
<groupId>com.gitee.fubluesky.kernel</groupId>
<artifactId>email-spring-boot-starter</artifactId>
<version>1.6.6</version>
<version>1.6.8</version>
</dependency>
```

Expand Down
Loading

0 comments on commit edf7c91

Please sign in to comment.