README.md 4.1 KB
Newer Older
1 2 3 4 5 6 7
<p align="center">
  <a href="https://su.usthe.com">
    <img alt="sureness" src="_media/hat-128.svg">
  </a>
</p>

# <font size="14p">sureness</font>
sinat_25235033's avatar
sinat_25235033 已提交
8

9
> A simple and efficient open-source jvm security framework that focus on the protection of restful api.
sinat_25235033's avatar
sinat_25235033 已提交
10

sinat_25235033's avatar
sinat_25235033 已提交
11 12 13 14
[![License](https://img.shields.io/badge/license-Apache%202-4EB1BA.svg)](https://www.apache.org/licenses/LICENSE-2.0.html) 
![GitHub pull request check contexts](https://img.shields.io/github/status/contexts/pulls/tomsun28/sureness/8?label=pull%20checks) 
[![Gitter](https://img.shields.io/gitter/room/usthe/sureness?label=sureness&color=orange&logo=gitter&logoColor=red)](https://gitter.im/usthe/sureness) 
![GitHub Release Date](https://img.shields.io/github/release-date/tomsun28/sureness?color=blue&logo=figshare&logoColor=red) 
sinat_25235033's avatar
sinat_25235033 已提交
15

16
## 📫 Background  
sinat_25235033's avatar
sinat_25235033 已提交
17

18 19 20 21 22
In the mainstream web architecture, how to protect the restful api provided by the back-end through effective and fast authentication has become particularly important.     
For existing frameworks, whether it is apache shiro which does not natively support rest, or deeply bound spring, the slower performance and steep learning curve of spring security are not our ideal framework.   
Ever since sureness was born, we hope to solve these, provide a **restful api**, **no framework dependency**, can **dynamically modify permissions**, **multiple authentication policies**, **faster**, **easy to use and extend** security framework.

## 🎡 <font color="green">Introduction</font>  
sinat_25235033's avatar
sinat_25235033 已提交
23

sinat_25235033's avatar
sinat_25235033 已提交
24 25 26 27 28 29
> Sureness is a new, permission project which we learn from apache shiro and add some ideas to create it.  
> Authentication for restful api, based on RBAC, mainly focused on the protection of restful api.  
> No specific framework dependency(support springboot, quarkus, javalin, ktor and more).    
> Support dynamic modification of permissions.   
> Support mainstream http container(servlet and jax-rs).    
> Supports JWT, Basic Auth, Digest Auth... Can extend custom supported authentication methods.    
sinat_25235033's avatar
sinat_25235033 已提交
30
> High performance due dictionary matching tree.      
sinat_25235033's avatar
sinat_25235033 已提交
31
> Good extension interface, demo and document.    
sinat_25235033's avatar
sinat_25235033 已提交
32

33
> The low configuration of sureness, easy to expand, and not coupled with other frameworks, enables developers to quickly and safely protect their projects in multiple scenarios.   
sinat_25235033's avatar
sinat_25235033 已提交
34

35
##### 🔍 Compare     
sinat_25235033's avatar
sinat_25235033 已提交
36 37 38 39 40 41 42 43 44 45

| ~         | sureness | shiro | spring security |
| ---       | ---      | ---   | --- |
| **multi framework support**  | support      | support need modify   | not support |
| **restful api** | support | support need modify   | support |
| **path match**  | dictionary matching tree | ant match | ant match |
| **annotation support**    | support      | support      | support |
| **servlet**    | support      | support      | support |
| **jax-rs**     | support      | not support    | not support |
| **dynamic modification of permissions** | support | support need modify | support need modify |
sinat_25235033's avatar
sinat_25235033 已提交
46
| **performance** | fast | slower | slower|
47
| **learning curve** | simple | simple | steep|
48

49
##### 📈 Benchmark  
50 51 52

![benchmark](_images/benchmark_en.png)  

sinat_25235033's avatar
sinat_25235033 已提交
53 54
**Benchmark test shows sureness to lose 0.026ms performance compared to frameless application, shiro lose 0.088ms, spring security lose 0.116ms.**    
**In contrast, sureness basically does not consume performance, and the performance (TPS loss) is 3 times that of shiro and 4 times that of spring security.**      
sinat_25235033's avatar
sinat_25235033 已提交
55
**The performance gap will be further widened as the api matching chain increases.**      
56 57

Detail see [Benchmark Test](https://github.com/tomsun28/sureness-shiro-spring-security)    
sinat_25235033's avatar
sinat_25235033 已提交
58

59
##### ✌ Framework Sample Support  
sinat_25235033's avatar
sinat_25235033 已提交
60

sinat_25235033's avatar
sinat_25235033 已提交
61 62 63 64 65 66
- [x] sureness integration springboot sample(configuration file scheme) [sample-bootstrap](sample-bootstrap.md)   
- [x] sureness integration springboot sample(database scheme) [sample-tom](sample-tom.md)  
- [x] sureness integration quarkus sample [sample-quarkus](sample-quarkus.md)  
- [x] sureness integration javalin sample [sample-javalin](sample-javalin.md)    
- [x] sureness integration ktor sample [sample-ktor](sample-ktor.md)    
- [x] sureness integration spring webflux sample [spring-webflux-sureness](sample-spring-webflux.md)    
sinat_25235033's avatar
sinat_25235033 已提交
67
- [x] more samples todo