Repository navigation
[pull] develop from bfenetworks:develop - #317
Merged
Merged
Conversation
- Add json:"-" to RouteRule.Cond to avoid unmarshaling interface field - Provide Session in test requests so condition.Match() does not bail out - Adjust ai_route.data test fixture: remove apikey default rule and entity from ak_user_a binding so global fallback can be reached as expected - Update data_load_test to expect one apikey rule after fixture change
Introduce AiRouteDataFile/RouteTableFile/RouteRuleFile for JSON loading and keep AiRouteData/RouteTable/RouteRule as runtime types with compiled condition.Condition. This avoids unmarshaling into interface fields and makes the data pipeline clearer.
Add .gitattributes to force LF for test fixtures whose byte-exact content is compared in unit tests. Convert affected working-tree files from CRLF back to LF and un-ignore .gitattributes in .gitignore. Fixes: - bfe_modules/mod_static: index.html size mismatch (59 vs 53) - bfe_modules/mod_markdown: markdown renderer output mismatch due to CRLF input and expected-output files
Add integration tests under tests/integration/mod_ai_route/ covering: - Multiple route tables search order (apikey -> entity) - Entity fallback when apikey table has no match - No-binding 404 handling - Multiple targets weighted random selection - Multiple fallbacks success and all-fail scenarios - Model override through target and fallback Includes testdata fixtures (bfe.conf, cluster_conf, host/route/vip rules, ai_route.data) and a test harness that starts mock httptest backends, constructs a lightweight BfeServer, and invokes ServeHTTPForAI directly.
Signed-off-by: liangchuan <liangchuan@yf-networks.com>
Signed-off-by: liangchuan <liangchuan@yf-networks.com>
Signed-off-by: liangchuan <liangchuan@yf-networks.com>
- 添加 AiRouteDataFile 自定义 UnmarshalJSON,支持 RouteRules 大写字段 - 将 api_key 字符串/对象统一归一化为 apikey,兼容 InnerAPI 导出
…works/proxy-wasm-go-host v0.0.1 - Replace github.com/baidu/go-lib imports with github.com/bfenetworks/go-lib - Add HttpAddr/HttpsAddr/MonitorAddr to ConfigBasic for loopback binding - Adapt log4go.NewTimeFileLogWriter call for updated fork API - Update go.mod/go.sum to tagged releases
Make all primary clusters return 500 so the request always falls back to cluster_fallback_1, ensuring deterministic target and fallback model assertions.
AI gateway routing
…ntation - Update configuration docs to match code - Update condition docs to match code primitives - Add missing module docs (mod_waf, mod_markdown, mod_ai_route, mod_ai_rate_limit, mod_access_pb3) - Fix module doc inconsistencies (fields, types, metrics) - Sync en_us modules with zh_cn - Update monitor docs to match code state structs
docs: sync and supplement zh_cn/en_us documentation with code impleme…
…n tables - Add 00-common.md with reusable types (Port, ListenAddr, FilePath, DirPath, Version, Hostname, IPAddr, Weight, HTTPStatusCodePattern) for both languages - Convert core config docs (bfe.conf, tls, routing, cluster, gslb, etc.) to the six-column format: item | type | meaning | required | notes | validity - Create per-module configuration directories under configuration/mod_* for 32 extension modules, migrating config sections from modules/mod_* - Update module guide docs to link to the new configuration docs - Update SUMMARY.md with Common Types and Module Configuration sections - Fix relative links to 00-common.md from subdirectories
docs(configuration): unify zh_cn and en_us config docs with six-column tables
test(bfe_modules): add comprehensive unit tests
When an API-key enables quota but the Redis balance key does not exist yet, HasBalance returned redis.ErrNil as INTERNAL_QUOTA_ERROR and rejected requests. Fixes #1292 Changes: - HasBalance treats redis.ErrNil as full quota. - Deduct Lua script initializes the key to Quota on first deduction. - Add unit tests for QuotaPlan.HasBalance and QuotaPlan.Deduct. - Expand mod_ai_token_auth docs (zh_cn/en_us) with quota design details.
fix(mod_ai_token_auth): handle uninitialized quota redis key (#1292)
Use sync/atomic.Bool instead of plain bool for package-level openDebug, so concurrent reads from WafClient.detect goroutines and writes from ModuleWaf.Init() are properly synchronized. This fixes go test -race failures in mod_unified_waf.
fix(mod_unified_waf): fix data race on openDebug
Revert "fix(mod_ai_token_auth): handle uninitialized quota redis key …
This reverts commit e08123e.
Revert "fix(mod_unified_waf): fix data race on openDebug"
merge new update from develop
Signed-off-by: zhangmiao <zhangmiao@yf-networks.com>
docs: update CHANGELOG for v1.8.4 release
fix(mod_unified_waf): make openDebug atomic to fix data race
This reverts commit cbe0de4.
Signed-off-by: xuleiming <leiming.xu@163.com>
fix data race in unit test in V1.8.4
bfe_server: fix AI gateway reverse proxy fallback and SSE timeout handling
feat(docker): add log-reader to image
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )