mirror of
https://github.com/agent-substrate/substrate.git
synced 2026-10-02 03:24:42 +08:00
Working on https://github.com/agent-substrate/substrate/issues/1563 ## Summary Initializes an embedded OpenFGA server within `ateapi` backed by PostgreSQL and updates the top-level authorization scope. ## Key Changes - **Rename scope to `global`**: Renamed `type cluster` and `parent_cluster` to `type global` and `parent_global`, adding `can_set_policy` and `can_get_policy` to `global`. - **Embedded OpenFGA server (`internal/authz/server.go`)**: - Compiles `model.fga` into OpenFGA's protobuf representation. - Runs OpenFGA PostgreSQL schema migrations (`goose_db_version`). - Serializes startup via `pg_advisory_lock` to avoid multi-replica races. - Connects OpenFGA's PostgreSQL adapter with a new dedicated `*pgxpool.Pool`. - Idempotently creates or reuses the `"substrate"` store and authorization model. - **Service wiring (`cmd/ateapi`)**: Exposes `Pool()` on `*atepg.Persistence` and initializes `authz.NewServer` on bootstrap. ## Verification - `openfga model test`: 103/103 checks passing (`model_test.fga.yaml`). - `go test -mod=mod ./internal/authz/...`: Passes against PostgreSQL (migrations, tuple writes, permission checks, and restart idempotency).
1.8 KiB
1.8 KiB
0.6.1 (2025-03-02)
API Changes:
- the
StringKeymethod is marked as deprecated starting from Go 1.24. See https://github.com/Yiling-J/theine-go/pull/61 for more details.
Enhancements:
- Fix data race after
Close: https://github.com/Yiling-J/theine-go/pull/60 - Use
maphash.Comparableas the hash function for Go 1.24 onward https://github.com/Yiling-J/theine-go/pull/61
0.6.0 (2024-10-29)
API Changes:
- Added a new option,
UseEntryPool, to the builder, which defaults to false. Enabling this option will reuse evicted entries through a sync pool. The sync pool was used by default before v0.6.0 and could not be turned off; but it only benefits systems optimized for allocation and those with heavy concurrent writes. See the README for more details.
Enhancements:
- Theine now uses a single LRU window as the "W" part of W-TinyLFU, adaptively changing its size based on hit ratio. This approach is consistent with Caffeine and should improve hit ratios across various workloads.
0.5.0 (2024-10-10)
API Changes:
- The NVM secondary cache has been moved to a separate package: https://github.com/Yiling-J/theine-nvm.
Enhancements:
- Reduced
Setallocations, making Theine zero allocation (amortized). - Improved read performance slightly by utilizing a cached
nowvalue. - Fixed race conditions in cost (weight) updates that could cause inaccurate policy cost.
- Added benchmarks for different
GOMAXPROCvalues in the README.
0.4.1 (2024-08-22)
Enhancements:
- Use x/sys/cpu cacheline size by @Yiling-J in https://github.com/Yiling-J/theine-go/pull/43
- Add Size method on cache by @nlachfr in https://github.com/Yiling-J/theine-go/pull/41
- Accurate hits/misses counter by @Yiling-J in https://github.com/Yiling-J/theine-go/pull/44
- Add stats API by @Yiling-J in https://github.com/Yiling-J/theine-go/pull/45