Skip to content

Commit

Permalink
Ready for update version 0.0.3 (#25)
Browse files Browse the repository at this point in the history
* docs: Update README.md

* chore(maven): Update Version information
  • Loading branch information
PENEKhun committed Feb 11, 2024
1 parent 31d3e7d commit 2b637a0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 18 deletions.
32 changes: 15 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@
You can easily configure method-level security in your
RestController through annotations.

This includes the ability to implement an IP-based ban on
specific methods, which is activated when certain traffic thresholds are reached.

> Since it's still in beta, the software currently has limited features. If you're interested in
> following the project's progress, please press the ⭐ button to stay updated.
Expand All @@ -21,20 +18,16 @@ specific methods, which is activated when certain traffic thresholds are reached
## Dependencies

For gradle,

```groovy
annotationProcessor 'io.github.easypeel-security:easypeel-method-security:{{VERSION}}'
annotationProcessor 'io.github.easypeel-security:easypeel-method-security:0.0.3'
```

For maven,

```xml

<dependency>
<groupId>io.github.easypeel-security</groupId>
<artifactId>easypeel-method-security</artifactId>
<version>{{VERSION}}</version>
<version>0.0.3</version>
<scope>provided</scope>
</dependency>
```
Expand All @@ -43,6 +36,11 @@ For maven,

### 1. MethodBan

The @MethodBan enables you to implement a simple Rate Limit within your controller.
If you need more details, please check the [details] page.

[details]: https://github.com/easypeel-security/easypeel-method-security/wiki/MethodBan

**1.1. Only IP based ban :**

```java
Expand All @@ -54,25 +52,25 @@ public String hello() {
}
```

> Once a same IP accesses an API `3 times` within `10 seconds`, they are prevented from accessing
> the
> same API for `1000 banSeconds`.
> Once a `same IP` accesses an API `3 times` within `10 seconds`, they are prevented from accessing
> the same API for `1000 banSeconds`.
**1.2. IP & User based ban :**

```java

@Secured(ROLES.ENTERPRISE)
@PostMapping("/job-posting")
@MethodBan(times = 2, seconds = 10, banSeconds = 1000,
@PostMapping("/")
@MethodBan(times = 3, seconds = 10, banSeconds = 1000,
banMessage = "You're writing too fast. Please try again later.",
additionalFilter = @ParameterFilter(name = "enterpriseUser")) // this
public ApiResponse<JobPostingCreateRes> createJobPosting(
public void createJobPosting(
@CurrentUser EnterpriseUserAccount enterpriseUser) {
// ...

}
```

> Once a same IP and User Credential accesses an API `2 times` within `10 seconds`, they are
> Once a `same IP and User Credential` accesses an API `3 times` within `10 seconds`, they are
> prevented from accessing the same API for `1000 banSeconds`.
### 2. Another Feature is Coming Soon!
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
easypeelMethodSecurityVersion=0.0.2
easypeelMethodSecurityVersion=0.0.3
rootPackageName=io.github.easypeel-security
easypeelMethodSecurity=easypeel-method-security

Expand Down

0 comments on commit 2b637a0

Please sign in to comment.