Giter Club home page Giter Club logo

easypeel-method-security's Introduction

Easypeel Method Security

Build Status Coverage Status Maven Central JavaDoc License

You can easily configure method-level security in your RestController through annotations.

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.

Requirements

⚠️ Requires Spring Boot 3.x

Dependencies

implementation 'org.easypeelsecurity:easypeel-method-security:0.0.4'
<dependency>
  <groupId>org.easypeelsecurity</groupId>
  <artifactId>easypeel-method-security</artifactId>
  <version>0.0.4</version>
  <scope>provided</scope>
</dependency>

Quick Start

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.

1.1. Only IP based ban :

@GetMapping("/")
@MethodBan(times = 3, seconds = 10, banSeconds = 1000) // this
public String hello() {
  return "Hello World!";
}

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 :

@PostMapping("/")
@MethodBan(times = 3, seconds = 10, banSeconds = 1000,
    banMessage = "You're writing too fast. Please try again later.",
    additionalFilter = @ParameterFilter(name = "enterpriseUser")) // this
public void createJobPosting(
    @CurrentUser EnterpriseUserAccount enterpriseUser) {
  // ... 

}

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!

Contributing

Contributions are welcome! Please feel free to submit a Pull Request. More information can be found in the CONTRIBUTING.md file.

License

This project is licensed under the terms of the apache 2.0 license.

easypeel-method-security's People

Contributors

penekhun avatar dependabot[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.