Annotation Interface Shield


@Documented @Target(FIELD) @Retention(RUNTIME) public @interface Shield
标注在字段上,用以说明字段上那些类型需要脱敏 脱敏后,插件在写请求后对数据脱敏后存在数据库,对读请求不拦截 设计的考虑: 本来想过将生效条件单独抽离为一个注解,这样可以达到条件注解的复用 但是有一个缺点,当指定多个策略时,条件的注解就会太宽泛,无法保证精细到每一个策略生效的场景 平衡的方式: 在 Strategy 注解中,可以指定策略 默认是全部,如果指定,则只针对其中的某个策略生效
Since:
Java 17+
Author:
Kimi Liu
  • Element Details

    • key

      String key
      json中的key的信息
      Returns:
      the string
      Default:
      ""
    • type

      脱敏类型 不同的脱敏类型置换*的方式不同
      Returns:
      the object
      Default:
      NONE
    • mode

      脱敏模型 不同的脱敏类型脱敏模型可自定义模型
      Returns:
      the object
      Default:
      MIDDLE
    • field

      String field
      该属性从哪个字段取得
      Returns:
      the string
      Default:
      ""
    • shadow

      String shadow
      设置遮挡字符
      Returns:
      the string
      Default:
      "*"
    • fixedHeaderSize

      int fixedHeaderSize
      固定的头部字符数量
      Returns:
      the int
      Default:
      0
    • fixedTailorSize

      int fixedTailorSize
      固定的尾部字符数量
      Returns:
      the int
      Default:
      3
    • autoFixedPart

      boolean autoFixedPart
      自动头尾固定部分
      Returns:
      the boolean
      Default:
      true
    • condition

      Class<? extends ConditionProvider> condition
      注解生效的条件
      Returns:
      the object
      Default:
      org.aoju.bus.sensitive.Condition.class
    • strategy

      Class<? extends StrategyProvider> strategy
      脱敏策略
      Returns:
      the object
      Default:
      org.aoju.bus.sensitive.strategy.DafaultStrategy.class