diff --git a/core/pom.xml b/core/pom.xml index 91451806213d0a4ea5740b88ae4d6a0e1ad906e4..4d29d55d1cc4ac73fb7b2c0f25407a35742e9f4d 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -6,13 +6,16 @@ sureness com.usthe.sureness 0.0.2 + ../pom.xml 4.0.0 sureness-core sureness https://github.com/tomsun28/sureness - The Protection For Restful Api + + Sureness is a simple and efficient open-source security framework that focus on protection for restful api. + 0.0.2 @@ -43,21 +46,20 @@ - 1.7.21 0.9.0 1.17 + 3.1.0 javax.servlet javax.servlet-api - 3.1.0 + ${servlet.api.version} provided org.slf4j slf4j-api - ${slf4j.version} @@ -76,12 +78,10 @@ javax.xml.bind jaxb-api - 2.3.0 junit junit - 4.12 test diff --git a/pom.xml b/pom.xml index 02e748e889f63e03f6db8c752aabd75b971e2295..b28c4eedadb43a690cf06d17ff31ab6e7682eccb 100644 --- a/pom.xml +++ b/pom.xml @@ -17,8 +17,39 @@ UTF-8 1.8 + 1.7.21 + 2.3.0 + + 4.12 + 4.0.2 + + + + javax.xml.bind + jaxb-api + ${xml.bind.version} + + + org.slf4j + slf4j-api + ${slf4j.version} + + + org.easymock + easymock + ${easymock.version} + test + + + junit + junit + ${junit.version} + test + + + diff --git a/sample-bootstrap/src/main/java/com/usthe/sureness/sample/bootstrap/controller/AccountController.java b/sample-bootstrap/src/main/java/com/usthe/sureness/sample/bootstrap/controller/AccountController.java index c4f66c6c08245c260b0910c51f4b851be237dc1f..b43e80a641ab8365b307bfdb26f35df6398ee899 100644 --- a/sample-bootstrap/src/main/java/com/usthe/sureness/sample/bootstrap/controller/AccountController.java +++ b/sample-bootstrap/src/main/java/com/usthe/sureness/sample/bootstrap/controller/AccountController.java @@ -10,12 +10,9 @@ import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RequestPart; import org.springframework.web.bind.annotation.RestController; import java.util.Collections; -import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.UUID; @@ -28,6 +25,7 @@ import java.util.UUID; @RestController() public class AccountController { + private static final String APP_ID = "appId"; /** * 账户数据提供 */ @@ -41,7 +39,7 @@ public class AccountController { */ @PostMapping("/api/v1/account/auth") public ResponseEntity login(@RequestBody Map requestBody) { - if (requestBody == null || !requestBody.containsKey("appId") + if (requestBody == null || !requestBody.containsKey(APP_ID) || !requestBody.containsKey("password")) { return ResponseEntity.badRequest().build(); }