类 SecurityAttributeStorage

java.lang.Object
cn.herodotus.stirrup.oauth2.authorization.processor.SecurityAttributeStorage

@Component public class SecurityAttributeStorage extends Object

Description: SecurityAttribute 本地存储

作者:
: gengwei.zheng
Date:
: 2021/7/30 15:05
  • 构造器详细资料

    • SecurityAttributeStorage

      public SecurityAttributeStorage()
  • 方法详细资料

    • getConfigAttribute

      public List<cn.herodotus.stirrup.core.identity.domain.HerodotusSecurityAttribute> getConfigAttribute(String url, String method)
      根据请求的 url 和 method 获取权限对象
      参数:
      url - 请求 URL
      method - 请求 method
      返回:
      与请求url 和 method 匹配的权限数据,或者是空集合
    • getCompatible

      public Map<HerodotusRequest,List<cn.herodotus.stirrup.core.identity.domain.HerodotusSecurityAttribute>> getCompatible()
      从 compatible 缓存中获取全部不需要路径匹配的(包含*号的url)请求权限映射Map
      返回:
      如果缓存中存在,则返回请求权限映射Map集合,如果不存在则返回一个空的LinkedHashMap
    • addToStorage

      public void addToStorage(Map<HerodotusRequest,List<cn.herodotus.stirrup.core.identity.domain.HerodotusSecurityAttribute>> configAttributes, boolean isIndexable)
      将权限数据添加至本地存储
      参数:
      configAttributes - 权限数据
      isIndexable - true 存入 indexable cache;false 存入 compatible cache
    • addToStorage

      public void addToStorage(Map<HerodotusRequest,List<cn.herodotus.stirrup.core.identity.domain.HerodotusSecurityAttribute>> matchers, Map<HerodotusRequest,List<cn.herodotus.stirrup.core.identity.domain.HerodotusSecurityAttribute>> configAttributes, boolean isIndexable)
      将权限数据添加至本地存储,存储之前进行规则冲突校验
      参数:
      matchers - 校验资源
      configAttributes - 权限数据
      isIndexable - true 存入 indexable cache;false 存入 compatible cache