7 Star 34 Fork 13

Ahoo-Wang / CoSec

2023-11-06 11:09
384561 ahoowang 1628263882 Ahoo-Wang

更新内容 🎉 🎉 🎉

  • 特性:新增 OpenAPIPolicyGenerator
  • 特性:新增 CoSecPolicyGeneratorEndpoint
  • 特性:新增 LocalPolicyInitializer
  • 特性:新增 LocalPolicyLoader
  • 依赖:更新 me.ahoo.cosid:cosid-bom 版本 v2.5.6
  • 依赖:更新 org.springframework.boot:spring-boot-dependencies 版本 v3.1.5
  • 依赖:更新 me.ahoo.cocache:cocache-bom 版本 v2.2.2
2023-07-26 09:19
384561 ahoowang 1628263882 Ahoo-Wang

更新内容(v2.2.0) 🎉 🎉 🎉

全面支持 Spring Boot 3

  • 依赖:更新 me.ahoo.cosid:cosid-bom 版本 v2.2.5
  • 依赖:更新 org.springframework.boot:spring-boot-dependencies 版本 v3.1.2
  • 依赖:更新 me.ahoo.cocache:cocache-bom 版本 v2.0.3
  • 特性:新增 MatcherFactoryRegister 支持扫描注册 Spring 容器定义的 ConditionMatcherFactory / ActionMatcherFactory 增强 SPI
  • 特性:EqConditionMatcher 支持参数 ignoreCase
  • 特性:支持从路径变量(:/user/{id})中抽取参数,注入到安全上下文(request.path.var.*),以供 ConditionMatcher 使用
  • 特性:EqConditionMatcher 支持 Spel 表达式语言
{
      "name": "RequestPathVarTemplate",
      "action": "/user/{id}",
      "condition": {
        "eq": {
          "part": "request.path.var.id",
          "value": "#{principal.id}"
        }
      }
    }
最后提交信息为: feat: support Expression. (#204)
2023-03-26 22:26
384561 ahoowang 1628263882 Ahoo-Wang

更新内容(v1.16.8) 🎉 🎉 🎉

  • 特性:新增 CompositeActionMatcher
    {
      "name": "TestComposite",
      "effect": "allow",
      "action": {
        "composite": [
          "/user/#{principal.id}/*",
          {
            "path": {
              "method": "POST",
              "pattern": [
                "/user/#{principal.id}/order/*"
              ]
            }
          }
        ]
      }
    }
  • 特性:新增 InRoleConditionMatcher
{
  "name": "TestInRole",
  "effect": "allow",
  "action": "*",
  "condition": {
    "inRole": {
      "value": "admin"
    }
  }
}
最后提交信息为: feat: add InRoleConditionMatcher (#125)
2023-03-23 23:01
384561 ahoowang 1628263882 Ahoo-Wang

更新内容(v1.16.3) 🎉 🎉 🎉

  • 特性:新增 GroupedRateLimiterConditionMatcher 支持分组限流。
{
  "groupedRateLimiter": {
    "part": "request.remoteIp",
    "permitsPerSecond": 10,
    "expireAfterAccessSecond": 1000
  }
}
  • 特性:Policy / AppPermission 支持顶级 Condition,降低重复配置
  • 重构:重构角色权限策略,提升易用性
{
  "id": "manage",
  "condition": {
    "bool": {
      "and": [
        {
          "authenticated": {}
        },
        {
          "groupedRateLimiter": {
            "part": "request.remoteIp",
            "permitsPerSecond": 10,
            "expireAfterAccessSecond": 1000
          }
        }
      ]
    }
  },
  "groups": [
    {
      "name": "订单管理",
      "permissions": [
        {
          "id": "manage.order.ship",
          "name": "发货",
          "action": "/order/ship"
        },
        {
          "id": "manage.order.issueInvoice",
          "name": "开票",
          "action": "/order/issueInvoice"
        }
      ]
    }
  ]
}
  • 重构:策略 Schema,增强自动补全,提升易用性
  • 依赖:更新 CosId 版本到 v1.18.5
最后提交信息为: test: Improve code coverage
2023-01-10 19:24
384561 ahoowang 1628263882 Ahoo-Wang

更新内容(v1.10.3) 🎉 🎉 🎉

  • 特性:新增 StartsWithConditionMatcher
    {
      "name": "TestStartsWith",
      "effect": "allow",
      "actions": [
        {
          "type": "all"
        }
      ],
      "condition": {
        "type": "starts_with",
        "part": "request.attributes.ipRegion",
        "pattern": "中国"
      }
    }
  • 特性:新增 EndsWithConditionMatcher
    {
      "name": "TestEndsWith",
      "effect": "allow",
      "actions": [
        {
          "type": "all"
        }
      ],
      "condition": {
        "type": "ends_with",
        "part": "request.attributes.remoteIp",
        "pattern": ".168.0.1"
      }
    }
```​
2023-01-10 14:10
384561 ahoowang 1628263882 Ahoo-Wang

更新内容

  • 特性:新增 ContainsConditionMatcher。
    {
      "name": "TestContains",
      "effect": "allow",
      "actions": [
        {
          "type": "all"
        }
      ],
      "condition": {
        "type": "contains",
        "part": "request.attributes.ipRegion",
        "pattern": "上海"
      }
    }
Kotlin
1
https://gitee.com/AhooWang/CoSec.git
git@gitee.com:AhooWang/CoSec.git
AhooWang
CoSec
CoSec

搜索帮助