Giter Club home page Giter Club logo

anti-replay's Introduction

naruto-anti-replay

介绍

基于SpringBoot封装的接口放重放、防篡改功能,基于Redis(Lettuce)实现分布式。

软件架构

框架 版本
SpringBoot 2.3.2.RELEASE
fastJson 1.2.76

使用说明

Maven引入

<dependency>
  <groupId>online.inote</groupId>
  <artifactId>naruto-anti-replay-spring-boot-starter</artifactId>
  <version>0.0.6-RELEASE</version>
</dependency>

配置信息

# 缓存Key前缀
naruto.security.api.anti-replay.cache.cache-key-prefix=NARUTO:SECURITY:ANTI-REPLAY:REQUEST_ID_
# 请求header属性Key
naruto.security.api.anti-replay.header-key.nonce=nonce
naruto.security.api.anti-replay.header-key.timestamp=timestamp
naruto.security.api.anti-replay.header-key.url=url
naruto.security.api.anti-replay.header-key.token=token
naruto.security.api.anti-replay.header-key.signature=signature
# 请求过期时间
naruto.security.api.anti-replay.request.expire-time=60

注:底层已做默认配置,如果没有特殊要求,可不增加以上配置。

API需要拦截的方法加注解@NarutoAntiReplay:

  @NarutoAntiReplay
  @GetMapping(value = "getInfo/{id}")
  public String getInfo(@PathVariable String id) {
    return "ok";
  }

详见naruto-anti-replay-spring-boot-sample。

anti-replay's People

Watchers

 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.