Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev_jakarta'
Browse files Browse the repository at this point in the history
  • Loading branch information
lazycece committed May 26, 2023
2 parents bd8cd2c + 6f3a548 commit 888a0b6
Show file tree
Hide file tree
Showing 10 changed files with 123 additions and 60 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,5 @@ build/
.vscode/

### custom ###
logs/
logs/
.flattened-pom.xml
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@

`Au api`是一个基于[Au框架](https://github.com/lazycece/au) 实现的api安全框架,支持token认证、防拦截、参数签名以及数据加密等,适用于任何基于`servlet`的web项目, 如Spring, Spring Boot 等等。

## Environment

Au API 环境依赖如下:

|Au API|Java|Servlet Api|
|---|---|---|
|1.x|1.8+|javax.servlet-api:>=4.0.0|
|2.x|17+|jakarta.servlet-api:>=5.0.0|

## 如何使用?

> `spring boot`项目请移步[`au-api-spring-boot`](https://github.com/lazycece/au-api-spring-boot)
Expand All @@ -31,7 +40,7 @@
<dependency>
<groupId>com.lazycece.au</groupId>
<artifactId>au-api</artifactId>
<version>${au.core.version}</version>
<version>${au-api.version}</version>
</dependency>
```

Expand Down
15 changes: 14 additions & 1 deletion au-api-all/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<artifactId>au-api-parent</artifactId>
<groupId>com.lazycece.au</groupId>
<version>1.0.2</version>
<version>${revision}</version>
</parent>
<artifactId>au-api</artifactId>
<name>au-api-all</name>
Expand All @@ -24,4 +24,17 @@
<version>${project.version}</version>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${maven.javadoc.plugin.version}</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
</project>
49 changes: 38 additions & 11 deletions au-api-example/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,44 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.4.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
<artifactId>au-api-parent</artifactId>
<groupId>com.lazycece.au</groupId>
<version>${revision}</version>
</parent>
<groupId>com.lazycece.au</groupId>
<artifactId>au-api-example</artifactId>
<version>1.0.0</version>
<name>au-api-example</name>
<description>Au api example for Spring Boot</description>

<properties>
<java.version>1.8</java.version>
<maven.test.skip>true</maven.test.skip>
<au.api.version>1.0.2</au.api.version>
<spring-boot.version>3.1.0</spring-boot.version>
</properties>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>${spring-boot.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<dependency>
<groupId>com.lazycece.au</groupId>
<artifactId>au-api</artifactId>
<version>${au.api.version}</version>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
Expand All @@ -55,11 +65,28 @@
</dependencies>

<build>

<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>${maven.deploy.plugin.version}</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${maven.javadoc.plugin.version}</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import jakarta.annotation.Resource;
import jakarta.servlet.http.HttpServletResponse;

/**
* @author lazycece
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotBlank;

/**
* @author lazycece
Expand Down
2 changes: 1 addition & 1 deletion au-api-params/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<artifactId>au-api-parent</artifactId>
<groupId>com.lazycece.au</groupId>
<version>1.0.2</version>
<version>${revision}</version>
</parent>
<artifactId>au-api-params</artifactId>
<description>Parameter signature, encryption and decryption .</description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.reflect.FieldUtils;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.Part;
import jakarta.servlet.ServletException;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.Part;
import java.io.IOException;
import java.lang.reflect.Field;
import java.util.*;
Expand Down Expand Up @@ -36,7 +36,7 @@ public boolean preHandle() throws Exception {
return true;
}

static class MultiPartRequestWrapper extends javax.servlet.http.HttpServletRequestWrapper {
static class MultiPartRequestWrapper extends jakarta.servlet.http.HttpServletRequestWrapper {

private Collection<Part> parts = null;

Expand Down
2 changes: 1 addition & 1 deletion au-api-token/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<artifactId>au-api-parent</artifactId>
<groupId>com.lazycece.au</groupId>
<version>1.0.2</version>
<version>${revision}</version>
</parent>
<artifactId>au-api-token</artifactId>
<description>api token</description>
Expand Down
87 changes: 50 additions & 37 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.lazycece.au</groupId>
<artifactId>au-api-parent</artifactId>
<version>1.0.2</version>
<version>${revision}</version>
<packaging>pom</packaging>
<name>${project.artifactId}</name>
<description>The parent project of Au Api</description>
Expand Down Expand Up @@ -35,31 +35,36 @@
<module>au-api-token</module>
<module>au-api-params</module>
<module>au-api-all</module>
<module>au-api-example</module>
</modules>

<properties>
<java.version>1.8</java.version>
<!-- Project revision -->
<revision>2.0.0</revision>

<java.version>17</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<!-- Maven -->
<maven.test.skip>true</maven.test.skip>
<maven.deploy.skip>true</maven.deploy.skip>
<maven.javadoc.skip>true</maven.javadoc.skip>
<maven.deploy.skip>false</maven.deploy.skip>
<maven.javadoc.skip>false</maven.javadoc.skip>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<maven.compiler.plugin.version>3.6.2</maven.compiler.plugin.version>
<maven.surefire.plugin.version>2.22.1</maven.surefire.plugin.version>
<maven.source.plugin.version>3.0.1</maven.source.plugin.version>
<maven.deploy.plugin.version>2.8.2</maven.deploy.plugin.version>
<maven.javadoc.plugin.version>2.10.4</maven.javadoc.plugin.version>
<maven.javadoc.plugin.version>3.5.0</maven.javadoc.plugin.version>
<maven.gpg.plugin.version>1.6</maven.gpg.plugin.version>
<flatten.maven.plugin.version>1.2.7</flatten.maven.plugin.version>
<!-- Test -->
<junit.version>4.13.2</junit.version>
<assertj.core.version>3.24.2</assertj.core.version>
<mockito.core.version>5.2.0</mockito.core.version>
<!-- core -->
<au.core.version>1.0.3</au.core.version>
<servlet.api.version>4.0.1</servlet.api.version>
<au.core.version>3.0.0</au.core.version>
<servlet.api.version>5.0.0</servlet.api.version>
<commons.codec.version>1.15</commons.codec.version>
<jwt.version>3.8.3</jwt.version>
<fastjson.version>1.2.83</fastjson.version>
Expand Down Expand Up @@ -112,8 +117,8 @@
<version>${au.core.version}</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
<version>${servlet.api.version}</version>
<scope>provided</scope>
</dependency>
Expand All @@ -139,36 +144,11 @@

<profiles>
<profile>
<id>jdk1.8</id>
<id>jdk17</id>
<activation>
<jdk>[1.8,)</jdk>
<jdk>[17,)</jdk>
<activeByDefault>true</activeByDefault>
</activation>
<!-- Disable doclint under JDK 8 -->
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${maven.javadoc.plugin.version}</version>
<configuration>
<additionalparam>-Xdoclint:none</additionalparam>
</configuration>
</plugin>
</plugins>
</reporting>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${maven.javadoc.plugin.version}</version>
<configuration>
<additionalparam>-Xdoclint:none</additionalparam>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>release</id>
Expand Down Expand Up @@ -242,8 +222,16 @@
<version>${maven.javadoc.plugin.version}</version>
<configuration>
<skip>${maven.javadoc.skip}</skip>
<additionalparam>-tag date</additionalparam>
<additionalJOption>-tag date</additionalJOption>
<locale>en_US</locale>
<charset>UTF-8</charset>
<encoding>UTF-8</encoding>
<docencoding>UTF-8</docencoding>
<source>${maven.compiler.source}</source>
<links>
<link>http://docs.oracle.com/javase/17/docs/api</link>
</links>
<doclint>none</doclint>
</configuration>
<executions>
<execution>
Expand All @@ -263,6 +251,31 @@
<skip>${maven.deploy.skip}</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>flatten-maven-plugin</artifactId>
<version>${flatten.maven.plugin.version}</version>
<configuration>
<updatePomFile>true</updatePomFile>
<flattenMode>resolveCiFriendliesOnly</flattenMode>
</configuration>
<executions>
<execution>
<id>flatten</id>
<phase>process-resources</phase>
<goals>
<goal>flatten</goal>
</goals>
</execution>
<execution>
<id>flatten.clean</id>
<phase>clean</phase>
<goals>
<goal>clean</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

0 comments on commit 888a0b6

Please sign in to comment.